Sunrise Trigger not working

I have two similar rules - one that triggers at sunrise and one that triggers minutes before sunset. The sunset rule works every time. The sunrise rule never works. If I substitute 7:00 am for the trigger instead of sunrise, it works every time.

I have read about all other related issues, but none of those solutions work. Please recommend how I should proceed with debugging this problem.


The first thing to do is look in 'System events -> Location Events'.
Do you see sunrise triggering in there at the correct time.


turn on debugging and logging for the devices in question to see if there are any errors? After you check location events.

1 Like

Yes, sunrise event is there. I will turn on logging and report back tomorrow.

My only trigger is a simple sunrise. When I change sunrise to any specific time, the rule runs perfectly.

Location events show correct sunrise time at 6:57.

Log shows no trigger event at 6:57.

Event subscriptions show no sunrise subscription:

Any thoughts on what I should look for next?

You could try to add a minute offset to sunrise trigger and see if it adds that to Scheduled Jobs on the rule status page. Not sure when sunrise/sunset related jobs get scheduled, might not be until after midnight. I'd add it and if not there check again in the morning for it. Might help with the sunset Event Subscription. If that doesn't show up then I'd rewrite the rule after I verify a simple sunrise rule (like one line to log the sunrise time) works.

I had previously added 30 minutes to sunrise and the trigger didn’t work. I took your advice and added 1 minute. It showed up as a scheduled event well before midnight, so I was hopeful. This morning, it triggered on time, so success once in a row!

Even though it appears to be fixed, the larger question is how to elevate the problem with the sunrise event to someone who can look into it and get it fixed?

I’m more than willing to be a test case for a fix...

How complicated is your rule? If it's not too complicated then I would recreate it from scratch and see if you get the same issue. If it's complicated then I would make a very simple rule that uses sunrise for a trigger and see if you get the same issue. If you get the same issue then I would tag Bruce to get his attention.

If you don't see the issue again I would chalk it up to something getting messed up in the rule. I've seen some weird behavior that a rule rewrite has resolved. In fact, if I have been doing a lot of work on a rule I'll usually rewrite it completely when I'm happy with it so I have a clean copy running.

The rule is pretty labor intensive to recreate. The time between edit steps increases to over 5 seconds per step as I get about halfway into building the rule. I will try your suggestion of creating a simple rule that triggers at sunrise and let you know.

I did a simple sunrise rule as you suggested. The sunrise event doesn’t get scheduled and the trigger doesn’t fire. My complex rule with sunrise + 1 minute works fine. This is likely a bug that needs to be addressed. Can anyone help?

Sunrise (and sunset) won't be listed under Scheduled Jobs, only when you add an offset will the time be listed there. Sunrise will be handled by the sunrisesetHandler in Event Subscriptions. I made my own simple rule and it appears to be setup to run at sunrise. I'll let you know tomorrow if it's successful.

One other thing you could try is to reboot the hub and see if that helps.

I rebooted. No sunrise event subscription ever shows up unless I add a minute to the trigger in my simple rule.

As @pseudonym has said above.

Sunrise (and sunset) won't be listed under Scheduled Jobs,

Offsets to these events will.

My simple rule ran this morning at sunrise. Obviously something is going on but I suspect it isn't a bug. Sorry I couldn't be more helpful.

@Donald I think I found the issue. It looks like you have sunrise with an offset of 0. When I made my offset 0 I noticed I didn't have an Event Subscription to sunrisesetHandler and the rule didn't run this morning. Edit your trigger and leave the offset blank. You should now see the correct Event Subscription and your rule should run.

Yup - that fixed it! This is a bug that has been affecting others and should be fixed. Is there a mechanism in this community for identifying bugs in the system?

Tag Bruce (bravenel) and let him know you found a bug. He'll probably ask to see your rule and app status page. I'd show him the Settings and Event Subscriptions.

I’m new to this forum, so don’t know how to tag someone. Can you explain? Thanks.

For you it would be: -
@ first and then it starts to autofill.
Type @do then select who you want to tag.

1 Like