Motion Lighting Gone Rogue Or Something Else

You won't be able to do this with Motion Lighting. But you can with Rule Machine. See this rule (pardon the 12 hour time display, and early sunset time).

What's happening is that it first tests to see if sunset is before 20:25, and also that it is between sunset and 20:25. The only period in which it will not turn off the light from motion inactive is when sunset is before 20:25 AND it is between sunset and 20:25. Otherwise, either because sunset is after 20:25 or it is not during that period, it will turn off the lights 1 minute after motion
stops.

It uses a variable to put sunset into because there is no direct way to test sunset time against another time, other than with a variable.

1 Like

Thank you, I’ll give that a go.

This is what I’ve ended up with… now to wait for the light level to drop :slight_smile:

Be sure to have Event, Trigger and Action logging enabled for that rule!

Good call! Made a few minor changes based on what I was seeing in the logs. So far, so good. Thanks for your help!

Edit: minor change when I realised I don’t want the lights to come on at mode change, just modify levels if they’re already on.

There is an action you could use to simplify: Set Color Temperature per Mode:

It allows mode specific settings, just like you're doing with the big chained set of Conditional Actions. Also, you are missing the use of ELSE-IF, which would also simplify that. But using Set Per Mode would reduce all of that considerably.

Are you triggering on the mode change because you want the lights to actually change while on, if the mode changes while they are on? Usually, it is more pleasing if you don't change them while on, but simply turn them on each time to the right setting.

1 Like

If you don't really need the mode trigger, you could do the same thing much simpler, using what I posted above:

The Waits work because if the motion is retriggered during the 3 minutes, the pending wait is cancelled automatically (no need for 'cancelable'). Net affect is that the lights stay on until there has been no motion for 3 full minutes, irrespective of how long there is motion to begin with.

That’s a lot simpler - I wish I’d noticed that when I was setting the rule up.

Yes, I wanted the light level to change as the mode changed if they were on at the time. To be honest it probably makes no difference as the use of the room is intermittent past 8:30pm. I’ve also noticed that within a condition “mode is changed” always appears to be true.

You could have a second rule that just adjusts the lights on a mode change, if they are already on.

1 Like

That makes sense, and will keep the motion rule cleaner and simpler. Thanks!