I’m trying to do an automation / blueprint that controls the occupancy status of the house. For this, I want to listen to all the events related to the motion or door sensors so that once the door of the house is closed, I can know if there is someone at home.
I have this code but it is not working well for me, it never enters. And i dont know how to fix it.
Thanks, I had already thought about that solution, the problem is that there are sensors like Aqara’s that are up to two minutes indicating movement, and it wouldn’t help me. What I need is to know when any sensor has changed from state to on, to indicate that there has been movement.
I would simply use a State Trigger and list all security-related binary_sensors with a to: 'on' option. It is efficient because it triggers only when a desired entity changes state to on.
In contrast, this Event Trigger will trigger when any entity in your system changes state:
You can create a helper input boolean and an automation that toggles this boolean whenever any of the motion sensors triggers. Then use this boolean as a trigger.