Hubitat Sunset Rules Trigger Times are wrong

My sunset rules seems to trigger at incorrect times. Note that I have setup these rules months ago and have been through several upgrades. Matter of fact, this is the first time i am logging into hubitat in 2 weeks because I noticed the sunset triggers were not working...

Hubitat Details:

Location Details:


Rule Settings:

Rule Next Trigger:

Note I live in Colorado, so MDT is the correct timezone, but next run time is scheduled for essentially midnight... I tried "updating" the rule, etc, but the nothing changes.

Not sure where to go from here, as the rule seems to be setup correct (worked flawlessly for months), but Hubitat seems to calculate the trigger time wrong.

I'll second this. I'm also in the mountain time zone, FWIW.

Is your location showing the right latitude and longitude?

1 Like

yes, literally zero changes to hubitat in 2+ months. verified all settings, rules, etc. i did not want to post my house's lat/long on the forum.

Bummer , that's all I got. Hopefully someone else can help.

If previous years of DST changes are any indication, it will all be good tomorrow. I think it is, in general, a calculation for the next trigger being done 'the day before' and thus it's off by an hour. The next day, it all corrects. At least that's been the pattern over the previous two events.

I think it maybe an artifact from daylight savings time. My lights came on at 7:40 , sunset was 7:09. I suspect it will work properly tomorrow.

Everything was an hour off from sunset today, I believe the action was set up yesterday for today. Will confirm tomorrow.

my next trigger says, 12:00am from the screenshot i posted.. how is that off by an hour?

Unless you wrote the app, it's hard to know what exactly everything there means. We have been told that "before sunrise" offsets in, at least, some stock apps are calculated at midnight of that (new) day, so this scheduled job is likely one where Mode Manager or RM will schedule something based on your negative offset. Positive offsets, we've been told, are calculated at the event (sunrise or sunset) time, as there is no reason to calculate it before, and events at that exact time should similarly fire at that time. There do seem to be some lingering, off-by-the-time-change issues in some cases, perhaps because the values calculated at midnight do not accurately reflect times after the 2-3 AM time change. In any case, I would not say this scheduled job means it thinks midnight is the time it will run your actual actions.

On the day that a before sunrise offset is first setup, the app has no choice but to wait until the next day to schedule the offset before sunrise. Every day at sunrise, the time for the following day's sunrise is sent in an event. So on every other day except for the day of scheduling, that event is used to calculate the time between sunrise one day, and x minutes before sunrise the next day.

My guess is that the sunrise time for today given by the system before the actual change happens (i.e., at midnight before the 2 AM change) is off, reflecting the before DST change time. I will look into changing this midnight scheduling on the first day to a 3 AM scheduling instead. This would be a problem where/when sunrise is before 3 AM, and someone is setting up a schedule with an offset before sunrise. Maybe there is some elegant solution to this, but I don' know what it is.

I might be missing something, but in the interest of being clear: my Mode Manager sunset-30 offset failed to run as expected (it was an hour late), and this wasn't a new setup but rather something I've had working for months prior. I suppose it's possible I accidentally hit "Done" when I was looking at it this morning to check my morning times (all OK but also all equal to or positive sunrise offsets), but that was something I specifically tried to avoid doing just to see how the rest would shake out.

In other words, it sounds like this might address only "first day" issues, but that doesn't appear to be my problem.

We had an open issue from before about the sunrise time and sunset time events that are sent out at sunrise and sunset for the next day being adjusted the day prior to the DST change. It is possible that issue is still open. That would explain what you've seen,

just to confirm, sunset worked as expected today, must have been related to DST :slight_smile: thanks all

1 Like

Same here, crisis averted. I was like a caveman barking at Alexa to turn on lights at sunset yesterday. Barbaric! :bone:

1 Like

Thank you. I just set this thing up and this was my first issue with the hub itself. I never bothered to check because it asks for a zip code on the same page. I pulled up my long/lat using Google Maps, and voila my sunrise/sunset times are now correct.

1 Like

Just as an FYI, this will work fine everywhere south of Duck Point, at the Northern end of Newfoundland Island. Their June 21 sunrise time is just before 5am. Sailed around there a lot, so I remember. But as with most "universal constants", there will be a need for a user-settable option to avoid making life difficult for the tiny number of people who live North of there.

We aren't doing it that way anymore.

My modes stopped switching according to programming a few days ago; a couple days after "falling back" to DST. I noticed in the Mode Manager Status page that Next Run Time values were all dated "203x-..." ("x", I think was "5").

Refer to my posting below to see how I may have fixed things: