[SOLVED]Only run if between 11pm and sunrise

Posted on
Thu Dec 22, 2016 2:26 pm
Juggler offline
Posts: 95
Joined: Dec 17, 2014

[SOLVED]Only run if between 11pm and sunrise

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

Posted on
Thu Dec 22, 2016 2:57 pm
Colorado4Wheeler offline
User avatar
Posts: 2794
Joined: Jul 20, 2009
Location: Colorado

Re: Only run if between 11pm and sunrise

That works just fine like that. Sensible way to tackle the trigger in my opinion.

My Modest Contributions to Indigo:

HomeKit Bridge | Device Extensions | Security Manager | LCD Creator | Room-O-Matic | Smart Dimmer | Scene Toggle | Powermiser | Homebridge Buddy

Check Them Out Here

Posted on
Mon Jan 02, 2017 2:14 pm
Juggler offline
Posts: 95
Joined: Dec 17, 2014

Re: Only run if between 11pm and sunrise

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?

Posted on
Mon Jan 02, 2017 3:11 pm
autolog offline
Posts: 3988
Joined: Sep 10, 2013
Location: West Sussex, UK [GMT aka UTC]

Re: Only run if between 11pm and sunrise

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). :)

Posted on
Mon Jan 02, 2017 8:41 pm
Juggler offline
Posts: 95
Joined: Dec 17, 2014

Re: Only run if between 11pm and sunrise

That did the trick... thanks! I guess I was figuring the time was based on a 24h day, not a roll-over.

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 2 guests