Since the Aqara FP300 is currently sold out, I’ve been trying to get an Aqara p1 to work similar to a presence sensor. The automation below is close, but sometimes the light turns off while I’m still in the bathroom. FYI, I’m using Office Lamp Two for testing purposes until I get my smart switch installed. I’ve tried various combinations of the sensors properties. I’ve changed the cooldown period several times. Still, sometimes, when I’m in the bathroom testing, not moving much, the light turns out until it detects more motion. I’ve added conditionals and a boolean, but it ALMOST works. It’s not a presence sensor so maybe I’m expecting too much.
Any advice to get this working 100% of the time would be appreciated.
alias: Bathroom Motion Sensor
description: ""
triggers:
- type: motion
device_id: 9bd9e6925d0ce3bc104616d0062fd52b
entity_id: 5f13f951cf89154d58f5bc06fd3dcbf4
domain: binary_sensor
trigger: device
enabled: true
- trigger: state
entity_id:
- binary_sensor.motion_sensor
enabled: true
to:
- "off"
conditions: []
actions:
- if:
- condition: state
entity_id: input_boolean.bathroom_switch
state:
- "off"
then:
- type: turn_on
device_id: 36886995dfa78b45228e71e7e46ce963
entity_id: f8673b35003d86723c54f367950ea856
domain: light
- action: input_boolean.turn_on
metadata: {}
data: {}
target:
entity_id: input_boolean.bathroom_switch
else:
- condition: state
state:
- "off"
entity_id: binary_sensor.motion_sensor
enabled: true
- condition: state
state:
- "on"
enabled: true
entity_id: input_boolean.bathroom_switch
- delay:
hours: 0
minutes: 0
seconds: 10
milliseconds: 0
- action: input_boolean.turn_off
metadata: {}
data: {}
target:
entity_id: input_boolean.bathroom_switch
enabled: true
- type: turn_off
device_id: 36886995dfa78b45228e71e7e46ce963
entity_id: f8673b35003d86723c54f367950ea856
domain: light
enabled: true
mode: single