Sunrise & Sunset Times Not Updating

I use sunrise and sunset times for quite a few automations and have had issues with correctness since I started using Hubitat. I primarily use Webcore, however the issues extend beyond this and cause automations not to trigger properly.

The issue manifests itself as sunset/sunrise not updating and therefore reflecting sunrise/sunset as being the prior day. I setup an automation that checks sunset/sunrise times are in the future that runs each night and reboots the hub to correct it.

My suspicion is that the scheduled job that is supposed to update timing isn't executing properly but I don't see any logs that would give me more details. I was wondering if anyone else has had an issue with this and if there are any known issues?

Logs from my rebooter:


4/10/2022, 3:15:00 AM +56ms
+273ms â•‘Rebooting hub. Sunrise Sat, Apr 9 2022 @ 6:25:00 AM EDT and sunset Sat, Apr 9 2022 @ 7:27:00 PM EDT times are incorrect
4/9/2022, 3:15:00 AM +55ms
+340ms â•‘Rebooting hub. Sunrise Fri, Apr 8 2022 @ 6:27:00 AM EDT and sunset Fri, Apr 8 2022 @ 7:26:00 PM EDT times are incorrect
4/8/2022, 3:15:00 AM +52ms
+319ms â•‘Rebooting hub. Sunrise Thu, Apr 7 2022 @ 6:28:00 AM EDT and sunset Thu, Apr 7 2022 @ 7:25:00 PM EDT times are incorrect
4/7/2022, 3:15:00 AM +58ms
+165ms â•‘Thu, Apr 7 2022 @ 3:15:00 AM EDT, sunset Thu, Apr 7 2022 @ 7:25:00 PM EDT, sunrise Thu, Apr 7 2022 @ 6:28:00 AM EDT
4/6/2022, 3:15:00 AM +51ms
+406ms â•‘Rebooting hub. Sunrise Tue, Apr 5 2022 @ 6:31:00 AM EDT and sunset Tue, Apr 5 2022 @ 7:23:00 PM EDT times are incorrect
4/5/2022, 3:15:00 AM +53ms
+274ms â•‘Tue, Apr 5 2022 @ 3:15:00 AM EDT, sunset Tue, Apr 5 2022 @ 7:23:00 PM EDT, sunrise Tue, Apr 5 2022 @ 6:31:00 AM EDT
4/4/2022, 3:15:00 AM +51ms
+275ms â•‘Mon, Apr 4 2022 @ 3:15:00 AM EDT, sunset Mon, Apr 4 2022 @ 7:22:00 PM EDT, sunrise Mon, Apr 4 2022 @ 6:33:00 AM EDT
4/3/2022, 3:15:00 AM +59ms
+261ms â•‘Sun, Apr 3 2022 @ 3:15:00 AM EDT, sunset Sun, Apr 3 2022 @ 7:21:00 PM EDT, sunrise Sun, Apr 3 2022 @ 6:35:00 AM EDT
4/2/2022, 3:15:00 AM +52ms
+230ms â•‘Sat, Apr 2 2022 @ 3:15:00 AM EDT, sunset Sat, Apr 2 2022 @ 7:20:00 PM EDT, sunrise Sat, Apr 2 2022 @ 6:36:00 AM EDT
4/1/2022, 3:15:00 AM +59ms
+234ms â•‘Fri, Apr 1 2022 @ 3:15:00 AM EDT, sunset Fri, Apr 1 2022 @ 7:19:00 PM EDT, sunrise Fri, Apr 1 2022 @ 6:38:00 AM EDT
3/31/2022, 3:15:00 AM +57ms
+339ms â•‘Thu, Mar 31 2022 @ 3:15:00 AM EDT, sunset Thu, Mar 31 2022 @ 7:18:00 PM EDT, sunrise Thu, Mar 31 2022 @ 6:40:00 AM EDT
3/30/2022, 3:15:00 AM +55ms
+243ms â•‘Wed, Mar 30 2022 @ 3:15:00 AM EDT, sunset Wed, Mar 30 2022 @ 7:17:00 PM EDT, sunrise Wed, Mar 30 2022 @ 6:41:00 AM EDT
3/29/2022, 3:15:00 AM +62ms
+314ms â•‘Tue, Mar 29 2022 @ 3:15:00 AM EDT, sunset Tue, Mar 29 2022 @ 7:16:00 PM EDT, sunrise Tue, Mar 29 2022 @ 6:43:00 AM EDT
3/28/2022, 3:15:00 AM +54ms
+228ms â•‘Mon, Mar 28 2022 @ 3:15:00 AM EDT, sunset Mon, Mar 28 2022 @ 7:15:00 PM EDT, sunrise Mon, Mar 28 2022 @ 6:45:00 AM EDT
3/27/2022, 3:15:00 AM +61ms
+331ms â•‘Sun, Mar 27 2022 @ 3:15:00 AM EDT, sunset Sun, Mar 27 2022 @ 7:14:00 PM EDT, sunrise Sun, Mar 27 2022 @ 6:46:00 AM EDT
3/26/2022, 3:15:00 AM +52ms
+321ms â•‘Sat, Mar 26 2022 @ 3:15:00 AM EDT, sunset Sat, Mar 26 2022 @ 7:13:00 PM EDT, sunrise Sat, Mar 26 2022 @ 6:48:00 AM EDT
3/25/2022, 3:15:00 AM +58ms
+263ms â•‘Fri, Mar 25 2022 @ 3:15:00 AM EDT, sunset Fri, Mar 25 2022 @ 7:11:00 PM EDT, sunrise Fri, Mar 25 2022 @ 6:50:00 AM EDT
3/24/2022, 3:15:00 AM +52ms
+304ms â•‘Rebooting hub. Sunrise Wed, Mar 23 2022 @ 6:53:00 AM EDT and sunset Wed, Mar 23 2022 @ 7:09:00 PM EDT times are incorrect
3/23/2022, 3:15:00 AM +53ms
+324ms â•‘Rebooting hub. Sunrise Tue, Mar 22 2022 @ 6:55:00 AM EDT and sunset Tue, Mar 22 2022 @ 7:08:00 PM EDT times are incorrect
3/22/2022, 3:15:00 AM +59ms
+279ms â•‘Tue, Mar 22 2022 @ 3:15:00 AM EDT, sunset Tue, Mar 22 2022 @ 7:08:00 PM EDT, sunrise Tue, Mar 22 2022 @ 6:55:00 AM EDT
3/21/2022, 3:15:00 AM +99ms
+218ms â•‘Mon, Mar 21 2022 @ 3:15:00 AM EDT, sunset Mon, Mar 21 2022 @ 7:07:00 PM EDT, sunrise Mon, Mar 21 2022 @ 6:56:00 AM EDT
3/20/2022, 3:15:00 AM +55ms
+296ms â•‘Sun, Mar 20 2022 @ 3:15:00 AM EDT, sunset Sun, Mar 20 2022 @ 7:06:00 PM EDT, sunrise Sun, Mar 20 2022 @ 6:58:00 AM EDT
3/19/2022, 3:15:00 AM +52ms
+292ms â•‘Rebooting hub. Sunrise Fri, Mar 18 2022 @ 7:01:00 AM EDT and sunset Fri, Mar 18 2022 @ 7:04:00 PM EDT times are incorrect
3/18/2022, 3:15:00 AM +58ms
+277ms â•‘Fri, Mar 18 2022 @ 3:15:00 AM EDT, sunset Fri, Mar 18 2022 @ 7:04:00 PM EDT, sunrise Fri, Mar 18 2022 @ 7:01:00 AM EDT
3/17/2022, 3:15:00 AM +65ms
+240ms â•‘Thu, Mar 17 2022 @ 3:15:00 AM EDT, sunset Thu, Mar 17 2022 @ 7:03:00 PM EDT, sunrise Thu, Mar 17 2022 @ 7:03:00 AM EDT

