Aqara FP2 won't trigger automation after midnight

Hello everyone,

I’m experiencing an issue with my Home Assistant automation using the Aqara FP2 motion sensor. The automation works perfectly before midnight, but after midnight, it stops triggering the lights.

Setup Details:

  • Home Assistant Version: 2025.3.3 (latest)
  • Devices Involved:
    • Aqara FP2 Motion Sensor (used in the bedroom)
    • Philips Hue Bulbs (controlled via Hue Bridge)
    • Google Nest Mini (for night mode command)
  • Other Working Rooms:
    • Bathroom & Toilet (using Philips Hue Motion Sensors) → These work fine after midnight.

Automation Logic:

  1. Trigger:
  • Motion detected (occupied) on Aqara FP2
  • Condition: After sunset
  • Action: Turns on lights (all 3 lights or 1 light depending on “Night Mode”)
  1. Night Mode:
  • Activated via Google Home “Good Night” routine
  • When Night Mode is on, only 1 light turns on instead of 3

Problem:

  • Before midnight: Everything works fine.
  • After midnight: The automation no longer triggers when I enter the room.
  • The same automation logic works fine in other rooms (toilet & bathroom) with Hue Motion Sensors.
  • Google Home automation (separate test) successfully turns on the light after midnight, meaning the light itself is working fine.

What I’ve Checked So Far:

:white_check_mark: Aqara FP2 Detection (Developer Tools → States)

  • Before midnight → Motion (occupied ) detected :white_check_mark:
  • After midnight → Motion (occupied ) detected :white_check_mark:

:white_check_mark: Manually Running the Automation (Automations & Scenes → “Run” button)

  • Lights turn on manually :white_check_mark:

:white_check_mark: Checked for Conditions Blocking the Automation

  • There are no time-based conditions stopping the automation.
  • The automation should run anytime after sunset, including past midnight.

:white_check_mark: Checked Logs for Errors

  • No obvious errors related to light.turn_on or Aqara FP2 .

Possible Causes:

  1. Aqara FP2 stops detecting motion after midnight (or has a sleep mode I don’t know about?).
  2. Home Assistant or Zigbee network (if relevant) stops receiving updates from FP2.
  3. A hidden condition or bug in the automation preventing it from triggering.

Questions:

  • Has anyone else experienced the Aqara FP2 stopping motion detection past midnight?
  • Is there a known timeout, sleep mode, or inactivity reset that needs to be configured on the FP2?
  • Could this be an issue with Home Assistant’s handling of motion sensors after a certain time?

Any help would be greatly appreciated! Thanks in advance. :pray:

Please share your automation YAML correctly formatted for the forum.

Do the other automations that are working have other triggers or conditions that could explain why they’re working and this one isn’t?

Here is the YAML code

alias: Auto Lights Charlie - ON
description: ""
triggers:
  - type: occupied
    device_id: fd12cd818890c2d657cf90eec21fb715
    entity_id: 8c3aafbbbfb5f2da00e23b497813a2bc
    domain: binary_sensor
    trigger: device
conditions:
  - condition: sun
    after: sunset
actions:
  - action: persistent_notification.create
    data:
      message: Aqara FP2 detected motion, automation triggered
  - alias: "Action 2: If Night Mode is OFF → Turn on all 3 lights"
    if:
      - condition: state
        entity_id: input_boolean.night_mode
        state: "off"
    then:
      - action: light.turn_on
        target:
          area_id: bureau
        data:
          kelvin: 2000
          brightness_pct: 70
  - alias: "Action 3: If Night Mode is ON → Turn on 1 light"
    if:
      - condition: state
        entity_id: input_boolean.night_mode
        state: "on"
    then:
      - action: light.turn_on
        target:
          device_id: 0eec535c4ae190f63b2566613e37d790
        data:
          kelvin: 2000
          brightness_pct: 50
mode: single

https://www.home-assistant.io/docs/scripts/conditions/#sunsetsunrise-condition

After sunset to midnight condition (what you have):

After sunset to sunrise condition (what you need):

conditions:
  - condition: sun
    after: sunset
    before: sunrise

You should also replace that device trigger with a state trigger, see: Why and how to avoid device_ids in automations and scripts

1 Like

The only difference is that the other automation use the Philips Hue Motion sensor and do not have the after sunset option

It worked flawlessly ! Thanks for your help !

1 Like