Sensor

Python and python framework

Moderator: leecollings

Post Reply
elgringo
Posts: 96
Joined: Thursday 18 May 2017 8:08
Target OS: Raspberry Pi / ODroid
Domoticz version: Left
Contact:

Sensor

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

Who is online

Users browsing this forum: Google [Bot] and 1 guest