I have a blocky script than activate/deactivate a venting fan based on humidity value. The script works ok but I would like to override this behavior pushing the sonoff basic button that controls the fan. So, if I will press the button the fan should stay on until I will press the button again despite humidity level.
Sonoff is connected to a Mosquitto server
Any idea ?
Many thanks in advance
If you push the burron the fan goed on and sets the user variable to 1. Of you push it to go off then make the variable 0.
In your existing scripts you add user variable = 0 to the if and elseif
and this rule in tasmota
rule1 on Button1#state=2 do backlog publish domoticz/in {"command":"setuservariable","idx":4,"value":"2"}; POWER TOGGLE ENDON
where idx 4 is ID of variable stato_cappa