I've achieved the same result without IF statements by doing the rule below. Rule1 ON Power1#State=1 DO Add1 1 ENDON ON Power2#State=1 DO Add1 1 ENDON ON Power3#State=1 DO Add1 1 ENDON ON Power1#State=0 DO Sub1 1 ENDON ON Power2#State=0 DO Sub1 1 ENDON ON Power3#State=0 DO Sub1 1 ENDON ON Button1#State=3 DO event lightcheck=%var1% ENDON ON Button2#State=3 DO event lightcheck=%var1% ENDON ON Button3#State=3 DO event lightcheck=%var1% ENDON ON event#lightcheck>0 DO Backlog0 Power1 0; Power2 0; Power3 0 ENDON ON event#lightcheck
Hi, I'm trying to use the if, I already compiled it, but my code doesn't work: rule3 ON Power2#boot DO Var1 %value% ENDON On Power2#state DO Var1=%value% ENDON ON button1#state=10 DO IF (%Var1%==0) Backlog0 Power2 1 ELSE Power2 1 ENDIF ENDON And when I press the button this message appears: 15:43:41.813 RUL: BUTTON1#STATE=10 performs "IF (==0) Backlog0 Power2 1 ELSE Backlog0 Power2 0 ENDIF" 15:43:41.819 RSL: RESULT = {"If":"Done"} 15:43:41.823 RSL: RESULT = {"Button1":{"Action":"SINGLE"}} 15:43:42.051 RSL: RESULT = {"POWER2":"ON"} 15:43:42.054 RSL: POWER2 = ON I always keep it on.
I've achieved the same result without IF statements by doing the rule below.
Rule1
ON Power1#State=1 DO Add1 1 ENDON
ON Power2#State=1 DO Add1 1 ENDON
ON Power3#State=1 DO Add1 1 ENDON
ON Power1#State=0 DO Sub1 1 ENDON
ON Power2#State=0 DO Sub1 1 ENDON
ON Power3#State=0 DO Sub1 1 ENDON
ON Button1#State=3 DO event lightcheck=%var1% ENDON
ON Button2#State=3 DO event lightcheck=%var1% ENDON
ON Button3#State=3 DO event lightcheck=%var1% ENDON
ON event#lightcheck>0 DO Backlog0 Power1 0; Power2 0; Power3 0 ENDON
ON event#lightcheck
do you know how to use tasmota as a trigger on Alexa without needing a centralizing server
Thanks I've just built my first firmware! now it's the time learn advanced rules
I like your tuts very much. Please keep going!
Can the compilation be in a tasmota with another language?
Hi, I'm trying to use the if, I already compiled it, but my code doesn't work:
rule3
ON Power2#boot DO Var1 %value% ENDON
On Power2#state DO Var1=%value% ENDON
ON button1#state=10 DO IF (%Var1%==0) Backlog0 Power2 1 ELSE Power2 1 ENDIF ENDON
And when I press the button this message appears:
15:43:41.813 RUL: BUTTON1#STATE=10 performs "IF (==0) Backlog0 Power2 1 ELSE Backlog0 Power2 0 ENDIF"
15:43:41.819 RSL: RESULT = {"If":"Done"}
15:43:41.823 RSL: RESULT = {"Button1":{"Action":"SINGLE"}}
15:43:42.051 RSL: RESULT = {"POWER2":"ON"}
15:43:42.054 RSL: POWER2 = ON
I always keep it on.
Tasmota is just shit in my experience. Its not stable at all.