Hello, I have an Aqara FP2 that I am experimenting with multiple presence zones and need some assistance.
Scenario is if someone can’t sleep and gets up in middle of night, they exit the bedroom to the living room and there is a 5 sec delay then a small lamp turns on, if the person goes to the couch to lie down the lamp will turn off after 20 sec.
If the person leaves the couch the lamp turns back on again, and if they leave the living room and return to bedroom the lamp turns off.
I have muddled together an Automation that for the most part is doing what I need, but I can’t get the lamp to turn off when exiting the living room and returning to bedroom. I don’t know how to differentiate from the initial detection from bedroom to living room which I think is what stops the light turning off.
Any guidance would be greatly appreciated.
alias: "Overnight: Living Room Luminosity"
description: ""
trigger:
- platform: state
entity_id:
- binary_sensor.presence_sensor_fp2_c22b_presence_sensor_3
id: Couch Clear
enabled: true
from: "on"
- platform: state
entity_id:
- binary_sensor.presence_sensor_fp2_c22b_presence_sensor_3
to: "on"
id: Couch Detected
- platform: state
entity_id:
- binary_sensor.presence_sensor_fp2_c22b_presence_sensor_2
id: Bedroom Door Clear
from: "on"
- platform: state
entity_id:
- binary_sensor.presence_sensor_fp2_c22b_presence_sensor_2
to: "on"
id: Bedroom Door Detected
condition:
- condition: state
entity_id: input_boolean.vacation_mode
state: "off"
- condition: time
after: "23:30:00"
before: "06:00:00"
enabled: true
- condition: numeric_state
entity_id: binary_sensor.presence_sensor_fp2_c22b_presence_sensor_1
below: 45
enabled: true
action:
- choose:
- conditions:
- condition: trigger
id:
- Bedroom Door Detected
sequence:
- delay:
hours: 0
minutes: 0
seconds: 3
milliseconds: 0
- service: light.turn_on
target:
entity_id: light.dining_room
data: {}
- conditions:
- condition: trigger
id:
- Couch Detected
sequence:
- delay:
hours: 0
minutes: 0
seconds: 20
milliseconds: 0
- service: light.turn_off
target:
entity_id: light.dining_room
data: {}
- conditions:
- condition: trigger
id:
- Couch Clear
sequence:
- alias: Turn on the light
service: light.turn_on
target:
entity_id:
- light.dining_room
data: {}
- alias: Wait until there is no motion from device
wait_for_trigger:
- platform: state
entity_id:
- binary_sensor.presence_sensor_fp2_c22b_presence_sensor_1
from: "on"
to: "off"
enabled: true
- service: light.turn_off
target:
entity_id: light.dining_room
data: {}
mode: restart
max_exceeded: silent