Aquara fp2 - detect person is sleeping to kick off automation

hello,
does anyone have by any chance luck to detect sleep and how accurate is it?

Thank you!

In the last couple days I started using it to track my son’s sleep. It has been invaluable for discovering when he has snuck a flashlight and book into bed and is still awake.

Sadly have yet to get it integrated into home assistant. I am currently stuck using their app.

As for positioning, it needs to be mounted above the head of the bed and pointed down at where the chest would be. In the last two days since I set it up

1 Like

@kassah have u had a chance to integrate it with HA? thanks

Hi, I’ve just bought third FP2 (it really brings the magic to the home automation) to use it as sleep monitor in my bedroom. Tested the first night and data seems to be quite accurate (at least for the sleep/awake state.

In aqara app you may set only one zone for the sensor being in sleep monitor mode.
HA recognizes 2 areas for this sensor, first being the one above, whereas the second one, which usually should be “all-zones detection” - doesn’t seem to respond to anything.
I was hoping that maybe it’s passing the sleep/awake status to HA, but it hasn’t changed over night so I guess it’s not the case

As I see so much potential in “someone fell asleep” HA automations trigger, I’m not giving up so easily :slight_smile:

In aqara app automation the only available action for me (as it doesn’t seem to natively integrate with anything thought the app) is to send a push notification. I’m thinking of somehow send the data to HA. Maybe using a macrodroid app for Android to get the specific notification and send a webhook to HA?
I’d much appreciate your help on this - could you help me out if that’s possible? Sending webhooks is beyond my knowledge so I wanted to check first if that’s achievable using this or any other method.

1 Like

Update: I got it working :slight_smile: it ended up to be quite easy to use a last notification sensor of the home companion app (at least on Android).
Below is the automation that works for me:

alias: Sleep/awake automation
description: ""
trigger:
  - platform: state
    entity_id:
      - sensor.huawei_p30_last_notification
condition: []
action:
  - if:
      - condition: template
        value_template: >-
          {{ 'Someone fell asleep' in
          state_attr('sensor.huawei_p30_last_notification', 'android.text') }}
    then:
      - service: script.good_night
        metadata: {}
        data: {}
    alias: "Fall asleep "
  - alias: Waking up
    if:
      - condition: template
        value_template: >-
          {{ 'Someone is awake' in
          state_attr('sensor.huawei_p30_last_notification', 'android.text') }}
    then: []
mode: single

This way it works for different notification text. You need to add the aqara app to the allowed list in the app companion settings.

@qubey hello,
so are u integrating it with HAS and it can detect sleep etc?

thanks!

Yes, I use notications from aqara app to trigger automations in HA based on sleep and awake status (doesn’t support particular sleep phases)

@qubey so it seems it doesnt work w/out aqara app ?:confused:

Looks like it. Currently the official integration supports only presence/absence states in various zones

ah i see, and can u run that native app somewhere else as on mobile phone? i also dont have aquara bridge.

hello there, is there some update since the last comment from @qubey?

Thanks