Simple command-line trick to Arm/Disarm, but how to ArmAway?

Information and support for EnvisaLink modules.

Moderators: EyezOnRich, GrandWizard

Post Reply
mattfarley
Posts: 2
Joined: Mon May 30, 2016 2:08 pm

Simple command-line trick to Arm/Disarm, but how to ArmAway?

Post by mattfarley »

I have a Linux server I use to automate our lights, television, air condition, etc. It mostly uses simple shell scripts to get the job done.

I have found that I can use the following shell scripts to perform certain actions with my Envisalink:

Report the current status of the alarm:

Code: Select all

curl -sS 'http://user:user@192.168.1.8/' | tidy --output-xml yes --add-xml-decl yes --doctype omit --quiet yes --show-warnings no | sed -e 's/&nbsp/foobar/g' | xpath -q -e '//*[@id="CONTENT"]/table/tr[2]/td[2]/table/tr/td[2]/text()'
Arm the alarm: (Arm Stay)

Code: Select all

curl -sS 'http://user:user@192.168.1.8/2?[b]A=3[/b]&p=1&X=1470'
Disarm:

Code: Select all

curl -sS 'http://user:user@192.168.1.8/2?[b]A=4[/b]&p=1&X=1470'
Question / Help: I've not been able to find a similar trick to do an "Arm Away". Has anyone found one they can share?

Full script for sharing: (usage would be: <scriptname> <on/off/status>

Code: Select all

# If $1 = status
if [ $1 == "status" ]; then
    # Report status:
    curl -sS 'http://user:user@192.168.1.8/' | tidy --output-xml yes --add-xml-decl yes --doctype omit --quiet yes --show-warnings no | sed -e 's/&nbsp/foobar/g' | xpath -q -e '//*[@id="CONTENT"]/table/tr[2]/td[2]/table/tr/td[2]/text()'
    exit
fi

# Loop until status contains "Armed"
if [ $1 == "on" ]; then
    while [[ "`$0 status`" != *Armed* ]]; do
        curl -sS 'http://user:user@192.168.1.8/2?A=3&p=1&X=1470' > /dev/null 2>&1
        sleep 1
    done;
    exit
fi

# Loop until status is "Ready"
if [ $1 == "off" ]; then
    while [[ "`$0 status`" != *Ready* ]]; do
        curl -sS 'http://user:user@192.168.1.8/2?A=4&p=1&X=1470' > /dev/null 2>&1
        sleep 1
    done;
    exit
fi
PS -- I also use my scripts to arm/disarm from our Amazon Echo. "Alexa, arm the house alarm". Here's my video: https://www.youtube.com/watch?v=9f5XTynrbAA
lonewolf
Posts: 24
Joined: Mon Aug 04, 2014 6:03 am

Re: Simple command-line trick to Arm/Disarm, but how to ArmA

Post by lonewolf »

The docs imply this can be done via the TPI, though I have not actually tried it myself. You might be able to get away with piping a echo/sleep/echo sequence to netcat (as you need to log in before sending the arm command), but an 'expect' script would probably be more extensible in the long run.
mattfarley
Posts: 2
Joined: Mon May 30, 2016 2:08 pm

Re: Simple command-line trick to Arm/Disarm, but how to ArmA

Post by mattfarley »

lonewolf wrote:The docs imply this can be done via the TPI, though I have not actually tried it myself. You might be able to get away with piping a echo/sleep/echo sequence to netcat (as you need to log in before sending the arm command), but an 'expect' script would probably be more extensible in the long run.
Thanks.. I suspected the same but am very reluctant to mess with the TPI interface -- last time I tried it triggered a "keypad alarm" and I got a call from the monitoring agency and they were ready to send the cops out :)

So I'd like to stick to the http hacking if possible.

But if someone had a quick (safe) shell script for Arm Away via TPI I'd be very gracious.
Post Reply