Good way to detect if we are sleeping

Hey all,

I’m struggling with the following : I have a “sleep” mode virtual switch, if that is turned on, behavior of lights, temperature and alarms is changed. I’ve now configured that it listens to a Hue Tap sensor, if you tap it it switches between on/off on the virtual switch. Works fine, but sometimes someone forgets to tap te button and it stays in sleeping mode, or the other way around and then lights/temps etc are not working as expected.

What do you guys use to determine if everyone is sleeping or not?

Dennis

Put a plug with energy meter before your phone charger.

If - energy is greater than 0
And - nobody is sleeping
Then - Mark as sleeping

If - energy is exactly 0
And - someone is sleeping
Then - Start countdown timer of 8 hours

If - Motion is detected in stairway
And - Countdown timer is running
Then - Mark as Awake and stop countdown timer.

The trick with motion sensor and countdown timer is needed because your phone charges faster then you get your rest.

3 Likes

not really a night-peeing person myself but I think that is easily overcome by:

  • add an extra condition. e.g. it’s after 4:30 AM
  • change the motion sensor in the stairway by e.g. a contact sensor in your sock drawer or something else that is part of your daily morning routine.
2 Likes

Actually the charger is now ON all day long (build in Qi-charger in nightstand). But your comment makes me think about expanding the flow a little further. Thanks for that.

2 Likes

I’m thinking of using my indoor Netatmo base unit for the same purpose.

It measure co2 and noise.

When time

And co2 < 600

and
noise < 40 db

Then sleep.

7 Likes

I am using an Aqara vibration sensor and an Aqara motion sensor. Those are really cheap.

I’ve got the vibration sensor under the mattres. It is not perfect as it is not possible to change the sensitivty of the alarm with the zigbee protocol in Homey. But I am using change of vibration strength as trigger. (must be above 3, to avoid false triggers).

The montion sensor is placed under the bed. When it is triggered it marks me as awake. It also turns on lights under the bed that lightens the floor just enough to walk around. It also disables the flow for the vibration sensor for like 8 minutes for cases like “I get in the bedroom sit down on the bed to put on socks.”

1 Like

The motion sensor under the bed detects me getting out of bed. Turning on ligths that is needed. When I get back in bed the vibration sensor detecs that I am back in the bed.

But I am using change of vibration strength as trigger. (must be above 3, to avoid false triggers).

Good Day. How it is possible?

I am using withings sleep through ifttt for this.
This is working really well. A bit expensive though :cry:

1 Like

We have to nightstand lamps by our bed that turns on when someone enters the bedroom. On the bedstand there is a double-button that turns the lights off when you are about to sleep. This also activates sleep-mode.

I use two flic buttons on our bedside tables that put us to asleep and awake. I also use ‘reset flows’ that configure my apartment to default settings. I use this to mark everyone as awake, reset my light scenes to ‘normal’ etc. This flow just fires at 14:00.

Power consumption on plug

Related: https://hackaday.com/2019/09/11/does-your-home-assistant-know-when-you-are-sleeping/

1 Like

I recently found this:
https://www.robbshop.nl/drukmat-aanwezigheids-sensor?sqr=druk&

and this:
https://www.robbshop.nl/drukmat-aanwezigheids-sensor-rond?sqr=druk&

What I do is use an power plug and whenever I plug in my phone I measure the power change which puts me to sleep. Since loading is prfetty unpredicatble as a proces the absence of power taken is not good to mark me awake.

For marking myself awake i use IFTTT to see when the power plug is unplugged from the phone. In android with IFTTT I can trigger a homey flow that marks me awake. Works pefect and without any delay.

to sleep:
If - power changed
And - power > 0
And - awake = YES
Then - change awake into NO
And - Mark me as sleeping

waking up:
If IFTTT applet start flow with tag wakker
and awake is No
then - markt me awake
and - set awake to YES

Long time ago but I now have the same problem. How to detect sleep. The charger option is not the best, I often forget or don’t care about my phone. I ordered some vibration sensor seems most reasonable for me. Will see how this turns out for me.
Set awake is easy, if after 6 in the morning and activities in two rooms detected.

I’ve heard one of the new Amazon Echo’s is meant to be able to do sleep detection.

There might possibly be other options if using an Apple Watch and HomeKit…

If just wanting to know if your in bed , I’ve heard a cleaver trick using weight sensors under each leg of your bed …

Google Nest Hub 2nd gen also has a radar to detect sleep. I don’t know if you can trigger Google routines based on that, but if you can then this would also work. You can set op a virtual switch in Homey, have Google turn it on and off based on sleep detection and Homey can then react on the virtual switch.

EDIT: just found a FAQ from Google it cannot do that yet. Bummer! Their solution is also a joke: use the bedtime routine. Ok, so I should tell my sleep sensing radar when I go to sleep. :crazy_face:

I use the withings sleep mats. Not a cheap solution but working well plus I get a load of data about my sleep pattern.

2 Likes

Is that the new sleep analyzer or the previous model? And does it have its own connection or does it require your phone to be near?