Page 1 of 1

Sensor

Posted: Saturday 20 May 2017 8:08
by elgringo
I have created a script (via ping) to detect my LAN printer is on or off. I cannot enable/disable the printer so it is only a sensor.

Script send commands van JSON

Code: Select all

pi@raspberrypi:~ $ curl "http://pi:[email protected]:8080/json.htm?type=command&param=switchlight&idx=10&switchcmd=On"
{
   "status" : "OK",
   "title" : "SwitchLight"
}
However in Domoticz I can toggle the 'sensor'. Which is not possible since it is a sensor not a switch. I found the option to protect it but than it is impossible to toggel it via JSON:

Code: Select all

pi@raspberrypi:~ $ curl "http://pi:[email protected]:8080/json.htm?type=command&param=switchlight&idx=10&switchcmd=Off"
{
   "message" : "WRONG CODE",
   "status" : "ERROR",
   "title" : "SwitchLight"
}
How can I prevent Domoticz to toggle the sensor?