Automation rule running when it shouldn't

I recently added a new rule using Rule Machine to my automations.

What I wanted to accomplish:

When I arrive home (presence switch) and the hub is either in Evening or Evening Weekend modes, I want my garage lights and back door lights to ramp up to 100% (where normally they are at 40%), sit there for 5 minutes and then ramp back down to 40%.

The first time I set it up, it would turn the lights on anytime I arrived home, which was not what I wanted. So I watched a few videos on how to properly use conditions and set up a new rule machine rule.

This second iteration of the rule worked well for a few days. I arrived home before sunset (which is when mode switches to evening / evening weekend) and the lights didn't turn on. Then if I left and came back after sunset, the lights would ramp up, wait, then dim again.

Well I'm not sure what happened but in the last two or three days it has started turning the lights on again no matter what time I come home or what mode the hub is in.

That is the rule as it currently sits. Did I use conditions incorrectly?

A couple of things. Your last action in that rule should be 'END-IF' - it's incomplete without it.

Secondly if you only want this to happen when the Mode is Evening or Evening Weekend, rather than adding the condition and using IF, THEN you could just Use Required Expression at the top and put the modes there:

Required Expression - Mode in Evening, Evening Weekend
Trigger - Presence Switch Arrives
Actions - Dim Lights 100 fade 10, wait for event elapsed time 5 minutes, dim lights 40 fade 10

It's a simple condition, no THEN, so END-IF isn't used. I suspect the problem is the rule will run the Delay then the Dim 40 --> fade: 10 regardless of the Mode.

2 Likes

Thanks, I'll look into Required Expressions a little more because I did try to mess with those but I kept getting "not used" messages and it didn't seem to work for me.

That's a good point about the second dim to 40%. I guess I just assumed that if the first condition / action wasn't met, it would stop processing.

I updated and added the same condition to the second set of actions. I'll leave it like that for a few days and monitor.

There's an edge care here that may or may not be an issue. If this rule triggers 3 minutes before the Evening Mode ends then the second IF won't execute. I would suggest using an IF-THEN instead of the simple condition. Even better is to do what johnwill1 suggested. Also, turn on logging. It'll help you understand what's actually happening and will make it easier for us to help if you continue to have issues.

1 Like

I missed that

It's been running with the additional condition on the second action without issue for a week now. I think this solved my problem. Thanks!

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.