I am new to HA and enjoying the awesome things it can do, but I am struggling to figure out the right way to setup presence logic for zones. I have the Aqara FP2. Here’s the simple task I am trying to accomplish. Let’s say a room has 3 zones, “A”, “B”, and “C”. If presence is detected in “A”, light “1” should be on. If presence is detected in “B”, lights “1”, “2” and “3” should be on. Nothing for C.
Where this is failing me is when walking from “B” to “A”, all 3 lights turn off because that split second of transit time it appears HA sees both “B” and “A” as unoccupied before “A” is recognized as presence.
Is there a clever way to use HA and presence sensors when one light spans multiple zones? I can’t figure out the right way to catch all the conditions to get consistent results without the lights turning off for 1 second and turning back on when you cross a zone boundary. It’s rather inconsistent. Sometimes, it does work without blinking the lights.
My current setup:
Trigger: When Zone A presence becomes occupied:
Action: Turn on Light 1.
Trigger: When Zone B presence becomes occupied:
Action: Turn on Light 1, Turn on Light 2, Turn on Light 3.
Trigger: When Zone A presence becomes not occupied
Condition: Presence not detected in B.
Action: Turn off Light 1.
Trigger: When Zone B presence becomes not occupied.
Action: Turn off light 2, turn off light 3.
Trigger: When Zone B presence becomes not occupied.
Condition: Presence not detected in A.
Action: Turn off Light 1.
Results: Transiting between B and A yields inconsistent results. A to B doesn’t seem to misfire. Light 1 always stays on transiting from A to B.
Other questions:
Is there a delay parameter somewhere to wait 2 seconds, then check the conditions and execute?
Can someone explain how the duration field is intended to be used?
What is the difference between between setting the trigger as device–>“Presence detected in zone” and setting the trigger as state–>“zone change from clear to detected”? Is there any reason why you should use devices or states for triggers? I tried both and they work identically as far as I can tell.