# Good way to detect if we are sleeping

**URL:** <https://community.homey.app/t/good-way-to-detect-if-we-are-sleeping/14000>\
**Category:** Flows\
**Created:** [June 3, 2019, 2:17pm UTC](https://community.homey.app/t/good-way-to-detect-if-we-are-sleeping/14000 "2019-06-03T14:17:21Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dennis\_Brouwer](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/dennis_brouwer/32/9661_2.png) [@Dennis\_Brouwer](https://community.homey.app/u/Dennis_Brouwer)\
**Post date:** [June 3, 2019, 2:17pm UTC](https://community.homey.app/t/good-way-to-detect-if-we-are-sleeping/14000/1 "2019-06-03T14:17:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Tomm](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tomm/32/10625_2.png) [@Tomm](https://community.homey.app/u/Tomm)\
**Post date:** [June 3, 2019, 2:24pm UTC](https://community.homey.app/t/good-way-to-detect-if-we-are-sleeping/14000/2 "2019-06-03T14:24:47Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Tomm](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tomm/32/10625_2.png) [@Tomm](https://community.homey.app/u/Tomm)\
**Post date:** [June 3, 2019, 6:51pm UTC](https://community.homey.app/t/good-way-to-detect-if-we-are-sleeping/14000/4 "2019-06-03T18:51:15Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Tomm](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/tomm/32/10625_2.png) [@Tomm](https://community.homey.app/u/Tomm)\
**Post date:** [June 3, 2019, 7:06pm UTC](https://community.homey.app/t/good-way-to-detect-if-we-are-sleeping/14000/6 "2019-06-03T19:06:38Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Bosund](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/bosund/32/9132_2.png) [@Bosund](https://community.homey.app/u/Bosund)\
**Post date:** [June 3, 2019, 8:23pm UTC](https://community.homey.app/t/good-way-to-detect-if-we-are-sleeping/14000/8 "2019-06-03T20:23:39Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Jan.Erling.Sagen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jan.erling.sagen/32/9257_2.png) [@Jan.Erling.Sagen](https://community.homey.app/u/Jan.Erling.Sagen)\
**Post date:** [June 16, 2019, 8:53am UTC](https://community.homey.app/t/good-way-to-detect-if-we-are-sleeping/14000/9 "2019-06-16T08:53:54Z")

</div>

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.”

---

<div class="post-metadata">

**Author:** ![Jan.Erling.Sagen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jan.erling.sagen/32/9257_2.png) [@Jan.Erling.Sagen](https://community.homey.app/u/Jan.Erling.Sagen)\
**Post date:** [June 16, 2019, 12:10pm UTC](https://community.homey.app/t/good-way-to-detect-if-we-are-sleeping/14000/11 "2019-06-16T12:10:31Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![PHEENEECK](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/pheeneeck/32/13516_2.png) [@PHEENEECK](https://community.homey.app/u/PHEENEECK)\
**Post date:** [August 19, 2019, 7:16pm UTC](https://community.homey.app/t/good-way-to-detect-if-we-are-sleeping/14000/12 "2019-08-19T19:16:39Z")

</div>

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

Good Day. How it is possible?

---

<div class="post-metadata">

**Author:** ![Remco\_Hendriksen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/remco_hendriksen/32/640_2.png) [@Remco\_Hendriksen](https://community.homey.app/u/Remco_Hendriksen)\
**Post date:** [August 21, 2019, 1:56pm UTC](https://community.homey.app/t/good-way-to-detect-if-we-are-sleeping/14000/13 "2019-08-21T13:56:06Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Kristian\_Mathisen](https://avatars.discourse-cdn.com/v4/letter/k/85f322/32.png) [@Kristian\_Mathisen](https://community.homey.app/u/Kristian_Mathisen)\
**Post date:** [August 24, 2019, 9:50am UTC](https://community.homey.app/t/good-way-to-detect-if-we-are-sleeping/14000/14 "2019-08-24T09:50:31Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Marvin\_Schenkel](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/marvin_schenkel/32/10195_2.png) [@Marvin\_Schenkel](https://community.homey.app/u/Marvin_Schenkel)\
**Post date:** [September 11, 2019, 12:53pm UTC](https://community.homey.app/t/good-way-to-detect-if-we-are-sleeping/14000/15 "2019-09-11T12:53:22Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Rickp](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/rickp/32/9466_2.png) [@Rickp](https://community.homey.app/u/Rickp)\
**Post date:** [September 11, 2019, 4:57pm UTC](https://community.homey.app/t/good-way-to-detect-if-we-are-sleeping/14000/16 "2019-09-11T16:57:57Z")

</div>

Power consumption on plug

---

<div class="post-metadata">

**Author:** ![robertklep](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/robertklep/32/160628_2.png) [@robertklep](https://community.homey.app/u/robertklep)\
**Post date:** [September 11, 2019, 5:03pm UTC](https://community.homey.app/t/good-way-to-detect-if-we-are-sleeping/14000/17 "2019-09-11T17:03:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Neuron44](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/neuron44/32/9492_2.png) [@Neuron44](https://community.homey.app/u/Neuron44)\
**Post date:** [September 13, 2019, 7:03am UTC](https://community.homey.app/t/good-way-to-detect-if-we-are-sleeping/14000/18 "2019-09-13T07:03:09Z")

</div>

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

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

---

<div class="post-metadata">

**Author:** ![Ben\_Loos](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ben_loos/32/34922_2.png) [@Ben\_Loos](https://community.homey.app/u/Ben_Loos)\
**Post date:** [April 14, 2021, 9:17pm UTC](https://community.homey.app/t/good-way-to-detect-if-we-are-sleeping/14000/19 "2021-04-14T21:17:43Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Mannni](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mannni/32/33829_2.png) [@Mannni](https://community.homey.app/u/Mannni)\
**Post date:** [October 1, 2021, 9:47pm UTC](https://community.homey.app/t/good-way-to-detect-if-we-are-sleeping/14000/20 "2021-10-01T21:47:08Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Russell\_S](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/russell_s/32/45779_2.png) [@Russell\_S](https://community.homey.app/u/Russell_S)\
**Post date:** [October 2, 2021, 8:15am UTC](https://community.homey.app/t/good-way-to-detect-if-we-are-sleeping/14000/21 "2021-10-02T08:15:21Z")

</div>

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 …

---

<div class="post-metadata">

**Author:** ![Edwin\_D](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/edwin_d/32/136417_2.png) [@Edwin\_D](https://community.homey.app/u/Edwin_D)\
**Post date:** [October 2, 2021, 8:24am UTC](https://community.homey.app/t/good-way-to-detect-if-we-are-sleeping/14000/22 "2021-10-02T08:24:52Z")

</div>

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. 🤪

---

<div class="post-metadata">

**Author:** ![Adrian\_Rockall](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/adrian_rockall/32/13209_2.png) [@Adrian\_Rockall](https://community.homey.app/u/Adrian_Rockall)\
**Post date:** [October 2, 2021, 8:31am UTC](https://community.homey.app/t/good-way-to-detect-if-we-are-sleeping/14000/23 "2021-10-02T08:31:27Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Edwin\_D](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/edwin_d/32/136417_2.png) [@Edwin\_D](https://community.homey.app/u/Edwin_D)\
**Post date:** [October 2, 2021, 8:34am UTC](https://community.homey.app/t/good-way-to-detect-if-we-are-sleeping/14000/24 "2021-10-02T08:34:52Z")

</div>

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?

[Next page](https://community.homey.app/t/good-way-to-detect-if-we-are-sleeping/14000.md?page=2)
