Help Sunrise issue (Looks like a BUG?) With screenshots attached

Since doing a restore, I am unable to get a sunrise event. I had a similar issue after doing an update earlier but fixed it by moving my location. This has not worked this time.

Symptoms:. Events driven by sunrise do not work. Any automation that relies on a restriction of sunset to sunrise will continue to fire after sunrise until I go into location and modes and update my location. The problem resurfaces the next morning however.

I created an easy test rule this morning. Sunrise +4 would NOT yield any pending jobs. Sunrise -4 yields a pending job of 12:00:10am tomorrow morning.

I'm at a loss at what to do. Screenshots are below.

UPDATE:. I tried dragging my location to San Francisco and saved it, hit done on the rule. The sunrise event was correct. Yea. I moved my location back to my home, saved it, updated the rule, back to a pending job of 12:00:10am. I tried locations in all US time zones including Alaska & Hawaii. The only locations that generate a correct time in the pending jobs is California/Pacific & Hawaii.
All others are generating a time of 12:00:10am for the sunrisr-4 event. There appears to be a bug of some kind.

Summary



Not sure if this helps or not... I believe Hubitat will not schedule a future Sunrise with offset event until midnight each day. That way it is sure to calculate the most accurate time for that particular day. Would that help to explain what you’re seeing?

@bravenel can probably explain much better than I did above. :wink:

2 Likes

What I have found is if I place the pin on the west coast, I'll get a CORRECT time in the pending job. Maybe because the sun hasn't risen yet on the west coast?

I've been fighting this for days. There are several other people too in a couple other threads. Every morning I wake up and the hub has no idea what time the sun rises. No sunrise events are being recorded. Maybe I'll leave the pin in California until sunrise and see if it generate an event in system events. I see sunset events in system events but not sunrise.

The 12:00:10 is being generated if the sun has risen in that Area. The west coast is now generating the midnight event now so that makes sense the job is being scheduled at midnight. The problem seems to be though that at midnight, my hub is NOT generating the sunrise event. Out of curiosity, I moved my hub to Hawaii and the sun will rise in a couple hours. I'll check and see if I get an entry in the system events.

1 Like

This is true only for the day the setting is first setup. After that, sunrise for the next day is sent at sunrise (sunset for next sent at sunset).

2 Likes

Bruce, do you have any idea why I'm not getting Sunrise events in system events? Or better yet, just how to fix it.

By moving my hub location to Hawaii, this morning before sunrise, my hub scheduled a job at sunrise-4, executed sunrise as indicated in system events, scheduled a second job for sunset+5 and a job for tomorrow morning at sunset -4.

The only thing different today than the last three mornings is that I moved my location before sunrise occurred. The last three days I've "updated" my location before midnight and generated the midnight job.

On my hub, anyway, it looks like something is not working correctly with the job that runs at midnight to "set things up". I'm going to try all of this again with my home location after midnight and see if I can replicate what just happened.

This only happens when you first create a rule with sunrise -x minutes. It sounds as though your location was not established properly before. All of these sunrise/sunset timings rely entirely on your location being set correctly for the astronomical clock to work properly.

I figured that and have updated my location everyday when sunrise didn't work. It's been 3 days. This started again after a restore. Prior to that it's been running fine for a week or so. I am guessing here but it looks like the "midnight setup job" isn't doing what it's supposed to. At least on my hub.

I had the issue a couple weeks ago and I think I fixed it by moving my location a few feet. I very well could have done this after midnight. I don't remember.

I know you get everyone claiming bugs with software but something is definitely up, at least on my hub.

Show the Scheduled Jobs section of the App Status page for the app that doesn't work right, as well as the main app setup page itself. Use screenshots.

I posted everything in the first post under summery at the bottom of the post. Didn't want to make everyone scroll through a bunch of screenshots

Being that I was able to get it working in "Hawaii" this morning I have no problem seeing if the issue had now resolved itself. I'll know at midnight tonight. :grin:

It wasn't just this rule though. It was every rule that had a restriction of sunset to sunrise. These rules continued to turn the lights on after sunrise until I would press update in location and modes. Then they would stop turning on the lights, until this happened again the next morning. These rules don't generate events, or I don't see them.

I hoping I'm describing this so it's understandable.

Right now it looks like that it scheduled correctly at midnight. I have a pending job sunset-4. Not sure what exactly seems to have fixed it this time over the last few days but I'll take it. The only thing I did differently is actually move time zones this time. I'm going to grab screenshots of everything just in case I again see incorrect behavior in the morning.

Thanks for taking a look, Bruce. At the very least, I learned how the hub schedules jobs and that's good info to know.

@bravenel

Good morning Bruce.. Sunrise is still broken for me. I noticed something that you might be able to shed some light on. I took this screenshot at 11:25pm yesterday and it shows the midnight job to run on 5/12 @ 12:00 midnight, all good.

Here is the screenshot I took after midnight. I didn't catch this last night but I see it this morning. The sunrise job has been scheduled for 5/11, yesterday. It will never run.

Here is a screenshot of my hub time and it looks correct.

What do you need from me to resolve this? I think I can fix it by moving my location around between midnight and sunrise and bypass the "midnight job" as I was able to generate the sunrise event yesterday when I did this by "moving the hub to Hawaii" but don't want to do that tonight (tomorrow morning) if you want to try and track down why this is happening. I have all the screenshots from before and after the "midnight job" run if you want them.

EDIT: All the rules that use sunset to sunrise restriction are not currently honoring the restriction, as has been the case each morning. Rather than hit "update" in location and mode to fix this for the day I'm leaving it until I hear from you.

Let me know what you would like me to do. Thanks

Please show one of these rules, the main setup page of it.

. I just grabbed this moments ago.

There aren't any "restrictions" in that rule. Have you turned on Action logging, to see what is actually happening?

"Restrictions" don't exist in Rule Machine (they used to). They do exist in Simple Automation Rules.

Ok. Not a restriction as in SA. It's a condition. The sunset to sunrise condition is evaluating as True (unless I'm reading it wrong) and the current time is almost 11am. Well past sunrise.

I have not turned on logging for this rule as I am certain it's related to the fact I'm not getting a sunrise event.

If there is a different kind of log your looking for you will have to tell me exactly what it is. I'm not completely familiar with everything in HE yet.

OK, I see that now. I don't know what is going on with this rule.

Please recreate this rule from scratch, and see what it shows for the truth of that condition.

I can do that but why is the midnight job creating a sunrise event for the previous day? I am not getting a sunrise event in my system events. If I go and press update in location and modes sunset to sunrise will evaluate as false.