Automatic Sleep Detection


From Gadget Man on 2015/02/28 12:22:13 +0000

The general idea is to allow Sleep as Android to run in some form of low-power mode in the background at all times to detect and turn tracking on without user input. With how predictable it seems most sleep patterns are, I imagine that it would be as simple as the program detecting a sleep pattern, then backtracking previously recorded motion to the first sleep cycle. Sometimes the user may have forgotten to turn tracking on. Maybe the user doesn’t know how long it actually takes for them to get to sleep, or the length of time varies on a daily basis due to some physical difficulty, so they can never properly set the associated offset. Maybe the user fell asleep without realizing it, such as if the day was very taxing, or the user got drunk, and passed out. Maybe I have a spare Android device that I’d like to keep plugged in and on my bed at all times to serve as a sleep detector. And I’m sure there are more reasons that don’t immediately come to mind.

Copied from original feature request:


From Martin Butt on 2017/07/11 05:08:17 +0000

I think the simplest way is Leila's "I intend to sleep soon button". Falling asleep is a process for some people, myself included, that takes anywhere from 5 minutes to an hour. There might be some TV watching or reading in there. But eventually I'm going to feel ready to sleep and the last thing I want to do is turn on my phone screen and start the app. Can the app have an option to assume you are asleep, then reset the clock if you move around?


From Robin Markowitz on 2017/04/09 05:07:38 +0000

P.P.S. – The accuracy of Misfit is very sporadic. It can sometimes assist, but the app is so bad even on their own devices that I knocked it off my Pebble. And again, an applet like Pebble's is sometimes accurate and sometimes a huge swing and a miss. It can assist with the missing part of your nightly sleep, but that's about it. SaA needs to attempt this with good-battery-life devices. (And they are sprouting up swiftly since the Pebble debacle, which should not affect SaA at all. Even weather has been placed in an infinite server already. Pebble is good to go! And it has SaA.)


From Robin Markowitz on 2017/04/09 04:53:31 +0000

P.S. – This mini-SaA should only activate after a user-chosen time. I would pick 10 PM Pacific Time. If the person is still really sleeping in 15-20 minutes, it should Klkickstart the Big app's sleep tracking for that day of the week.


From Robin Markowitz on 2017/04/09 04:45:06 +0000

I know that you've been putting a lot of work into the Awake Detection feature, and I am very appreciative. And it's not buggy anymore. Unfortunately, it doesn't really respond to getting up and walking to the restroom and back.

I'm female, so this restroom-at-night-matter may be more of an issue for men north of 45 or 50.

But my problem with falling asleep before hitting the edit button messes up my stats, and is a mild annoyance. I must enter a non-graph of my really quite deep sleep and not even know when I dropped off and how I awakened.

