Hi all.
I have installed Aqara motion sensors on every room in my home. All those sensors are hardware hacked, so they restart motion detection after 5 seconds with the proper configuration.
I also have set a helper with many options in a dropdown wich works as a “room presence”, with an automation choosing the correct option when every sensor detects movemement. So, if i walk into the kitchen, sensor detects motion - helper goes to “kitchen”… And so every time i walk into a room, or even the hallway. I’m using this to start (or end) other automations, light actions, etc…
Generally speaking, is working as expected. But, in some cases what i’m getting is not the desired result. Example: when i left my living room to go to the bathroom, i have to walk through the hallway. What i must see on the HA states and history of the “presence” helper has to be “livingroom - hallway - bathroom”… But what i see is “livingroom - hallway - livingroom - hallway - bathroom - hallway”. This is (very often) ruinning some other automation and light triggers.
On the automation used to “change” the “status” of the presence helper i’ve already set a motion detection trigger for minimum time by 5 secs. (The time set for the sensors to reset), but It seems that they’re overlapping states or something similar.
So, any help with this, please ??
Thanks.
Although this is unrelated to the issue you reported, I noticed your automation has triggers for binary_sensor.sensor_salon_a (SalonA) and binary_sensor.sensor_salon_b (salonB) but choose only handles SalonA not salonB.
There’s no input for salonb. I don’t need that for now, still thinking options for that sensor.
I’m not at home right now, will test your suggestion as soon as I can.
I’ll tell you the results.
Thanks in advance !
Not tried, but thought about it many times for sure. And ended thinking that it wouldn’t make a difference: The bath is on the half of the hallway and the distance between doors are short. The hallway sensor right now is on the most far spot I have.
You can try masking the motion sensor to constrain its field of view.
For example, I have a wall-mounted motion detector in a bathroom. Its location allows it to activate the moment someone crosses the threshold of the bathroom door. For my purposes, that’s too soon. There are times when you need to enter the bathroom to close the window blind before the motion detector turns on the light. I used tape, to cover part of the IR sensor, to narrow its field of view.
Perhaps it’s possible for you to do something similar to prevent the motion sensor in one room (livingroom) from detecting motion in another (hallway) and/or try relocating it.
I know that, and i have some of my sensors “half blinded”, but i think there’s no “ghost / false” positive here. Before positioning the sensors I’ve checked and tried in search of possible issues and so.
It may be something related to the way the information is passed or managed by HA when sensors “match” detecting motion or so.
And of course, maybe the way I realized this “room presence” can work accurately I’ve imagined its not the best solution.
I’ll keep trying and report if I can find the way.
Thanks so much again for your responses and help.
Much appreciated.
That’s only the hallway sensor, but for the others it’s the same behavior. Of course, there’s some coincidence sometimes when two sensors are detecting movement at the same moment for 1 or 2 seconds (That’s why I’m using the 5 seconds state’s to ON ON the automation).
I wonder if it’s a good idea to use the state of the motion sensors directly - the fact that they turn off may be making things unnecessarily complicated.
I have a sensor last_movement which is updated with the room name every time motion is detected and retains its value until the next movement. (This allows me to give Alexa commands like “lights off” without specifying the room - works well as long as there’s only one person in the house.) Something like that might simplify things.
@Stiltjack what you say is very similar to what I have done with my helper.
@123 checked the traces and seems correct: It chooses the right option every time.
I think I have it working as expected for now:
I’ve changed the detection states from 5 to 6 seconds in order to trigger the automation. Also changed the mode from “restart” to “single”.
I need to check the behaviour the next days but the tests at this moment is working OK.