I have several ESP EASY's around my house doing various tasks but this one it just taking the piss out of me.
I have some rules set up and they all work except 1.
2 buttons with MQTT both ways. My iPhone can turn everything on and off and can see when they've been turned of physically.
The problem is with physical buttons 2 it can turn off but not on.
I must of missed something obvious.
Here are my rules:
Code: Select all
on Switch#Switch1 do // Button 1 ON
if [Switch#Switch1] = 1
gpio, 16,1 // LED
gpio, 5,0 // Relay
else
gpio, 16,0
gpio, 5,1
endif
endon
on Switch#Switch1 do // Button 1 OFF
if [Switch#Switch1] = 0
gpio, 16,0 // LED
gpio, 5,1 // Relay
else
gpio, 16,1
gpio, 5,0
endif
endon
on Switch#Switch2 do // Button 2 ON
if [Switch#Switch2] =1
gpio, 13, 1 // LED
gpio, 4, 0 // Relay
else
gpio, 13, 0
gpio, 4, 1
endif
endon
on Switch#Switch2 do // Button 2 OFF
if [Switch#Switch2] =0
gpio, 13, 0 // LED
gpio, 4, 1 // Relay
else
gpio, 13, 1
gpio, 4, 0
endif
endon