Double-check the hub location hasn't changed for some reason, confirming it is still operating in the correct time zone.

You may also want to mention for support (and others) what platform version you are running and when you updated over the last short while, just in case that has any bearing.

I suspect that syncing of time is not an issue, but does the hub have access to the Internet?

Location is correct and hasn't changed. The times are correct, just don't update at midnight as they should so reflect the prior days' time.

Currently 2.3.1.137 and have taken each of the recent updates within a day of them being released. That said, this issue has happened on and off for at least the last year when I was running ~2.2.6.

The hub does have access to the internet. I have it send me a notification before the reboot triggers.

Have you come in or out of daylight savings recently?

You have $sunrise and $nextSunsrise, $sunset and $nextSunset, etc.

Could the $next…. be the one you’re looking for?

The timing and structure of the logs appears to be consistent, just not the content, that seems to have changed

That's weird. Can you PM me your hub's id, and I'll take a look at the engineering logs on the hub?

1 Like

PM'd, thanks.

We did have DST about a month ago, but I don't think that's related since it happened before and after this.

My understanding is that the various sunset and sunrise variables should update at midnight with a system job (that I don't see in the scheduled jobs list), so $sunset and $sunrise should always reflect the current calendar day's times (e.g. the values at 11:59PM will be different than at 12:01AM a few minutes later). In my use cases, I'm not looking to use $nextsunrise, etc., since I'm looking for the current days' values (note these don't update at midnight reliably either).

