Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements to sleep detection #1

Open
2 of 12 tasks
Dikay900 opened this issue Jul 27, 2018 · 0 comments
Open
2 of 12 tasks

Improvements to sleep detection #1

Dikay900 opened this issue Jul 27, 2018 · 0 comments

Comments

@Dikay900
Copy link
Owner

Dikay900 commented Jul 27, 2018

  • Freeyourgadget/Gadgetbridge#686
  • Freeyourgadget/Gadgetbridge#232
  • Freeyourgadget/Gadgetbridge#650


Targets:
  • fix deep and light sleep detection since this is actually out of line
  • try to detect REM sleep aka light sleep with some activity or higher HR (little below base HR) + some activity at the end which will then fall off into light sleep (where is the ideal time for waking up before getting back to deep sleep)

Light Sleep 1 -> Light Sleep 2 -> Deep Sleep 3 -> Deep Sleep 4 -> Deep Sleep 3 -> Light Sleep 2 -> Light Sleep 1 -> REM
  1. Light Sleep (1)
  2. Light Sleep (2)
  3. Deep Sleep (3)
  4. Light Sleep (2)
  5. Light Sleep (1)
  6. REM (0 / 1)
  7. Light Sleep (1)
  8. Light Sleep (2)
  9. back to Deep Sleep (3)
  10. repeat at 4.

REM State could be falsely detected with being awake, REM is actually in the light sleep detection but should not be interrupted. You will move around a bit in the end of the REM stage which could be used as indicator for a smart alarm.


Walking

1
16 - light walking
17 - bit flip with 1
26 -> rare

Running

50 -> rare
66 - > rare
82 -> start/end
98 ???

Sleeping
96-127
0110 0000 - 0111 1111

28 -> wake up ???
105 -> wake up ???
106 -> fall asleep ???
108 -> wake up ??
112 -> sleep, raw_intensity =0 - after 10 minutes start sleep state
121 -> sleep, raw_intensity > 20 - start deep sleep ? 96 + 80 after - state changed after deep sleep? - some activity is starting here - after some sleep - activity detected - maybe state change into light sleep
122 -> sleep, raw_intensity =<20
- after 121 and some more activity - very often just intensity of 20 - maybe state change into deep sleep
123 -> fall asleep - deep sleep in gb after that after 10 minutes of 112
124 -> wake up - stop tracking in gb - first steps after sleep state
80 - ~~could be REM while sleeping (activity) - hmm no REM no activity at all ~~ - alternative for 112 while sleeping - 111 = 112 - 80 = 101 - probably bit flipping there ???

Immobile/Siting

80 ???
89 - after 121 state changed some activity - after that 80 and no activity - could be REM / REM Ending - Another bit flip
90 - sit down
96 - standing up
91 -> rare - start sleep state in GB
99 -> rare ???


0111 0100 - wake up
0111 0000 - fall sleep

definitely must use values bitwise


definitely no native tracking of light and deep sleep
@Dikay900 Dikay900 changed the title Improvements to sleep detecting needed Improvements to sleep detection Jul 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant