I just got my Aqara FP300 Presence Sensor set up in Home Assistant. I set the sensor up in the Aqara app as a Zigbee device, then closed the app once it had finished changing it to Zigbee. In Home Assistant, I installed two apps: 1: MQTT Mosquito Broker, and 2: Zigbee2MQTT. I paired the Fp300 using the Zigbee2MQTT “Permit Join” function.
After that, I created an automation that uses the PIR or Presence Sensor (either) to turn on a Smart Plug that controls a light. Only the FP300 Presence sensor can turn off that Smart Plug (I chose this because the PIR sensor kept staying on 2 minutes after I left the room, and I wanted the light to shut off sooner if no one was in that room). I also added a 20 second timer so that if the PIR detected something, but the Presence Sensor did not (such as me starting to walk in that room, but turning around), the Smart Plug would still be turned off 20 seconds later.
Here’s the automation:
- alias: "Bathroom Light Strip (FP300 PIR + Presence Control)"
description: >
PIR turns ON quickly. Presence turns ON slower. Presence controls OFF.
If no presence detected within 20 seconds after PIR,
light turns OFF automatically.
mode: restart
id: date02102026001
trigger:
#############################################################
# FAST ON (PIR)
#############################################################
- platform: state
entity_id: binary_sensor.aqara_fp300_sensor_pir_detection
from: "off"
to: "on"
id: pir_on
#############################################################
# BACKUP ON (Presence direct)
#############################################################
- platform: state
entity_id: binary_sensor.aqara_fp300_sensor_presence
from: "off"
to: "on"
id: presence_on
#############################################################
# TURN OFF (Presence clears)
#############################################################
- platform: state
entity_id: binary_sensor.aqara_fp300_sensor_presence
from: "on"
to: "off"
id: presence_off
action:
- choose:
#############################################################
# PIR → TURN LIGHT ON + 20s PRESENCE CHECK
#############################################################
- conditions:
- condition: trigger
id: pir_on
sequence:
- service: switch.turn_on
target:
entity_id: switch.smart_plug_mini_5
# Wait up to 20 seconds for presence to activate
- wait_for_trigger:
- platform: state
entity_id: binary_sensor.aqara_fp300_sensor_presence
from: "off"
to: "on"
timeout: "00:00:20"
continue_on_timeout: true
# If presence never activated → turn light OFF
- choose:
- conditions:
- condition: template
value_template: "{{ wait.trigger is none }}"
sequence:
- service: switch.turn_off
target:
entity_id: switch.smart_plug_mini_5
#############################################################
# PRESENCE → TURN LIGHT ON
#############################################################
- conditions:
- condition: trigger
id: presence_on
sequence:
- service: switch.turn_on
target:
entity_id: switch.smart_plug_mini_5
#############################################################
# PRESENCE CLEARS → TURN LIGHT OFF
#############################################################
- conditions:
- condition: trigger
id: presence_off
sequence:
- service: switch.turn_off
target:
entity_id: switch.smart_plug_mini_5

