Sunrise - Sunset Rule

Greetings,
I have a rule for the light that is on my flag, the run says turn on at sunset and turn off at sunrise. Problem is its turning off at 1AM

Here is the rule:

and here is the event log showing it turn off at 1 AM (It turn on at the right time but the other activity I am not sure why that happened)

Any suggestions/ideas?

Can you remove it from the Amazon Echo Skill?

Yes - Done - I also removed it from my driveway lights which appear to be having the same issue..

If it fixes the problem, then you need to turn off Alexa hunches.

1 Like

@aaiyar You recommended that previous and I turned off the Alexa Hunches several weeks ago..

1 Like

Dang Alexa!!

1 Like

I think one way to separate out if the rule is working correctly or not - have one rule to turn on the lights and a completely separate rule to turn off the light.

Otherwise it appears that the original rule is triggered and sits there (wait for event) until sunrise, but what happens if the hub is rebooted in that time period? Or something else impacts the rule running?

1 Like

A hub reboot would not affect this. A "wait" for a certain time in a rule creates a scheduled job. Scheduled jobs are not affected by reboots, unless the hub happens to be shut down or rebooting at that exact moment, in which case the scheduled job will be missed.

My guess: some other app/rule is turning this switch off.

As for what...

Unfortunately, this won't be of much help, because it just shows you what happened with the device but not what app did it. If you suspect it was this rule, enable Trigger, Action, and Event logging for this rule (Action logging is really the most important, but it all could help), then check "Logs" (likely Past Logs, and possibly filtered to just this rule) to see if it's really the thing doing it. My suspicion is not. The ideas above are good, and keep in mind that with the switch exposed to all of those apps, it could be anything (Alexa, someone manually flipping the switch on Dshboard, etc.)--including an app on another hub since it looks like you're using Hub Mesh.

2 Likes

Okay - I have enabled the suggestion log options. Also I believe I misinterpreted Hub Mesh so I have turn it off. I thought it extended the mesh network - dumb..
I have removed the light from the Alexa Skill.

This is a lot more involved than my old home control software.

Thank you @bertabcd1234 - I'll let you know what happens in the morning. I suspect this is going to help me troubleshoot 2 other rules that are not working as I had intended them too but one thing at a time..

1 Like

So the rule ran yesterday and appeared to run as expected. However, I have no idea where to find the additional trigger, action and event logging details.

The log I found looks the same as yesterdays.

Also I have another rule that is not working as expected, should I start a new thread for that?

1 Like

Logs.

Was this after you removed the device (light?) from Alexa? If that's the case, then you know it was being triggered incorrectly by Alexa .....

Yes - It was - I still do not understand how Alexa is doing anything on my behalf. I turned off hunches weeks ago. Ticks me off because this never happened with my old solution.

Do you know if Google Home does the same thing? If not, maybe I need to think about switching..

Okay well I think I found them but there is not much more info there - I was hoping to see what triggered events but I am not seeing that..

EIther not completely, or you have Alexa routines that were controlling those devices. FWIW, this has nothing to do with the "hub" connected to Alexa.

Also, I don't use any of my Hubitat devices in Alexa routines, and I have hunches turned off, and I haven't experienced this ever.

I think so.

1 Like

Right, events don't get "triggered" per se; they are often then result of a command being sent (and the device/driver doesn't show you exactly what did that), but the events the selves are normally just generated when the device talks back to the hub to say that whatever it was actually changed and the driver creates an event from that. Since this information is coming from the device, there's really no way to tie it back to an app at that point.

That's why enabling logging in the app, as I suggested above for this rule, is generally going to be more helpful. If this rule wasn't it, perhaps is another app. Check the "in use by" section on the device detail page, and consider enabling logging for additional apps that might be doing this. If it's Alexa and you have Hunches disabled, is it possible you just set up a regular Routine in Alexa that may have done it? (Hubitat logs, of course, also won't help much for external systems, and Alexa itself doesn't exactly have good logging...at least not that we can see. Ha.)

2 Likes

With respect to routines in Alexa, i had one routine that i use to shut the light off in my bedroom but i delete that a while ago..

Anything else listed in Alexa Routines? And you're sure Hunches is disabled? :smiley: (Sorry, it's just the #1 problem...) If disabling or removing the Alexa integration on Hubitat causes the problem to disappear and re-enabling (or reinstalling) it makes it come back, that's a strong case for it being Alexa.

If you suspect it's still something on Hubitat directly, consider looking at the "Scheduled Jobs" tab on the Logs page for things scheduled around 1 AM. (The job would show up sometime before then, but it may or may not be there all the time, depending on what the app scheduling it does.) That or looking at app log entries (likely "Past Logs" unless you're awake at that time) for around 1 AM may give hints as to what app is doing this--if that app has logging options available and enabled.

1 Like

Good to know. I was about to ask if there is a place that lists scheduled jobs, but you answered that already in another post.