Sometimes rules not running

I’ve run into issues with a couple rules not running.

One for example is my 11pm-5am rule. It’s not a trigger rule.

It looks at all the motion sensors and if not active it has a 15 min wait then turns off the remaining lights in the house.

The rule has a restriction to only run between 11pm and 5am.

Yesterday it didn’t work. I have no clue why?

When it failed, was it at a point in time that would have an overlap with the restriction time?

If at 5am the 15 minute delay was still counting down then it would get ignored and the rule would not turn the lights off.

I typically do not use restrictions for lighting automations, unless there is another automation that will make sure to handle the scenario where the the restriction takes effect in the middle of the original automation....

Instead, I typically at the time range as a Condition, so the rule will be evaluated at the start time and also at the end time. It will also allow the Delay with Cancel to be executed instead of restricted.

2 Likes

Okay, I changed it, and removed the restriction.

I was using the restriction to minimize the logging.. It still shows logging even if rule logging is off.

No don't think so. The rule starts at 11pm. I would imagine this wouldn't be an issue if it has 6 hours to run this rule?

Correct, its just the chance of motion being detected after 4:45am would keep the lights on until 11pm the next day.

But if you have removed the restriction then that wouldnt be a problem anymore.

If all of the sensors were already INACTIVE at 11pm, the rule would never run. The Rule requires an event to occur. In your original rule, if all sensors were already inactive at 11pm (when the restriction was lifted), nothing would ever happen.

By adding the two times as a Condition, instead of a Restriction, the Rule will be evaluated at both 11pm and 5am, causing the Actions to fire accordingly. Also, any time any of the sensors changes state, the rule will be evaluated.

Don't worry so much about logging. The day you need it to figure out what happened is the day you'll understand why it's there. This logging does not affect the performance of your hub.

3 Likes

@bravenel
I'll tag this on here but can start a new thread if required.
I had a 'turn on at sunset' rule not fire tonight.
This is in the events for the rule when it fired OK.
image
As you can see sunset becomes true then the rule becomes true and the light turns on.
image
Tonight I had this in the event log for the rule.
image
As you can see sunset is true is received but nothing for the rule becoming true.
The light turning on is when I opened and clicked done on the rule.
Here is the rule.
Any thoughts?
image

Please show the App events for that rule.

Is this what you are after?
EDIT: Actually there is nothing in there for sunrise this morning either.

EDIT 2:
Thinking about it my hub played silly beggars this morning. Got up to use the bathroom and the hall light didn't turn off for around 10 minutes. Then it turned off. Should have been 2 minutes. It was around sunrise.
The hub could have been having a kip!!!!
Hall light turned on. Sunrise was 05:46 today. All starting to tie in.
image

That makes sense.

So now that I have two things it’s looking at, the 11pm would kick it off even though the sensors are all in a inactive state if I decide to go to bed early?

Exactly. At 11pm, the rule will be evaluated, and if all motion sensors are inactive, the True Action will be executed. After 11pm, but before 5am, if any of the motion sensors goes inactive, the rule will also be evaluated.