Page 1 of 1

Dummy commands in API

Posted: Friday 09 August 2019 23:33
by peychart
Hello,
I'm new here, so I do not know if I'm in the right place to ask my question ...
I designed WiFi modules based on the ESP8266 to control my home lighting (https://github.com/peychart/WiFiPowerStrip).
several control modes can be used:
- wall switches,
- the web interface included in the modules
- or via domoticz and http request.
The problem is that when the wall switches or the html interface of the sensors are used, the state of the lights is not updated in the domoticz interface ...

So I wrote a small nodeJS application that receives notifications from the ESP8266 module each time it changes state and converts it to a command sent to the domoticz API.

But the new problem that appears is that domoticz returns a new activation command during this update of the sensor states ...

Is there a way to change the state of a virtual sensor in the domoticz interface without this change generating new http commands sent to the sensor from domoticz (like a "dummy" option in the API command sent) ?

Or am I doing it wrong?

Thank you for your suggestions.

Re: Dummy commands in API

Posted: Saturday 10 August 2019 0:35
by waaren
peychart wrote: Friday 09 August 2019 23:33 But the new problem that appears is that domoticz returns a new activation command during this update of the sensor states ...
Is there a way to change the state of a virtual sensor in the domoticz interface without this change generating new http commands sent to the sensor from domoticz (like a "dummy" option in the API command sent) ?
use something like
http://<>domoticz ip>:<domoticz port>/json.htm?type=command&param=udevice&nvalue=1&svalue=1&idx=<device idx>
to switch On and
http://<>domoticz ip>:<domoticz port>/json.htm?type=command&param=udevice&nvalue=0&svalue=0&idx=<device idx>
to switch Off

Re: Dummy commands in API

Posted: Saturday 10 August 2019 5:36
by peychart
Exactly what I needed,
Thank you very much.