Missing something obvious with sunset?

Just moved over from Wink and while connecting to all my devices was flawless I am having some difficulties replicating a few of Winks 'robots'.

My use case is pretty simple, 1. Turn on 3 lamps to 30% at 10min before sunset and 2. Turn all lights off at 10:15.

I am using Simple Automation Rules for these two tasks. The first app for turning lights on is the one I am having issues though I may have found a bug with the second one I'll outline at the end.

Reading a few other posts about sunset it seems like events that take place before sunset actually get scheduled by the previous night's sunset broadcast. This is backed up what I saw earlier this week in that I created the App at 9pm Sunday (after sunset), the app failed to work Monday but scheduled a job for Tuesday's sunset and executed successfully. It however failed to run Wednesday night and is now sitting at no scheduled jobs outside of a blank "doAction" with status PENDING and Schedule Once. So what am I missing to make this run every night of the week?

Things I've check:
Location (Set to CDT and Coords set to center of my city)
Times (Sunrise/Sunset times are as expected)
Test App after sunset (I know this is slightly different logic but I wanted to verify the Sunset event was triggering)

Now for the potential bug with lights off at certain time. When I initially set the Hubitat up I missed that it had my timezone as Eastern while I am in Central, no problem, easy fix. I had however created the "Off at 10:15pm" while the settings had me on ET. After switching the timezone in settings the App was still executing at 9:15pm even though the Scheduled Jobs section listed next runtime as 10:15pm CDT with a cron of 0 15 22 * * ?.

Have you tried going into the app since making your time zone changes and just clicking "Done"? For many apps, this (basically the equivalent of a "Save" button and generally different from just closing the app page) causes them to re-evaluate what they want scheduled for when. It sounds like you've done any reasonable troubleshooting I can think of.

I have, it schedules a beforeSunsetHandler for midnight but that doesn't seem to schedule anything. I thought it would ping the sunsetTime and schedule sometime but that doesn't seem to be working.

Info I forgot to include
Platform Version: 2.2.0.128
Hardware Version: Rev C-5

Try this. Your problem sounds similar.

Fantastic, I moved my location and saved, went to the app and clicked "Done" and the Next Run Time is now scheduled for sunset-10 tonight.

I'll check again tomorrow to make sure it schedules an entry for Friday's sunset but this looks to have worked!

1 Like

Thanks for posting back. You have to reset sunrise by doing the location thing between midnight and sunrise. It looks like it's the same for sunset. You have to move your location between midnight and Sunset.

Tomorrow's job should be scheduled at sunset tonight.

Are you in the U.S.? Is the correct time zone US/Central?

Timezone is correct at US/Central (Chicago). Reading through the thread by @oldcomputerwiz the issue is with the sunset/sunrise handlers getting into a weird state.

Waiting until tonight to verify tomorrow's sunset is scheduled but this thread is most likely solved and his post will be marked as the solution once I have confirmation.

I had made changes to my location too. Not the wrong timezone but I did look at all the Eastern Time zones and probably selected a couple until I settled on one. This was after I had set my hub up a few weeks earlier. It appears to me that under certain conditions, there may be a bug if you change your timezone/location after you have things initially set up. Then again, I didn't create the hub so I'm only guessing from my observations over the last few days.

Everything got configured correctly for tomorrow after tonight's sunset so it looks like I'm up and running. Thanks again for the help, hopefully they are able to fix this bug

2 Likes

You're welcome. Glad to help.

Welp the issue is back... So it looks like I made it 2 nights, one from the initial schedule and then one automatically scheduled time. Nothing came on tonight (Saturday) and checking the app has nothing scheduled for tomorrow, not even the sunsetHandler.

This is honestly making me start to regret my Hubitat decision. I know it can do crazy setups and tasks but this should honestly be a really simple thing.

All I can suggest at this point is to email support. Mine has been working flawlessly since I did the move location thing. You have to have something else going on that is messing things up.

Wish I could offer more help.