A few times, I did test sleeps of lounging and dropping into a rock-hard sleep. Usually on the weekends for post-lunch dips watching Star Trek: TNG for the millionth time. (Still the best ever TV series other than TOS.


From Intika on 2017/01/23 15:18:19 +0000

This would be great. Based on the current feature go to sleep reminder…

Also it would be even more amazing to have this automation with the feature ideal sleep lenght


From Leila on 2015/12/16 14:35:37 +0000

And one more comment: I see that this app is developed in Switzerland. It is the country where people and machines all work so perfectly and planned lime nowhere else in the world. A train 2 minutes late would be considered punctual everywhere, here not. So please consider the possibility, that all this discussion is about culture: for you, the developers living i Switzerland, it may seem difficult to understand what the big problem is. For the rest of the world it apparently (so many people wanting tbis feature) the opposite is true, because so many (like me) forget to start it all the time! I am living Switzerland too, but I am foreigner, and no I am not that perfect, I am late all the time everywhere, and I always forget to start the app! -> I call for some recognition of cultural and personal differences


From Leila on 2015/12/16 14:29:55 +0000

And a question to developers: Wouldnt the following increase the likelyhood of correct automatic start of sleep recording a lot:

Beds have distinct attributes, setting them apart from tables and pockets and bags: the way the phone lands on them is soft and horizontal. From this it should be possible to distinguish landing in a bed versus landing somewhere else. (location + accelerometer data). I would not have a problem with a 1 time training of my phone to recognize my bed when being placed on it.

The only confounder could be a sofa in the same room. But that could be distinguished by the distance from the wifi. Wifi and bed can be considered immobile.


From Leila on 2015/12/16 14:19:54 +0000

Hey guys, I think this would be the single most important feature for all of us who nap. Because forgetting to start sleep recording at naps results in all stats being so distorted that they become meaningless. Even worse: if you record the nap but not the night, it appears that you slept 1 hour!

Napping every day, I accumulated a huge sleep deficit according to sleep as android. But exactly the opposite is true!! I simply fail to start the phone on a lot of naps and sometimes at night. So on every day there are only 1-6 hours recorded like for a perfect insomniac. => I cannot make use of all the wonderful statistics that this app generates! all in vein!

Commemts to solutions discussed so far:

  • no, I would not want to carry around a heart rate monitor on my wrist all the day for this.
  • yes, I understand the developers that they do not embrace this feature, cause I guess there are risks: lots of battery drain in vein, etc. But listen to the many people who want this and be creative, please!
  • I would be happy to do these:
    a) the problem actually is to remember to press the button when I am already falling asleep. It is not possible to resolve this by getting into the habit, because I use sleep tracking since half a year (another app so far) and still fail 1/2 of the naps!. But I would be able to do it more or less perfectly in advance, and then a.a) cut the excess time manually or a.b) the "start in advance" is a special start which only increases the likelyhood of automatic start of recording. when the phone senses that sleep is likely, it definitively starts within 2 hours of pressing this "I intend to go sleep soon" button.
    b) as others indicated, I specify location, time range, etc where sleep is likely. And if these conditions are met, I want the phone to attempt recording until a clear sleep or not sleep sign is observed such as snoring or making a call.


From Anonymous on 2015/12/09 20:05:33 +0000

This would also be very beneficial for those with narcolepsy and idiopathic hypersomnia, where naps aren't often voluntary.


From Petr Nálevka on 2015/11/26 21:59:34 +0000

+Annon we can do this with heart rate monitoring, this should detects most awake states longer than 15 minutes… you can do this with Android Wear heart rate monitors or through BT smart heart rate devices


From Anonymous on 2015/11/26 16:04:16 +0000

I also like to record the times i lay in bed awake as i also find it important


From Anonymous on 2015/09/01 06:32:42 +0000

I know that apps like misfit have this feature built in on pebble. So if the app is connected it should be easy based on time and movement patterns to detect when the user is sleeping.


From Artur Diniz Adam on 2015/07/30 03:46:10 +0000

The automatic sleep detection can be achieved in Pebble and Wear. Apps like Misfit already do that pretty accurately. It would be awesome to have that functionality in my Sleep as Android Pebble app.


From John Stoner For Life 77 on 2015/06/11 03:40:37 +0000

For example if you have +5 before tracking start ,
but if for some reason it takes youyou to more than 5 min to fall asleep, every hitting of "pause button" adds 5 min or any preset time from setting

and that preset time adds 5min to time before tracking begins and can also be controlled from pebble. So itself is giving pretty accurate time of you to falling asleep time


From John Stoner For Life 77 on 2015/06/11 03:32:53 +0000

For example if you have +5 before tracking start but if for some reason it takes more than 5 min to fall asleep, every hitting 9ö of pause button adds 5 min or any preset time from setting and that preset added 5min can also controlled from pebble. Sorry itself Givin party accurate time of you falling asleep


From Anonymous on 2015/06/10 20:04:18 +0000

hehe yeah i just checked the advice from sleep as android stats, it suggested the optimal sleep was 1.25 hours, i'm not ironman :stuck_out_tongue:


From Rubens Lopes on 2015/04/13 11:13:09 +0000

I came here to suggest the same!

The app "migraine buddy" does this besutifully. You input the estimated time you go to bed daily, and it auto detects when you went to sleep (I'm pretty sure that's using the accelerometer) and when you wake up. When waking up, it prompts you to confirm the time you went to bed and the time you woke up.

This would be an awesome feature, as I don't use the sleep tracker the whole night, but only to wake me up gently (smart alarm). This way I can't track how much I've slept.