Page 1 of 1

Rule not working after new firmware - Calculate: Unknown token

Posted: 23 Apr 2024, 10:40
by ensingg
I cannot open my door anymore :-) after a new espeasy version
What do I have to change ?

On Rules#Timer=1 do
gpio,5,0
endon

On Drukknop#Switch do
if [Drukknop#Switch]=1 then
gpio,5,1
timerSet,1,3
endif

endon

Re: Rule not working after new firmware - Calculate: Unknown token

Posted: 23 Apr 2024, 10:50
by TD-er
"then" is not needed here. See: https://espeasy.readthedocs.io/en/lates ... lseif-else

And inside the "On Drukknop#Switch do" block you don't need to refer to "[Drukknop#Switch]" as it is also present as eventvalue.
This way you actually have the value of it when the event was generated and not when the rules are parsed.

So something like this:

Code: Select all

On Rules#Timer=1 do
  gpio,5,0
endon

On Drukknop#Switch do
  if %eventvalue1%=1
    gpio,5,1
    timerSet,1,3
  endif
endon