=> Please note that I’ve change the mode to “restart”, so if a new motion happens again during those 90s the automation will restart and wait again for the motion to stop and then count the time again.
By the way, on your trigger the automation will run at any change on the motion sensor (even a sensor becoming unavailable), which your probably don’t want.
Maybe you should have something like this instead:
- platform: state
entity_id:
- binary_sensor.p1_motion_ias_zone
to: "on"
One last challenge, I’ll ask here since it still about motion sensor and lights.
I have a contact sensor on the front door, and planning to install a person presence sensor (Aqara FP1), to turn on the light (hue lights) of the entry room when the door is open (contact sensor), no one is detected in the living room (aqara fp1), and the persons status is away (I have just 2 persons tracked).
I have gone here so far:
alias: 'Lights turn on when someone is home.'
trigger:
platform: zone
entity_id: device_tracker.iphone
#entity_id: person.hatarez
zone: zone.home
event: enter
action:
service: light.turn_on
entity_id: light.livingroom
condition:
condition: state
entity_id: sun.sun
state: 'below_horizon'
My questions are:
a. You want the light (4) to turn on only when the door is opened AND no one is at home, is that correct? If someone is at home then the light is NOT turning on, right?
b. What if no one is at home, the door still closed and then the presence sensor start detecting someone? Do nothing?
c. What if no one is at home, the door still closed and the presence sensor in NOT detecting anyone, but then the device tracker detects someone arriving at home? What if the door then opens? It could happen that your device tracker detects you are at home even before you open the door.
d. Will this light ever turn off automatically? After some time? After the last person leaves home?
Try to think in other combinations and share your expected results.
The light must go on only in case no one is home and the door gets opened when is dark outside. Now we can use the tracker or maybe not (what if I have the maid or someone dropping off something , do I let them navigate in the dark?).