OpenSeizureDetector / Android_Pebble_SD

The main OpenSeizureDetector Android App, that is published on the Android Play Store.
http://openseizuredetector.org.uk
GNU General Public License v3.0
9 stars 11 forks source link

No Errors if Watch is not being Worn #108

Closed jones139 closed 10 months ago

jones139 commented 1 year ago

The system failed to detect a seizure today. The reason was that Benjamin's watch had come off and we didn't notice him telling us, so he just put it on the bedside table and went back to bed. It would be nice if we could generate a fault warning if the watch is not being worn. I think the Fitbit devices have sensor to say if the watch is worn or not, but I have not seen this in the Garmin SDK. I am thinking of implementing a 'Fidget Detector' where a Fidget will be defined as a 5 second period with acceleration standard deviation above some threshold. We record the time of the last fidget, and if one is not detected for a given period (maybe an hour?), we generate a fault.

Does anyone know about how often humans move in their sleep, so we can set the alarm period to a sensible level?

44616E commented 11 months ago

Could this not use HR to detect being taken off?

jones139 commented 11 months ago

We could for most users, but our Benjamin has very sensitive skin so wears the watch over his clothes, so his heart rate readings are not reliable.

You are right though, if you are using the heart rate alarm you will get fault pips to say the data is not valid which achieves the same result. So maybe this issue is not significant for most users.

On Sat, 22 Jul 2023, 09:09 44616E, @.***> wrote:

Could this not use HR to detect being taken off?

— Reply to this email directly, view it on GitHub https://github.com/OpenSeizureDetector/Android_Pebble_SD/issues/108#issuecomment-1646522656, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACLSY5E5JHKLI5HECPBL7LXRODCXANCNFSM6AAAAAAZTGGXME . You are receiving this because you authored the thread.Message ID: @.***>

44616E commented 11 months ago

Detecting on the night stand is probably not to bad as there is likely almost no movement, but if it falls off and is lying next to him on the mattress or under or on top, then there is still going to be movement so much harder. The HR sensor has a proximity function in hardware, but if that can be used through the SDK seems doubtful from what I have read so far.

If we go down the pass of making our own hardware this would be a very good thing to incorporate.

jones139 commented 11 months ago

I'll drop you a note (or maybe put it in the discussion here) tonight about where I got with designing hardware. I'd like to prioritise getting the Pinetime working as that is cheaper than we'd be able to make a custom watch....and it is nearly there, just needs a but more development and testing effort on the watch and phone side.

Thanks!

Graham

On Sat, 22 Jul 2023, 12:14 44616E, @.***> wrote:

Detecting on the night stand is probably not to bad as there is likely almost no movement, but if it falls off and is lying next to him on the mattress or under or on top, then there is still going to be movement so much harder. The HR sensor has a proximity function in hardware, but if that can be used through the SDK seems doubtful from what I have read so far.

If we go down the pass of making our own hardware this would be a very good thing to incorporate.

— Reply to this email directly, view it on GitHub https://github.com/OpenSeizureDetector/Android_Pebble_SD/issues/108#issuecomment-1646559938, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACLSYYJ4RMS3NHMW64F7A3XROYYHANCNFSM6AAAAAAZTGGXME . You are receiving this because you authored the thread.Message ID: @.***>

jones139 commented 11 months ago

It looks like you are right that the Garmin SDK does not have a way of telling if the watch is worn or not, which is a shame, because Fitbit does that easily. This discussion suggests looking at heart rate data to spot if the watch is not on the wrist: https://forums.garmin.com/developer/connect-iq/f/discussion/258620/does-anyone-have-an-source-code-example-of-how-to-detect-take-the-watch-off-in-an-application-or-widget

The only difference I can see is that I am using the Heart Rate from a SensorInfo structure but the recommendation from the above thread suggests using an ActivityInfo instance to get the data (the OSD code is here: https://github.com/OpenSeizureDetector/Garmin_SD/blob/master/WatchApp/source/GarminSDDataHandler.mc#L158)

jones139 commented 10 months ago

Fidget Detector added to V4.1.11, which should address this issue (as long as we can find some suitable thresholds to define a 'fidget' and a period which is not too long. a4b6a43 should address the issue.