I've built my first rule with my new Hubitat Elevation and am having an issue. I want to turn on my front yard lights 30 minutes before sunset and turn them off 30 minutes after sunrise. They turn on successfully but don't turn off. Looking at the rule, it appears to evaluate as true even a few hours after sunrise. Thoughts on what's causing this issue and how to fix it?
I can't speak as to why your rule isn't evaluating correctly, but I'd like to offer a suggestion. Have you tried using the built-in Simple Lighting App? You can set lights to turn on at sunset w/ offset and off at sunrise. Much simpler.
Although I understand the Simple Lighting App is a simpler solution in this case, I need the Time of Day condition with sunrise/sunset to work in Rule Machine. This type of condition will be a core foundation to other rules I plan to build when I move devices from ST to Hubitat. Without it working in Hubitat I cannot migrate from ST.
Even though the sunrise and sunset times for my location looked correct per my previous screen shot, I manually clicked the Update button on the Locations page. I then rebuilt the rule using the same sunset/sunrise times with offsets. It now shows the condition with the correct status as false during the day. I'll see if it turns the light on and off correctly tonight/tomorrow morning. Not sure what caused this to occur, perhaps an undocumented feature?
Are you going to create a series of rules with different time periods? I ask as I use the Mode Manager to set modes (e.g. evening mode at sunset, day mode at sunrise, etc), and then I use the mode as a condition. This helps as I have several I do and don't want to fire when a particular mode is on.
I will likely use modes as I migrate more devices and build more rules for lighting, HVAC, etc. For now I wanted to do some basic testing of the platform with simple rules to see what is/isn't working. You'll see in my previous reply to @csteele that manually updating the location seems to have fixed the issue, even though the sunset/sunset times looked correct on the Locations page.
Just tuning in to this. I don't know why your original rule didn't work -- it should have. Ha! You found a fix for the unknown problem, that I have no clue about either. But, here's a thing you can always check if you encounter this sort of thing in the future:
Click the circled-i for the rule in question, and that will pull up the app details page. At the bottom of that page are the scheduled jobs for that rule. You should see the times you expect there. If you encounter again a situation where a rule like this doesn't work, grab a screenshot of the rule (just like above) and a screenshot of the scheduled jobs, and either post it here or PM me with it. We would very much like to get to the bottom of any issue like this.
I had a similar rule setup, and it was working, but recently it would not. I thought it was due to my other hub issue, but now that I've replaced that other hub, it still would not work. I ended up using restrictions instead and that does work
I think I'm running into a similar issue. I have a rule (actually a trigger - is that the problem?) that turns on a few lights prior to sunset, then turns a few more on after a delay. It didn't run last night, and when I looked at the info this morning per your suggestion, it indicated it was not scheduled to run.
After looking at things and saving, scheduled jobs looks like this:
There is one more fix for sunrise/sunset offsets that has not been released. This one has to do with an offset prior to sunset today. That is, when you set up a rule right now with an offset before sunset, it won't be scheduled for today. It will work tomorrow. That bug is fixed but not released. Perhaps that's the one that got you.
Perhaps. I'll let things go for a few days (without monkeying with that specific rule) and see what happens.
Right now, the "Next Run Time" entry for the Scheduled Jobs looks correct. (I'm still concerned about the Schedule: Once entry.) I have a feeling it will actually run this evening correctly, then not run tomorrow. I'll check the Scheduled Jobs in the morning to see if it ends up empty.
The way it works for an offset prior to sunset is always going to be Schedule Once. Because Sunset changes every day, so it can't put in a schedule that repeats. Every day just after midnight there is a hub event called SunsetTime. RM grabs that event and calculates when the before sunset event has to run and schedules it to run once.
You can look in Location Events to see the SunsetTime event from this morning, and see for yourself if the offset from that equals the Run Once time.
For an offset after sunset, it simply gets the Sunset event that the hub fires every day, then schedules to run that many minutes in the future.
Thank you for the explanation about the "Once" entry.
I checked for tonight's Sunset time, and did the math to ensure that Next Run Time indeed looks correct (Thu Jul 26 19:44:59 PDT 2018). Thus, I expect it run this evening. I'll let you know what that line looks like in the morning.