I have a question about the usage of the rules. i dont seem to get it (or atleast i do not get it to work.)
I have a ESP12, and i want to use it to turm on the lights by using it in domotics whit a releas.
I have it working that when i send a command to GPIO2 that a led is gooing on (or the releas but for the testing im using a led instead)
Further i want to be able to use a manual switch to power on the light. The idea is that i switch a GPIO pin on the ESP who then whit a rule switches GPIO2.
I made the following setup:
esp -> gpio 2 -> led -> ground when using the command the led is turning on.(http://192.168.178.21/control?cmd=GPIO,2,1)
esp -> gpio14 -> pushswitch ->ground. when i push the botten nothing seems to happend (do i miss a pulup/puldown resistor?) i configured the following: mode: switch input; Name: Schakelaar; GPIO14; Button type: push button active low
In the rules tab i set the following:
Code: Select all
if gpio,14,0 do
gpio,2,1
else
gpio,2,0
endif
The end goal is that the rule checks if the light is off, if the light is off then enable gpio2, if the light is on, then disable gpio2
i think it should be something like this, but i do not get it working:
Code: Select all
on gpio,14,0 do
if gpio,2,0
gpio,2,1
else
gpio,2,0
endif
endon