I need some help, I got 1 ESP8266-01 with EspEasy R120 and I need to configure some rules with multiple "if-then" condition.
I have the following:
1 x ESP8266-01
2 x relays
1 x touch button
What I need:
- when I press once the touch button, turn relay 1 ON
- when I press second time, turn relay 2 ON
and the third time -> turn off both
What I got now with the rules bellow..
When I press touch button, first relay start on, then relay 2, and after that are both off -> and the cycle repeats until I press again the touch button.
Code: Select all
on Touch#Switch do
if [Touch#Switch]=1.00
gpio,1,1
event checkBec1
endif
endon
on checkBec1 do
if [Touch#Switch]=1.00
if [bec1#Switch]=1.00
gpio,2,1
event checkBec2
endif
endon
on checkBec2 do
if [Touch#Switch]=1.00
if [bec2#switch]=1.00
gpio,1,0
gpio,2,0
endif
endon
Help please, I have 0 experience with this coding type.
Thank you in advance!