Use offset with "Wait until"


#1

1) Give a description of the problem
I have a piston that fires any time until sunrise with offset of +15 minutes. I need the next step of the piston to wait until sunrise + 20 minutes, and run the next step.

2) What is the expected behaviour?
Second step should run 20 minutes after sunrise.

3) What is happening/not happening?
Can’t figure out how to use an offset with “Wait until”. I tried using an “Expression” instead of “Preset” and used “addMinutes($sunrise, 25)”, but that stopped the entire piston from firing for some reason.

**4) Post a Green Snapshot of the piston![image|45x37]


#2

If the action at (sunrise + 20 min) is self contained, you can add a new block to the very bottom. IE:

Every day at sunrise + 20 min
    do cool stuff
END EVERY

This option is found by clicking on the very last “add a new statement”, and then “add a timer”.

pic

Note: This block should be entirely outside of all the other code


#3

Thanks! I’ll keep that as a last resort option. I would prefer to have the second part execute as part of the whole piston on the off-chance that I manually turn on a light and wouldn’t want it to go off unexpectedly.


#4

In that case, I would combine your current piston with that logic. Something like:

IF Sensor's motion changes to active
Then
   IF Time is between W & X  (current times, careful with the overlap)
      and
      $day is different than {last_warned}
   Then
      Do current stuff
   END IF
   IF Time is between Y & Z  (second times)
      and
      $day is different than {last_off}
   Then
      Do new code goes here
   END IF
END IF

Note the single trigger is at the very top… not indented, like all of the conditions.
(I also created a second variable, to track that alert)