Rule not working after new firmware - Calculate: Unknown token

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
ensingg
Normal user
Posts: 26
Joined: 16 Jul 2017, 10:52

Rule not working after new firmware - Calculate: Unknown token

#1 Post by ensingg » 23 Apr 2024, 10:40

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

TD-er
Core team member
Posts: 8767
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

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

#2 Post by TD-er » 23 Apr 2024, 10:50

"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

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 1 guest