Simple command-line trick to Arm/Disarm, but how to ArmAway?
Posted: Mon May 30, 2016 2:17 pm
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:
Arm the alarm: (Arm Stay)
Disarm:
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>
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
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/ /foobar/g' | xpath -q -e '//*[@id="CONTENT"]/table/tr[2]/td[2]/table/tr/td[2]/text()'
Code: Select all
curl -sS 'http://user:user@192.168.1.8/2?[b]A=3[/b]&p=1&X=1470'
Code: Select all
curl -sS 'http://user:user@192.168.1.8/2?[b]A=4[/b]&p=1&X=1470'
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/ /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