I can't understand what happens. when the device, is a Sonoff Dual R2, restarts, relays bounce from on to off repeatedly. Sometimes indefinitely for both relays, other times relay 1 stops in the wrong position, other times relay 2.
The reboot is normal if both controllers are disabled.
this is my rule
Code: Select all
on System#Boot do GPIO,12,0 // Relay 1 OFF GPIO,5,0 // Relay 2 OFF let,1,0 // Set variable 1 to 0 endon on pulsante#stato do if [pulsante#stato]=1 let,1,[int#1]+1 if [int#1]=1 gpio,12,1 gpio,5,0 elseif [int#1]=2 gpio,12,0 gpio,5,1 elseif [int#1]=3 gpio,12,1 gpio,5,1 elseif [int#1]=4 let,1,0 gpio,12,0 gpio,5,0 endif endif endon