Script to turn off panic mode if triggered for alarm.
Posted: Sunday 10 May 2015 0:30
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.
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¶m=resetsecuritystatus&idx='$index'&switchcmd=Normal' 2>/dev/null | jq -r .status`
done