Anti intrusion interaction
Posted: Wednesday 06 March 2019 16:41
Hello everybody
sorry for posting a newbie question but I'm stuck..
I have an anti intrusion system with a web page I can interact with it with curl (no json)
I had no problem to create a switch with on and off command that calls a script like:
script://alarm.sh 1
to turn on
and
script://alarm.sh 0
to turn off
my problem is: when I turn on/off the alarm system with its remote (obviously) the Domoticz switch is not updated.. I can read the status of the alarm with another curl command but I really have not idea how to integrate it with the "switch" I created...
to be more exhaustive the curl command to read the status is:
curl --user USER:PASSWORD -X GET http://IP/controlpage.htm|grep "option value\=\".\" selected=\"selected\""|head -n 1 |cut -d "\"" -f 2
and I get 1 if the system is armed and 3 if it's disarmed
with this I'd like to update the status of the switch so I always have it updated on my Domoticz web page and the phone app too.
I'm also not sure if LUA is the right way... Is there anybody so kind to help me?
thanks a lot, Leonardo
sorry for posting a newbie question but I'm stuck..
I have an anti intrusion system with a web page I can interact with it with curl (no json)
I had no problem to create a switch with on and off command that calls a script like:
script://alarm.sh 1
to turn on
and
script://alarm.sh 0
to turn off
my problem is: when I turn on/off the alarm system with its remote (obviously) the Domoticz switch is not updated.. I can read the status of the alarm with another curl command but I really have not idea how to integrate it with the "switch" I created...
to be more exhaustive the curl command to read the status is:
curl --user USER:PASSWORD -X GET http://IP/controlpage.htm|grep "option value\=\".\" selected=\"selected\""|head -n 1 |cut -d "\"" -f 2
and I get 1 if the system is armed and 3 if it's disarmed
with this I'd like to update the status of the switch so I always have it updated on my Domoticz web page and the phone app too.
I'm also not sure if LUA is the right way... Is there anybody so kind to help me?
thanks a lot, Leonardo