Following -
I noticed the exterior lights NOT turning off at sunrise. When checking my logs, everything looks normal. As there was a recent upgrade, I did check and confirm my location and time zones did not change. So far, that is all I have done. Not enough time really investigate it.

If you check in Logs > Locations events tab you would be able to see where it is updating the values. For me it looks like immediately after the sunrise or sunset event it then updates that value to be the next one so it is always ready to go.

@jake9

There is another way to check if the Hubitat has the right sunset/sunrise times "built in". This is a new feature, so you have to have updated to the latest.
You can make a new RM rule, with a trigger being "certain time". Use sunrise/sunset (your choice), and click on the button "use date". Put in a date in the future (when you know the proper sunsrise/sunset).
If the rule has been marked as showing current values, you will see what Hubitat has calculated for that date for sunrise/sunset.
This enables you to see (for any date in the future), the Hubitat sunrise/sunset.
P.S. I have used this type of rule, and all the sunset times that I have checked (via Google) have been correct.

1 Like

Thanks - I disabled my reboot script so I can do some investigation when it happens (last night was fine). The engineering logs apparently show the midnight triggers and then schedules jobs at sunrise and sunset. I'm not fully clear the exact times the values are updated, but from what I can tell, it happens during the midnight job.

Rule Machine and Hub Details only show the time (doesn't include the date), so have to infer. I was digging into the webcore code and since it effectively caches the output of app.getSunriseAndSunset() that might be an issue. I added some logging so I can verify and will also do a groovy app to dump the structure.

Yes, the approach that I suggested previously shows the sunrise/sunset time for the date that is specified. That date that is specified can be ANY date.

I would like to add that since the latest update, my rules based on Sunrise+XX minutes are not running. I don't know why. Anyone else?

Just as another data point, I have a rule (current RM version) that opens blinds in the AM, closes them in the PM, based on sunrise/sunset, and it's been running fine on .138.

image

Of note, my rule is older, written with RM 4.0. Here's the rule that hasn't fired in days.

And, yes I know that now the weather is partly cloudy. But earlier it was Clear and didn't get triggered.

1 Like

My mode manager that was setting the mode to dawn at sunrise -30 also stopped working.

@bobbyD Thought you'd want to know about these reports.
Thanks,
Jay W

I am watching. I am not seeing any issues in my environments with sunrise/sunset, and my Mode Manager as well as Rule Machine rules are working as expected. So, unfortunately, we will need your help to narrow down where these problems originate. Posting app settings, Logs (past Logs), location settings, etc would help us isolate the problem.