Sleep/Wake detection

Anyone found a device that will accurately report to HA if you’re awake or asleep? The Oura 3 almost had it but it would go unavailable.

I have an Aqara FP2 that’s supposed to be able to do that - haven’t tried it yet, though, because I’m currently using it for presence detection somewhere else.
Curious to see what other people have to say.

1 Like

I use this for sleep tracking. It exposes a lot to HA, time to sleep, time to wake up, REM, deep sleep and so on but I am only using it for occupancy in HA right now. Under-mattress sleep tracker - Sleep Analyzer | Withings

Thanks for the hint, @fleskefjes
I looked at the integration page but it doesn’t really show any details on what it allows you to see in Home Assistant - do you maybe have a screenshot of the entities of this integration?

Sure! I have one Withings weight and this sleep sensor, the integration does not specify what sensors are from what item (I believe some are from the health data on my iphone aswell), but this gives you an idea:




Thanks for that - looks like quite some interesting entities.
What a shame it doesn’t show which one comes from which device, but the unavailable ones seem to be from scale.

Yeah it’s a cool device, we have two that we’ve had for several years and honestly never started using the HA sensors other than occupancy. The Withings app gives me a lot of cool data as well. Some people report issues with the integration (authentication) but personally I’ve never had any issues.

1 Like

The withings mat doesnt tell HA if youre currently awake or asleep. I just need a binary sensor for that specifically. My FP2 is also tied up in presence detection. It also says it only tracks 1 person for sleep, so problematic for me and my spouse. The Oura ring had an attribute on the HR monitor that said “source” and would say resting or awake, the only problem I ran into was that it would stop reporting at random, so I returned them

I use an Aqara leak sensor with a pressure mat to do bed occupancy that is set 30s for occupied detection and 10s for when out of bed, keeps the detection consistent to account for movement.

Not looking for occupancy, looking for awake/asleep. I have a ton of ideas I could put to use with it.

I suggest using a sleep tracking app which can broadcast like ‘sleep-as-android’ for example.
Personally I am using it as a smart alarm and sleep tracker. It exposes the events via mqtt to Home-Assistant. Also, there should be an custom integration for it.
Using templates or the sleep tracking app you could apply logic to the events or limit them to awake/sleeping,

You could have say a shelly button 1 or NFC stickers at the nightstand to press/scan when you are going to sleep/waking up to manage those automatons separate of occupancy.

I use a wireless charger. SAA says it needs to be on the bed, can you confirm it would still work on my charger, I never found an integration and if there is one in gonna cry because of how long it took me to make it automatically set alarms based on my calendar work schedule. Edit: i hate my life I found the integration.

As for options that don’t report wake/sleep, I have no need for them, I already have an automation that will use the sleep confidence from the phone, the interactive, and activity sensor, they then pause my shield tv when all conditions match and if the shield is paused for 5 minutes it shuts off the tv and changes my input boolean to indicate I am asleep and sets off my automations. I literally just need a sensor that senses my physical state of awake/asleep.

1 Like

There is a feature that makes use of some sonar technology, basically using your speaker and microphone to determine how you sleep.
it can also connect to wearables. ( in my case a xiaomi band 6)
it is recommended to put it on the bed to make use of accelerometer for sleep tracking, but as long as you just need some sort of binary feedback on if you are sleeping or not it does work as intended, just no real sleep tracking ( in case you wake up in the middle of the night, HA does not know)

give the microphone sonar thingy a read, could potentially solve your problem :smiley:

1 Like

I can confirm that the FP2 does not pass wake/sleep to HA. It still just acts like an occupancy sensor.

Got SAA running, but the sensor created is far from binary. Ill probably create a trigger template sensor

Thanks for checking!

in the mqtt settings, you can select which events are exposed, limiting to sleep_tracking started and stopped should do the trick.

Otherwise use in combination with a template entity
using templates to define the on/off states depending on what saa’s sensor is showing

1 Like

Thank you! Will test tonight. If works, will mark as solution

Unfortunately the SleepAsAndroid app didnt work solo, purchased xiaomi bands, also not reliable nor accurate.
Found this but am too novice in coding, but would this mean that if I had a fitbit I could get that data?