This object is in archive! 

Schedule a device

Pål Andreassen shared this question 9 years ago
Need Answer

I want to turn on device on and off at specific times during the day. What is the "best" way of doing this?


This is my solution now:


when (scheduler, once every minute)

if (now between 0900 and 2300)

turn on

else

turn off


Is there a better way than using the once every minute scheduler? The good thing about this is that if there was an issue (offline etc) at 0900 it would still turn on as soon as the box was back online.

Replies (2)

photo
1

Have you got that working? I tried similar many times and a bit different ways, and it never worked. This "if (now) between (time) and (time)" never triggered "on" action.

photo
1

Yes, this works for me. Using it to control the lights on my aquarium. See attachment.

The "trigger" in the scheduler in the "when" statement that is set to run once every minute. So the rule is evaluated once every minute. Then the switch is set on or off depending on the time of day. So in effect it's turned on every minute betreen 09 and 23. But turning on something that is already on does nothing.

Leave a Comment
 
Attach a file