Android/Tasker arming

Information and support for EnvisaLink modules.

Moderators: EyezOnRich, GrandWizard

erkme73
Posts: 21
Joined: Sun Apr 03, 2011 1:25 pm

Android/Tasker arming

Post by erkme73 »

I've only recently discovered the joys of Tasker on an Android phone. With the ability to script virtually any set of variables to trigger any number of tasks, I'm itching to automate the arming/disarming of my home.

Question for the devs or anyone else who might have come up with an alternative...

Is it possible to send a command-line instruction set to the IP100D via the internet (through ESP or direct to the card) to have it arm/disarm without the need to navigate a browser (mobile or otherwise)?

Here's what I envision: A profile on Tasker checks for the following context:

1) Monitor Google calendar for any event titled "ARM". If found,
2) Send XYZ command to XYZ interface to arm the system (i.e. txt message to card)
3) When calendar event expires, execute exit task and DISARM the alarm.

Of course, any number of variables can be used to trigger these events - i.e. when the SSID of my home network is detected, disarm... If my SSID has been visible for more than XXX hours, rearm.... If GPS location is within 30m of home, ARM home, otherwise ARM away...

In other words, a lot of fun.

I'm open to any suggestions :)
EyezOnRich
Posts: 134
Joined: Wed Nov 17, 2010 11:53 am

Re: Android/Tasker arming

Post by EyezOnRich »

Sounds very cool! You could use the stateless mobile browser interface as follows (make sure you use https):

https://www.eye-zon.com/EZMOBILE/index.php?mid=<unique hash>&action=c&did=<device mac - make sure all caps>&com=send_pin&pin=<4 or 6 digit panel code>

e.g.
"https://www.eye-zon.com/EZMOBILE/index. ... 192&action
=c&did=555BC240BD5C&com=send_pin&pin=1234"

The unique hash is the same one you would have received in the e-mail link when you did "Create Mobile Browser Login"

I'm interested to hear how it goes.
EyezOnRich
Posts: 134
Joined: Wed Nov 17, 2010 11:53 am

Re: Android/Tasker arming

Post by EyezOnRich »

Here are some additional commands:

com field _____________________additional

arm_away
arm_stay
arm_no_entry ___________________ pin=<4 or 6 digit panel code>
toggle_pgm ___________________ pgm=<pgm number 1-4>
send_bypass ___________________ zone=<zone number>
send_pound
erkme73
Posts: 21
Joined: Sun Apr 03, 2011 1:25 pm

Re: Android/Tasker arming

Post by erkme73 »

Tasker can only post to HTTP (not HTTPS). But apparently the same quick link hash works without the S.

It took some manipulating on how Tasker submits HTTP posts - it's not just a string. you have to separate the server, path, and data entry (each on it's own line) - but the end result... IT WORKS!

Now comes the fun part - coming up with all sorts of recipes for auto arm/disarm scenarios.

Thanks a bunch for the command line info!

On an aside (and somewhat related to my other post about delayed notifications), when a command is sent, it gets queued in the "command queue" visible on the portal. Is there anyway to increase the speed with which the queue is executed? I've noticed that when I send a command, sometimes after a minute, it's still sitting there. Before I realized what was happening, I'd executed the command several more times. When the queue finally let loose, the system armed, then disarmed, then armed successively about 5 times.

Now that I know about the delay, I wait until the queue is empty before I send the next command. Once I've finished tweaking my Tasker profiles, I'll back off all the commands so it won't matter as much.

EDITED TO ADD: One of the reasons a quicker queue is needed is in the following profile configuration:

When I come home, as I pull into driveway, my Android phone sees my home's wi-fi SSID. I use that as a trigger to send the disarm command. If the command sits in the queue for more than 20 seconds, the house will still be armed by the time I make it to my door. Ideally, it should disarm before that. Also, using the same context for leaving, if the SSID drops, the command to arm is sent... The longer it takes for the queue to execute, the longer my home stands unarmed after I've left.

