Page 1 of 1

[SOLVED]Only run if between 11pm and sunrise

PostPosted: Thu Dec 22, 2016 2:26 pm
by Juggler
I could be over thinking this, but just wondering how I would go about creating a condition that says "the following will only happen between the hours of 11pm and sunrise (next day)". Is it as simple as:

All of the following:
1. if current time is greater than 23:00
2. if dark

Re: Only run if between 11pm and sunrise

PostPosted: Thu Dec 22, 2016 2:57 pm
by Colorado4Wheeler
That works just fine like that. Sensible way to tackle the trigger in my opinion.

Re: Only run if between 11pm and sunrise

PostPosted: Mon Jan 02, 2017 2:14 pm
by Juggler
I've been testing this and it doesn't seem to work. For the test, I was attempting to run a schedule every 1h, but only between sunset (dark) and 11pm. To do this, I set the conditions to:

All of the following:
1. if dark
2. if current time is less than 23:00


However, the observed result was the schedule ran when it was dark and did not stop at 11pm. Is there a better way to do this? Should I be using scripting instead?

Re: Only run if between 11pm and sunrise

PostPosted: Mon Jan 02, 2017 3:11 pm
by autolog
As you pointed out in your first post, it is also dark in the morning before sunrise, so any time in the morning when it is dark will match "if current time is less than 23:00".

If you only want to have it only work in the evening, when it is dark and before 23:00, then you also need to add in say "if current time is greater than 14:00" (assuming that where you live it will still be light then and not dark). :)

Re: Only run if between 11pm and sunrise

PostPosted: Mon Jan 02, 2017 8:41 pm
by Juggler
That did the trick... thanks! I guess I was figuring the time was based on a 24h day, not a roll-over.