There is an app 'sleep as android' that you download which works with s health. From the demonstration video you lay the phone next to you when you sleep and it judges the sleep via the accelerometer. If you toss and turn a lot it senses that. I believe it also listens for snoring as well.