I have a new simple automation set up that turns on some living room lights when either me or my wife come home. I have it set to only run when it's dark outside (1 hour before sunset to 1 hour after sunrise). However I just got home in the middle of the day and saw that the rule had triggered and turned my lights on.
Am I misunderstanding how the time restriction works or do I maybe have it backwards?
This works for me. Check your hub time and timezone on the Settings / Location page. Do the sunrise and sunset times look correct?
That's this area of the interface, right?
If so, everything looks correct.
Yes. So try something else. Remove the Restriction completely and see if it works.
The automation itself works just fine. I came home around noon today and saw that these lights had been turned on, which isn't what I'm expecting due to the restriction I put in place.
I don't know what to tell you. I just created a SAR rule with the same restriction and it works as expected.
Try a different time period for the restriction, or create a simple test rule you can bang away at. Any other automations turning on those lights?
Need to try to isolate what isn't working with some specificity.
I just modified the rule to only run between a specific time (instead of sunset to sunrise). I did 7 pm to 5 am.
I tested the rule by just using the
Departed buttons in the Pixel 5 device page.
This works. The lights did not turn on because it's 1 PM.
I tested setting the between two times back to between sunset and sunrise and toggled departed and arrived on the Pixel 5 device page and it turned the light on even though it's not dark outside.
So I think the rule isn't picking up the sunset/sunrise times correctly. This may be related to the question I had yesterday. Is there anywhere else in Hubitat that I configure for it to correctly set sunset/sunrise times?
Try setting your zip code again on the Location page and hit Update. It seems your times are not correct. Also, look at the System Events log, and see if sunrise is there from this morning.
I tested changing my zip code to Manhattan, but the sunset/sunrise times didn't change. It wasn't until I dragged the hub on the map to NYC, which updated the lat/long coords, that the times changed. I've now changed it back to my home address and zip code and testing the automation with the same steps as above seems to work correctly now!
Oddly enough looking at the System Events log, the sunset/sunrise times were being triggered correctly. I can confirm this because I know the hub was transitioning between Day and Evening modes, because I set those to correlate with sunrise and sunset respectively.
But it seems like the simple rule automation engine is also now getting the sunrise/sunset times correctly after resetting my location...so hooray!
Yeah, something was messed up there. Glad you got it fixed.