Adding a timer to execute commands


#1

1) Give a description of the problem
How do I add a 20 minute timer before the lights go off? Also how would I figure out which way is best- motion is not active, motion changes to inactive, motion changes from… ?
Baby questions, but trying to learn!

2) What is the expected behavior?

3) What is happening/not happening?

**4) Post a Green Snapshot of the piston

5) Attach any logs (From ST IDE and by turning logging level to Full)
(PASTE YOUR LOGS HERE BETWEEN THE MARKS)

REMOVE BELOW AFTER READING


#2

Just put a Wait 20 minutes in front of the turn off.
Also I would suggest you put in a time between, say sunrise and sunset.


#3

@bobbles, thank you! Is this how you mean? So it’s better to say:
‘if there’s no motion, than wait 20 minutes and then turn off the lights’
rather than:
‘if there’s no motion for > 20 minutes, then…’
Is that correct?


#4

You can do it either way.
The piston looks good to me.
EDIT : The way you have it, it will only run between sunrise and sunset. Is this correct or do you want it to run 24/7. Or maybe sunset to sunrise.


#5

Thanks!
Yes, I just want it to run during daylight hours.