Specific alarm on Mi Band
Since there are many complaints on the theory of how smart alarm works on Mi Band I request the following new alarm that is technically not smart (that is, to be operated from Gadgetbridge, not from Mi Band):
- Choose interval in which the alarm can work e.g. from 6 am to 7 am
- Detect 10 minutes of continous REM-sleep (i.e. non-movement) during the interval
- Fire alarm
The reason behind this request is because embedded smart alarm wakes up during "light sleep" (in Mi Band terminology) which is in fact non-REM sleep (weak movement of body) and thus works contrary to the scientific theory (that states that non-REM sleep with movement is of utmost importance for human physiology and shouldn't be disrupted).
Thank you for your suggestions. Unfortunately it is so far not feasible to do anything about this inside Gadgetbridge, since the smart alarm is implemented in the Mi Band firmware.
There is the very far fetched option to have the mobile next to your bed with Gadgetbridge running, enabling realtime activity data around the time of the alarm, and then triggering a vibration when your desired sleep state is detected.
As said, this is rather far fetched because it assumes you have your mobile in reach and we actually get the proper sleep values in realtime (I didn't try that).
So unless someone steps up and implements that, I'm afraid this won't get done anytime soon, because, it really is a feature of the Mi Band firmware.
removed "smart alarm" term from proposal since it was confusing (proposed alarm has technically nothing to do with embedded smart alarm).
As you seem to have quite some insights on sleep theory and the like, could you point us to some algorithms or research paper we could use to identify sleep phases and user activities using accelerometer data? We have a page in our wiki devoted to that, and we need the help of experts in the field! Thanks!
The theory is quite simple.
REM sleep is characterized by paralysis, muscle atonia. So what Mi Band calls "deep cleep" is in fact roughly "REM sleep" because rapid eye movements phase more or less corresponds to "muscle atonia" phase.
Thus accelerometer is fine to detect REM sleep. I'm not sure what are the algorithms Mi Band uses to detect paralysis but if it does so just fine it'd be nice to detect ~10 minutes of constant paralysis by monitoring movements of body (just as @cpfeiffer described)
As you can see from articles below REM sleep is similar to the state of being awaken hence this "Mi Band's deep sleep" is what can be disrupted by alarm to save your time whereas "Mi Band's light sleep" (with movements of body) mustn't be disrupted.
Thanks for the info. If anybody has some time to dig into this, I can handhold to implement a wakeup alarm as described in https://github.com/Freeyourgadget/Gadgetbridge/issues/371#issuecomment-237386152
rephrased the description so that it's more clear that the proposed solution shouldn't deal with smart alaram.
Deleting a branch is permanent. It CANNOT be undone. Continue?