Do I need explicit counter states?

I'm creating a rule to slightly brighten the island light in our kitchen during a generally dark media watching scene.

the gist...

When motion on kitchen sensor is active
AND scene Play is active
THEN adjust Kitchen Island Dimmer +10

With Rule Machine, does it automate the opposite? (e.g. when no motion, adjust -10) or do I have to explicitly add that? Can it be in the same rule, or does it need to be a separate rule?

You'd have to define that logic with another conditional statement, the rule won't infer that for you. Either in the same rule or another one.

If you use kitchen motion sensor "changed" as your trigger, you could write the logic for adjust up and down into conditionals in a single rule's actions.

If the trigger is motion active, you could still probably do it in one rule, but you'd need to add a "wait for events" or "wait for conditions" (i.e. motion inactive) into your actions.

Or you could create a second rule with motion inactive as the trigger, and actions that are essentially the opposite of the first rule.

Rule Machine is pretty flexible.

2 Likes

Thanks I’ll try the if changed

You could also consider using "Wait for Event" in place of *changed*.

The most recent Hubitat Live! episode (available on YouTube) had a great example of using "Wait for Event" in situation that was essentially analogous to the one you've presented.

I couldn't figure out the if changed logic, so i tried the wait for event logic, we'll see if it works tonight.


It is recommended to use "Wait for events" over "Wait for condition". Please watch the last episode of Hubitat Live! - the logic is explained therein.

1 Like

Noted and updated. fingers crossed.

1 Like

You could also use capture and restore for the state of the lights in case there are times that the lights may be manually changed after the rule has run.

It might be better if I had a way that said:

If manually changed during the rule, cancel the rule (don't wait for motion change, cancel delay)

I think this is possible with RM. However, I know it is possible with Node-RED.

You could use a variable to capture the dimmer level after it was adjusted +25 and then compare the the current dimmer level to this before adjusting -25 to see if it had been manually changed.