*changed* vs. Open or closed

I am trying to write a rule to have a switch turn on whenever a contact sensor is open and shut off 7 minutes later. Eventually i will also add motion to it. What is the difference between on/off and changed? Which would be a better option?

The room is a laundry room between the kitchen and garage. The garage door already has a contact sensor on it, so really try ro avoid using two motion sensors in a small room. I think because of how the doors are set I would have blind spots to a single motion sensor.

Using "Changed" will trigger the rule every time the contact sensor state changes. Using either "Open" or "Closed" will only trigger if the state changes to whichever one of those you select.

2 Likes

I use changed so that I can then evaluate what the change is to make my automations work with one rule rather than trying to write two rules. What might a better option though is if you do put a second motion sensor in is to use the Zone Motion Controllers app to group the two into one zone. That is what I do to eliminate false positives for HSM.

2 Likes

A trigger is a subscription to a device's events. When you use changed you are subscribing to both open and closed events. The rule would then typically use conditional logic to determine the appropriate actions to take.

Trigger Events
Contact *changed*

Action to Run
IF (Contact open) THEN
    Do Stuff
ELSE
    Do Other Stuff
END-IF

Triggering on open or closed (not both open and closed) you can simplify your rule by removing the conditional logic. You can also add a Wait for the non-triggered event (which is also a subscription to a device's events) to continue with actions.

Trigger Events
Contact open

Action to Run
Do Stuff
Wait for Contact closed
Do Other Stuff

Functionally these two approaches are the same buy my preference is to use the latter.

8 Likes

In this instance though the time-based delay / wait for the follow-up action may mean changes could be useful in stopping that from happening....

1 Like

there are many ways to do this.. rule machine , simple automation, room lighting, etc.

for two such case i use simple automation and motion lighting.. i find those the simplest to setup.

ie..

3 Likes