Rules: can <if statement> work before Clock#Time ?

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
JR01
Normal user
Posts: 260
Joined: 14 Feb 2016, 21:04
Location: South Africa

Rules: can <if statement> work before Clock#Time ?

#1 Post by JR01 » 29 Nov 2020, 21:28

Hi, will below work? i.e. will the clock#time do the evaluation embedded in a if statement? Or should it be the other way ariund, 1st the clock#time statement to trigger @ the correct time- and then the if statement? (Below does not seam to work - but I want to confirm).

Code: Select all

if Vars2#Auto=1 and Vars2#AutoGardener=0
  On Clock#Time=All,10:00 do 
    event,L1 
  endon

  On Clock#Time=All,11:00 do 
    event,L2
  endon

  On Clock#Time=All,12:00 do 
    event,L3
  endon

  On Clock#Time=All,13:00 do 
    event,L4
  endon
endif
-----------
IOTPLAY. Tinkerer, my projects are @ http://GitHub.com/IoTPlay, and blog https://iotplay.org. Using RPi, Node-Red, ESP8266 to prove Industry 4.0 concepts.

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

Re: Rules: can <if statement> work before Clock#Time ?

#2 Post by TD-er » 29 Nov 2020, 22:19

The wrapping if statement will not work.
When processing the rules, the parser tries to find an "on ... do" sentence and tries to match the event with the text on the 3 dots in my example sentence.

There is no condition check outside the on ... do ... endon scope.

JR01
Normal user
Posts: 260
Joined: 14 Feb 2016, 21:04
Location: South Africa

Re: Rules: can <if statement> work before Clock#Time ?

#3 Post by JR01 » 30 Nov 2020, 16:01

Thank you. Thought so.
-----------
IOTPLAY. Tinkerer, my projects are @ http://GitHub.com/IoTPlay, and blog https://iotplay.org. Using RPi, Node-Red, ESP8266 to prove Industry 4.0 concepts.

Post Reply

Who is online

Users browsing this forum: No registered users and 32 guests