Hello,
I need some help writing a correct statement in Rules to make sure that a virtual switch in Domoticz follows a GPIO, or PCFGPIO, defined by some rules, e.g. Toggle, using json.
I tried the SendToHTTP command, but I can't find the correct json syntax to send the status of that GPIO to the Domoticz IP.
I want to do this to allow ESP8266 to make some autonomous GPIO decisions, simply then notifying them to Domoticz.
I hope I have explained.
Thank you.
Make Domoticz read a GPIO pin
Moderators: grovkillen, Stuntteam, TD-er
Re: Make Domoticz read a GPIO pin
Can you use the Domoticz MQTT controller?
Then please have a look at this here: https://espeasy.readthedocs.io/en/lates ... #p029-page
Then please have a look at this here: https://espeasy.readthedocs.io/en/lates ... #p029-page
Re: Make Domoticz read a GPIO pin
Thanks for the hint.
I was wondering if it were possible using a variable that follows the GPIO state in rules, then I sendtoHTTP the value of this variable to Domoticz.
If yes, which could be the correct syntax?
I was wondering if it were possible using a variable that follows the GPIO state in rules, then I sendtoHTTP the value of this variable to Domoticz.
If yes, which could be the correct syntax?
Re: Make Domoticz read a GPIO pin
See the "monitor" command: https://espeasy.readthedocs.io/en/lates ... ernal-gpio
This will send an event as soon as the pin state changes, on which you can act in the rules.
This will send an event as soon as the pin state changes, on which you can act in the rules.
Re: Make Domoticz read a GPIO pin
I am using some Sonnofs like relays, which can be triggered by local push button, other ESP or from Domoticz and reports its actual status to Domoticz.
GPIO-0 local push button
GPIO-12 relay
From Domoticz it is switched with:
GPIO-0 local push button
GPIO-12 relay
Code: Select all
On System#Boot do
gpio,12,0
TaskValueSet,3,1,1
endon
on Tlacitko#State do
if [Pom#State]=0
event, change
else
TaskValueSet,3,1,0
SendToHTTP 192.168.1.253,8080,/json.htm?type=command¶m=switchlight&idx=163&switchcmd=Off
endif
endon
on change do
if [Relay#State]=0
gpio,12,1
SendToHTTP 192.168.1.253,8080,/json.htm?type=command¶m=switchlight&idx=163&switchcmd=On
else
gpio,12,0
SendToHTTP 192.168.1.253,8080,/json.htm?type=command¶m=switchlight&idx=163&switchcmd=Off
endif
endon
From Domoticz it is switched with:
Code: Select all
http://192.168.1.119/control?cmd=gpio,12,1
http://192.168.1.119/control?cmd=gpio,12,0
Who is online
Users browsing this forum: No registered users and 36 guests