Stop dimming doesn't work

Team, Happy New Year!
I have a question about the rule machine with canceling dimming.

I have two rules - one turns lights if there is motion, and another dims the lights where there is no motion.
Now when there is motion during dimming - I can't figure out how to cancel.


I also tried Required condition but it worked for me one or two times but feels like race condition (condition and trigger were the same)

Kindly help :pray:

Cc @bravenel

The Stop changing dimmer action is meant to be used in conjunction with (after) a Start raising/lowering dimmer action. It may or may not work with a regular Dim action (as in your first screenshot), depending on the device and driver. It will not do anything with the Fade dimmer over time action (as in your second screenshot). You'd need Stop dimmer fade or another more drastic action like Cancel rule timers (which may do more than just this, depending on your other actions) for that.

It also generally makes the most sense to use Start raising/lowering dimmer and Stop changing dimmer in response to different events, like a button push or hold and a button release. This is more often and more easily done in Button Controller over Rule Machine, though either would work. The idea would be to simulate the behavior of a "real" dimmer, where this is generally how they work. It would rarely (never?) make sense to start raising/lowering and then immediately stop in the same rule.

It may be helpful to step back and describe the automation you are trying to create, then someone can help you figure out what actions you should use if the above doesn't help.

1 Like

You need to modify the motion active rule slightly:

Triggers:
Motion active

Actions:
Cancel Rule Timers: Rule 2 (your fade rule)
Set dimmer to 100

You could even turn your Cancel into a simple conditional. If switch is on, cancel rule 2. This way, the first action would only run if the light was already on.

1 Like

This is very cool! Thank you for this pointer - works like a charm!

1 Like