Page 1 of 1

Script to turn off panic mode if triggered for alarm.

Posted: Sunday 10 May 2015 0:30
by ketra90
Hello guys,

i thought i'd share a script i made for resetting panic mode of smoke detectors, i bet its kinda specific to my domoticz setup, but maybe this helps some ppl to make a better one.

Code: Select all

#!/bin/bash
## Setting Variable's
Domoticz_IP=
Domoticz_Port=
# DO NOT EDIT BELOW THIS LINE
declare -a arr=(`curl 'http://'$Domoticz_IP':'$Domoticz_Port'/json.htm?type=devices' 2>/dev/null | jq '.result[] | select(.Type=="Security")' | jq '.idx'`)
for index in "${arr[@]}"
do
index="${index//\"}"
echo `curl 'http://'$Domoticz_IP':'$Domoticz_Port'/json.htm?type=command&param=resetsecuritystatus&idx='$index'&switchcmd=Normal' 2>/dev/null | jq -r .status`
done

Re: Script to turn off panic mode if triggered for alarm.

Posted: Monday 04 January 2016 0:13
by ketra90
This is a script u need to execute within a switch, for example when the alarm is triggered u turn on a dummy switch, and then when this switch is turned off , the off action (this script) is executed

Re: Script to turn off panic mode if triggered for alarm.

Posted: Monday 04 January 2016 15:59
by Kroontje
Maybe a stupid question, ... but is it also possible to put smoke sensors (Fibaro) in panic mode so the siren can be used in an alarm system?

Re: Script to turn off panic mode if triggered for alarm.

Posted: Wednesday 16 March 2016 18:43
by bran2000
Hi,
when i execute the script : i have this error
ligne6: jq : commande introuvable

a problem with jq any idea ?

Thanks

Re: Script to turn off panic mode if triggered for alarm.

Posted: Saturday 02 April 2016 23:12
by ketra90
Kroontje wrote:Maybe a stupid question, ... but is it also possible to put smoke sensors (Fibaro) in panic mode so the siren can be used in an alarm system?
sorry for late answer, at this point i havent found a option to do so.

Re: Script to turn off panic mode if triggered for alarm.

Posted: Saturday 02 April 2016 23:16
by ketra90
bran2000 wrote:Hi,
when i execute the script : i have this error
ligne6: jq : commande introuvable

a problem with jq any idea ?

Thanks
JQ isnt installed by default on the system, if you are using the domoticz sdcard or a debian linux, u can use apt-get install jq to install it

Re: Script to turn off panic mode if triggered for alarm.

Posted: Sunday 03 April 2016 10:48
by Kouseri
Resetting of panic mode of smoke detectors can be done also from lua with following piece of code

Code: Select all

ipAddress = "192.168.1.2" --IP address of the Domoticz server
port = "8080" --Port of the Domoticz server
IDX = "34" --IDX value of the alarm siren
commandArray["OpenURL"]="http://"..ipAddress..":"..port.."/json.htm?type=command&param=resetsecuritystatus&idx="..IDX.."&switchcmd=Normal"