Successful Sleep Tracking with Aqara FP2 and Home Assistant

Hey everyone, I wanted to share my experience with integrating the Aqara FP2 sensor into my Home Assistant setup. I’ve been trying to create an automation that detects when I fall asleep and triggers a wake-up routine, and I finally got it working!

Initially, I was a bit frustrated because the FP2 sensor only exposed a presence entity when integrated via HomeKit. I couldn’t track sleep directly, which was my main goal. After some research, I decided to create a workaround using the sensor’s raw data and setting up a custom automation in Home Assistant.

Here’s what I did:

  1. Calibrated the Sensor: I placed the FP2 above my bed and let it gather data for a few days to get a baseline of my sleep patterns.
  2. Set Up Custom Automation: I used the sensor’s heart rate and movement data to create a trigger that detects when I’ve been still for a certain period, indicating I’ve fallen asleep.
  3. Created Wake-Up Routine: Once the automation detects I’m asleep, it gently wakes me up with dimmed lights and soft music.

The results have been amazing! I’ve been getting a much better night’s sleep, and waking up feels more natural. If anyone else is struggling with sleep tracking, I’d be happy to share more details about my setup. It’s a fantastic feeling to have this level of control over my home environment!

Happy automating! :star2: