Script to turn off panic mode if triggered for alarm.

Client tools or tools that can connect with Domoticz. Tools for Windows, iOS, Android, Linux etc.

Moderator: leecollings

Post Reply
ketra90
Posts: 4
Joined: Wednesday 22 October 2014 8:23
Target OS: Windows
Domoticz version: 2284
Location: The netherlands
Contact:

Script to turn off panic mode if triggered for alarm.

Post 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
Domoticz Setup:
RAZBERRY.
Win 2008 Server On ESX USB Connected RFXtrx433E.
all externaly secured with a Sophos UTM firewall.
3x kaku dimmers
1x benext dimmer
3x kaku motion sensors
Eneco Toon
Kaku doorbell
ketra90
Posts: 4
Joined: Wednesday 22 October 2014 8:23
Target OS: Windows
Domoticz version: 2284
Location: The netherlands
Contact:

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

Post 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
Domoticz Setup:
RAZBERRY.
Win 2008 Server On ESX USB Connected RFXtrx433E.
all externaly secured with a Sophos UTM firewall.
3x kaku dimmers
1x benext dimmer
3x kaku motion sensors
Eneco Toon
Kaku doorbell
Kroontje
Posts: 14
Joined: Wednesday 11 March 2015 22:34
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post 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?
bran2000
Posts: 60
Joined: Saturday 20 June 2015 10:16
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by bran2000 »

Hi,
when i execute the script : i have this error
ligne6: jq : commande introuvable

a problem with jq any idea ?

Thanks
ketra90
Posts: 4
Joined: Wednesday 22 October 2014 8:23
Target OS: Windows
Domoticz version: 2284
Location: The netherlands
Contact:

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

Post 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.
Domoticz Setup:
RAZBERRY.
Win 2008 Server On ESX USB Connected RFXtrx433E.
all externaly secured with a Sophos UTM firewall.
3x kaku dimmers
1x benext dimmer
3x kaku motion sensors
Eneco Toon
Kaku doorbell
ketra90
Posts: 4
Joined: Wednesday 22 October 2014 8:23
Target OS: Windows
Domoticz version: 2284
Location: The netherlands
Contact:

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

Post 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
Domoticz Setup:
RAZBERRY.
Win 2008 Server On ESX USB Connected RFXtrx433E.
all externaly secured with a Sophos UTM firewall.
3x kaku dimmers
1x benext dimmer
3x kaku motion sensors
Eneco Toon
Kaku doorbell
Kouseri
Posts: 57
Joined: Sunday 04 January 2015 21:24
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Finland
Contact:

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

Post 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"
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest