Apnea Board Forum - CPAP | Sleep Apnea
OSCAR: Questions regarding a potential import for Garmin data - Printable Version

+- Apnea Board Forum - CPAP | Sleep Apnea (https://www.apneaboard.com/forums)
+-- Forum: Public Area (https://www.apneaboard.com/forums/Forum-Public-Area)
+--- Forum: Software Support Forum (https://www.apneaboard.com/forums/Forum-Software-Support-Forum)
+--- Thread: OSCAR: Questions regarding a potential import for Garmin data (/Thread-OSCAR-Questions-regarding-a-potential-import-for-Garmin-data)



OSCAR: Questions regarding a potential import for Garmin data - littleyoda - 10-19-2024

Hi

I am currently considering writing an importer for data from Garmin devices into OSCAR.

In the first development step, I would get the data from Garmin Connect as a JSON file via a Python script and an importer integrated into OSCAR would import the JSON file.
Later, the data could then be downloaded from Garmin Connect directly from within OSCAR.

After looking through the source code a bit, I have a few questions.

1) When checking the ChannelID, I found the following existing channels that are relevant for Garmin devices:
OXI_Pulse, OXI_SPO2
Journal_Weight
ZEO_SleepStage, ZEO_ZQ, ZEO_TotalZ, ZEO_TimeInWake, ZEO_TimeInREM,
ZEO_TimeInLight, ZEO_TimeInDeep, ZEO_Awakenings,
POS_Movement

The loader_plugin only implements one MachineType at a time. But I had ChannelID from different MachineType.

What is the best way to deal with an import that imports a wide range of channels?
If I see it right, no import supports this scope so far.

2) The data is provided in different frequencies.
While measurement values for pulse are available every 2 minutes, time frames are always given for the sleep level, which can sometimes be 1 1/2 hours long.
Can the data structures in OSCAR handle this if the measured values are available in different time intervals and types (measured values at time X vs. time ranges).?

3) Some Garmin data is only available for the sleep time (sleep level) while others are available for the whole day (pulse).
A few tests with CVS files showed that it can lead to strange effects when measurements are suddenly available for the whole day. My guess is that OSCAR is actually designed so that only measurements for the sleep time should be imported.
What would you recommend? Is there a way to determine the sleep time based on the CPAP so that I don't import the pulse outside of these times, for example?


I think that's enough questions for the first round.
 

lg


RE: OSCAR: Questions regarding a potential import for Garmin data - Crimson Nape - 10-19-2024

#1. I believe you would need to create the additional channel declarations to address this.
#2. & #3. If each observation is timestamped, then it would be easy to parse the data to compare against a sleep session. Otherwise, that could be a biddy.

Have you looked at the Somnopose loader? It parses a CSV file.
- Red


RE: OSCAR: Questions regarding a potential import for Garmin data - littleyoda - 10-19-2024

(10-19-2024, 10:03 AM)Crimson Nape Wrote: Have you looked at the Somnopose loader?  It parses a CSV file.
- Red

yes, I have look on different loaders. I had already written a Python program that transforms the garmin data into Zeo and md300w1/somnopose files. But handling so many files is no fun.
And in the end, every file format had its limitations and problems.

My main "concerns" are that each loader only supports one machine type and I am not sure what role the machine types play in OSCAR or how I can implement a loader that would fill so many channels over different machine types.

I hope that one of the developers can say something about this.


RE: OSCAR: Questions regarding a potential import for Garmin data - bedeee - 12-14-2024

any progress on the Garmin import?

I've been experimenting with getting the data from the garmin api too ... didn't get far on the formatting in e.g. .csv yet...


RE: OSCAR: Questions regarding a potential import for Garmin data - littleyoda - 12-14-2024

[I'm not allowed to post links]
Hi

I have a working fork of Oscar where you can import Garmin data.
Currently you have to run a Python programme which generates data and which you can later import into OSCAR.

github.com/littleyoda/oscar/tree/garmin

And the issue in the gitlab repository:
gitlab.com/CrimsonNape/OSCAR-code/-/issues/5

As the approach works for me and no one has shown any further interest so far, I have not developed it any further.
I'm not sure if I really want to port relevant parts of the Python garmin connect library[/url] to C++.


Attached an example with movement and stress level from a garmin watch.


RE: OSCAR: Questions regarding a potential import for Garmin data - bedeee - 12-15-2024

I'm impressed!