Simple Lighting Sunset/Sunrise

I have a simple routine that turns porch lights on at sunset and off at sunrise (-30). It worked as expected for the past month. Now the past 3 days, the lights turn on at sunset, but not off at sunrise (-30). When this has happened before it was due to power outages and the wrong time in my HE (a different post for a different day). But this morning I can confirm the time is correct and for the 3rd day in a row I'm manually shutting the outdoor lights off.

When I navigate to "logs", "show past logs", only the Turn On at Sunset rule appears on top of the page along with other devices and rules. The Turn Off rule is not there (because it didn't run?).

How to troubleshoot and understand what is going on?
Thanks!

A quick way to check the schedules..
Open the app and click the 'cog' in the top right-hand corner.
When the new page loads, scroll to the bottom and look at the scheduled jobs..
Check to confirm that sunrise is tomorrows date?
I suspect that it is using today's sunrise

Andy

1 Like

I think so. Next Run Time, right now says: 2020-05-05 5:18:00 AM EDT, PENDING

Anyone know what causes this and how to fix it? This automation was working fine up until a few days ago and a power outage/reboot is probably when it started happening.

Just a guess: if your database was corrupted, as a sudden power loss (unexpected shutdown/restart) might cause, then it will restore the last known good copy on reboot. This could have been a copy that contained your "old" scheduled job, say, the previous morning's sunrise-30 time that you would have had scheduled back then, now at a time that will never run (because that date/time will never happen again). Going into the app and clicking "Done" will cause Simple Lighting/Simple Automation Rules (and most apps) to re-evaluate your settings and adjust schedules as appropriate, so that is a fix you can use on a one-by-one basis.

Preventing this in general might be best done with a UPS on the hub so power outages don't affect it or any scheduled jobs, though if you don't want to do that or don't have enough rules/apps that you care about, just checking things like this afterwards (or just going in and clicking "Done") isn't a bad idea, though it's also something I remember staff saying once that they didn't want people thinking they had to do on this platform--and you normally don't. Keeping a local database backup also isn't a bad idea, though it won't address with this particular issue; it's just something I think is important enough to mention since it's vaguely related. :slight_smile:

I've encountered the same issue this weekend and have been chasing it. I'm on a UPS so power outage isn't the cause for me. I noticed the time was incorrect on Saturday sometime after the installing the most recent update or moving my location by 100 feet. Both were done around the same time. These are the only 2 system events I can see that I've done that might effect sunrise/sunset. I tried updating my time from my browser and it fixed the time but no sunrise/sunset events appeared in the system event logs.

I moved my location a few feet yesterday and I had a sunset event last night and sunrise event this morning, but my sunrise-180 did not fire this morning. I manually turned the lights on and the sunrise+15 did turn them off. I'm thinking the turn on event was scheduled (or wasn't scheduled) before I moved my location.

I will look at pending jobs when I get back to the house.

Glad to see it's not only me that this happened to.

I checked my pending jobs and I have one scheduled for this evening and one for tomorrow morning so it looks like my issue is fixed. I had a previous job on 5/1 and nothing for 5/2 & 5/3 (the days sunrise/sunset didn't show up in system events). I sure would like to know what caused the issue to start with though.

I'm seeing this as well on a few things and believe it's related to recent updates.

Same here - systems on UPS so no power interruptions seen here for quite some time.

I just checked one simple lighting rule and there are no scheduled jobs at all.

I changed it to use motion, then changed it back to sunset on, off at sunrise and still no scheduled jobs showing in the app.

Now it appears the motion sensors I used to temporarily change the app trigger method are stuck in the app.

SMH.

last time it worked was before I updated to 2.2.0.126

@bobbyD

Mine is working now. Are you seeing sunset/sunrise entries in system events? That was my first clue as to why mine wasn't working. FWIW, I don't see pending events for jobs that will occur exactly at sunrise or sunset. Pending jobs would only occur if there was an offset on the sunrise/sunset event or a specific time like 5am.

If you aren't seeing sunrise/sunset entries in system events, try moving your location a few feet. I believe that's what fixed mine. I've only been in this platform for a month (ST refugee) so there may be something else going on.

I also noticed that when I wasn't getting sunrise/sunset events, my hub didn't backup at night either. See the screenshot and notice no backup for 5/3 and the version numbers are out of order. Do you see something similar?

Tonight it fired. I'll see if it's off in the morning. Just. weird.

Maybe HE's API is wonkey? This seems to happen to a lot of users at random times, but my perception is it's more often following updates.

No sunset or sunrise events between my update 5-2 and today.

What did you do to get the sunset/sunrise back? Curious for future reference.

I am a bit OCD or whatever, but when I need an update, I backup first, do the update, then reboot.

I don't think it is the official way, but rebooting after an update seems to clean up some stuff somehow.

Rebooting is worth a shot. I see nothing OCD about that. I am trying to "add some tricks" to my binder so when this happens again, and I'm sure it will, I know how to easily fix it next time.

I reboot before an update as well...

Backups on both sides of any update and saved locally.

Been in IT long enough to know better.

2 Likes

I don't think anything I did specifically brought it back.

I made a few changes to the app - set it up to use motion, then back to sunset and auto off.

Sunset API fired but I still don't see any scheduled jobs. Now that I look, there are no scheduled jobs in my other sunset apps. There are event subscriptions in them all. The apps with specific times scheduled have scheduled jobs (looks like a CRON entry)

For my jobs that will fire at sunset and sunrise, I have no jobs scheduled but they are firing. I've had them working for a couple of days.

IF I use an offset with the sunset or sunrise then I will see a pending job. like you, I also see specific times being scheduled. I really have no idea how the hub is scheduling it's jobs at this point.

OK, so it's still not working.

I'm seeing a sunset event but no sunrise.

Even on the sunset, one of my lights that I know I manually turned off earlier did not fire. I think the others never shut off. Now just today only, my kitchen under cabinet lights didn't turn on either.