Thx!
erkme73
Posts: 21
Joined: Sun Apr 03, 2011 1:25 pm

Re: Android/Tasker arming

Post by erkme73 »

Have another Tasker-related question...

Is there a string/command that can be sent via HTTP that will only DISARM? Since sending the pin will arm if disarmed, or disarm if armed, and there is no (easy) way for Tasker to know the current state of the alarm, I could get some unintended affects.

If the wife has gotten home before me and disarmed, and I arrive in my driveway, my phone will attempt to "disarm" by sending the pin - only to rearm as I try to get in the house.

I realize the DSC cannot differentiate between arming and disarming, but perhaps the portal can. In other words, if I send a <disarm> command, the portal will verify the current alarm state - if it's not armed, it'll simply ignore the command. If it is armed, it'll disarm.

The only other alternative is for me to have Tasker query the portal website for the alarm status - something I don't yet know how to do...

Unless you have a hash-equipped URL that would provide a quick and dirty variable that states armed or disarmed...
EyezOnRich
Posts: 134
Joined: Wed Nov 17, 2010 11:53 am

Re: Android/Tasker arming

Post by EyezOnRich »

Let me think about the hash equipped URL for checking status...could probably do something there.

But to solve the timeliness factor of your "coming home" scenario, if you have your SSID then you are now locally connected right? If so you could go right at the IP100D module with this

Disarm: http://192.168.xxx.xxx/2?A=4&p=1&X=1234

Obviously just put your code in place of the 1234 and the local IP after the http://

If it is of any value to you, you can arm it locally like this

http://192.168.xxx.xxx/2?A=3&p=1&X=1234
erkme73
Posts: 21
Joined: Sun Apr 03, 2011 1:25 pm

Re: Android/Tasker arming

Post by erkme73 »

I'm getting smarter by the hour...

Those quick arm/disarm will work perfectly! And they negate the need to query the status of the alarm. Are there any other quick commands that can be entered like this? Like no-entry-delay? and Arm-home (for when I leave and wifey is still snoring)?

As for the HTTP GET command from Tasker - it is limited to 4kb of data. Unfortunately, when I query the mobile status page, I hit the 4kb limit before it gets to the "system status" line. Ideally having a minimal text representative site for a given DID would be ideal. Something like <hash><did>status bringing up "System Armed" - and nothing else... or at least, anything else BELOW that line.

I'm still very much interested in getting the query functionality working, as it would allow me to arm THROUGH ESP - without the need for a forwarded port. Because, after I pull out of the drive, and my SSID drops, the local (192...) ip won't work anymore.
EyezOnRich
Posts: 134
Joined: Wed Nov 17, 2010 11:53 am

Re: Android/Tasker arming

Post by EyezOnRich »

I love what you are doing with it.

I made a mod to the mobile server... try this and let me know if you have any problems

"https://www.eye-zon.com/EZMOBILE/index. ... i&did=<mac>"
erkme73
Posts: 21
Joined: Sun Apr 03, 2011 1:25 pm

Re: Android/Tasker arming

Post by erkme73 »

Sexy :) Short, sweet, easy to pick clean. Gotta admit, at first, I thought it was an error message since it was so short!

Alas, I've run into some parm issues with tasker on the direct access. For some reason the syntax used to push the server/path/attributes does not work with the shorter URL. It works if I manually enter it into a browser (either from WAN with port-forwarding, or locally). So it is a Tasker issue. I'll keep playing with it.

Are there any short codes on the direct access URL that would have it arm-stay, or arm no-entry-delay?

Thanks!
EyezOnRich
Posts: 134
Joined: Wed Nov 17, 2010 11:53 am

Re: Android/Tasker arming

Post by EyezOnRich »

Unfortunately there are no direct access URLs for arm-stay or arm without code.

After reflecting on what I did I think it would be better to put the response from the new short status in XML format instead. That may help with the parsing. I'll do this:

<update>Date/Time </update><status>Status</status><trouble>YES/NO</trouble>
Post Reply