New rule machine 4.1 question

will this rule turn on both lights based on both motion and contact sensor, and keep lights on if the conditions persist and turn off 20 minutes as long as the conditions don't fire again during the delay using the new wait for events.
thanks

Does that not work for you? I don't see any reason it shouldn't, though since you're using "Cancel Timed Actions" instead of "Cancel Delayed Actions," you don't need to select "cancelable" on that delay (but doing so shouldn't cause problems). You could also use "Wait for event: elapsed time" instead of a delay and not worry about canceling at all, as a retrigger cancels any in-progress waits.

your first example will work may switch to that., second no for two reasons

  1. motion sensors do not retrigger if there is constant motion they just stay active so it will never retrigger the rule, same for the door.. if door stays open or constant motion ... no retriggers so lights would still turn off after 20 minutes.

I think you misunderstood Bert.
Instead of replacing the first wait for conditions, he was suggesting replacing the delay in the last line.
You would just remove that delay and add an wait for event elapsed time above it.
That way it would indeed be cancelled if the door opened or the sensor became active, since to reach that point both of them would have already satisfied the above wait for condition.
Then you could just remove your cancel timed actions in the beginning.

you missundertand.. i stand by my analysis re-read it. if the door stays open or motion stays active no further triggers will fire and the light wil turn off after 20 minutes. that is not what i want.

that is what i think he was saying..but yes i could add a wait for elapsed time and ALSO have the wait for event.. but i think that is not better than the turn off with a cancel..

anyway it is working thanks..

That's not what I was saying. :slight_smile: You'd need both waits, for the conditions (like you have now) and for elapsed time (which you could use instead of the delay, this freeing you from needing to worry about cancellation since retriggers cancel waits implicitly). I believe this is what you meant in the second half of what you said. But just to spell out what I was thinking:

Trigger: Basement Stairs Door open OR Basement multisensor active

Actions:

On: Basement Lights, Basmeent Multisensor(?)
Wait for conditions: Basement Stairs Door closed AND Basement multisensor inactive
Wait for events: elapsed time --> 0:20:00
Off: Basement Lights, Basement Mutlisensor

I'm not saying it's "better," just that it should work the same as what you have now, which as I mentioned originally I think should work fine (even though if you want to save a couple clicks, there's no reason to use "cancelable" with "Cancel Timed Actions" since it doesn't care--and a "Wait" saves you from needing to cancel in the first place with your triggers being what they are).

Glad you got something figured out, in any case!

(For the sake of completeness: a third option is to use the Hubitat example app that "converts" door sensors into motion sensors--and then you wouldn't need a rule at all, since you could use any standard app that expects motion sensors for lighting automations, like SAR or Motion Lighting.)

1 Like

It is true for all waits, including "Wait for condition(s)" and "Wait for event." (It is not true for "Delays" of any kind, which must be explicitly cancelled.)

1 Like

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