Help with a very simple automatic light off piston


#1

1) Give a description of the problem
Not turning off if light was already turned on before 10pm. I know this is a real simple piston and I could do it with smartthings, but I am trying to learn webcore.

2) What is the expected behavior?
I want the light to turn off after 20 minutes between 1-pm and 5am

3) What is happening/not happening?
If the light is already turned on before 10pm and it is now 10pm or later it does not catch it and turn it off.

4) Post a Green Snapshot of the pistonimage


#2

Restrictions don’t subscribe so won’t trigger the piston.

Move the time restriction into the ‘IF’ and it will work as intended.

IF
time IS between x and y
AND
switch IS on
THEN
wait 20 minutes
turn off


#3

Perfect, that makes sense. Thanks.