Hello.
Please help me understand the conditions.
I have 2 motion sensors in the room and I need turn of the light in room when they both go into the “no motion detected” state and stay in that state for 1 minute.
My automation is not working and i don’t understand why.
I used condition AND, but it’s not working.
Please help me.
So in human words this translates as:
When the light turns on (=trigger) AND motion1 as well as motion2 are off for 1 minute (condition) , turn off the light (action).
the idea is to make automation work when the light is turned on manually.
I know that I don’t know anything)
How it must works?
How can I get automation to work with my script?
I need the light to turn off if there is no response on either motion sensor within 1 minute.
But if there is movement on at least one of the sensors during this period of time, then the light does not need to be turned off.
Perhaps there is some other way to check the status of two sensors within a minute?
I tried removing the condition completely and adding a wait for 2 triggers in the actions, but it didn’t work(
Use a trigger that has both motion sensors in it being off for 1:00. Give them separate IDs.
Put a condition of that light state being on.
In the Action, use a choose on trigger ID.
First choose will be the first ID. Put an IF in there querying the second motion sensor to be off. If true, shut off the light.
Second choose will be the second ID. Put an IF in there querying the first motion sensor to be off. If true, shut off the light.
You can also use the sensors to determine presence in the room. I have not done this, but you can surely find it with a google search of home assistant presence detection.
Then, use that presence to turn the light on or off.
The motion sensor is the trigger…the light the action…anything else is a wrong way of thinking…
In this case there is no need for a condition, as that normally refers to something else not related to the trigger (and here the 1 minute does belong to the trigger )
@jeffcrum That is an option (especially when you want to do it UI only), but it does make it unnecessary complex…
The issue is that there are 2 motion sensors that both need to be off for at least 1 minute.
Why not combine them in a YAML template trigger?
Something like this:
This makes it easier when you need to replace the switch for some reason; as long as it uses the same name, it will not brake the automation. Using device_id will (as any replaced device will get a new ID )
I think this is too redundant. I’m afraid of getting confused in the identifiers later)
But the idea is good, we need to study it in order to use it in other automations.
Thank you!
I have used this and kind of love it. But, I went away from the occupancy sensors and just use the motion sensors.
I found the sensor’s occupancy was holding ‘on’ much longer than I wanted. But, it is for the laundry room as opposed to like a TV room where motion might not happen, but occupancy should be tracked.
In the end, the wife is happy. So, I am ecstatic!!!