Using Domoticz Rest API, how to create a switch with On/Off Action
Posted: Wednesday 24 March 2021 3:51
I can create a switch using the REST API:
http://192.168.18.1:8080/json.htm?type= createdevice & idx=29&sensorname=switch1&devicetype=244&devicesubtype=73
But, I don't know how to use API to fill the "On Action" "Off Action" of the created switch. I would like to have something like http://192.168.18.3/myscripyt1.sh in "On Action" , http://192.168.18.3/myscripyt2.sh in "Off Action".
Any help or advice is appreciated.
http://192.168.18.1:8080/json.htm?type= createdevice & idx=29&sensorname=switch1&devicetype=244&devicesubtype=73
But, I don't know how to use API to fill the "On Action" "Off Action" of the created switch. I would like to have something like http://192.168.18.3/myscripyt1.sh in "On Action" , http://192.168.18.3/myscripyt2.sh in "Off Action".
Any help or advice is appreciated.