Hello Guest, Welcome to Apnea Board !
As a guest, you are limited to certain areas of the board and there are some features you can't use.
To post a message, you must create a free account using a valid email address.

or Create an Account


New Posts   Today's Posts

Garmin O2 oximetry import to Oscar
#1
Smile 
Garmin O2 oximetry import to Oscar
I'm happy with Oscar. However, it would be nice to import my oximetry sleep data as well, I have about a year of data. I can transform the data, but I don't know the format Oscar needs it. Now I have the data in one file per day in json format, the files look something like example below 20210318.json:

{
  "dailySleepDTO": {
    "_comment": "a lot of stuff removed here",
    "calendarDate": "2021-03-18",
    "sleepTimeSeconds": 28080,
    "sleepStartTimestampGMT": 1616015220000,
    "sleepEndTimestampGMT": 1616044020000,
    "sleepStartTimestampLocal": 1616022420000,
    "sleepEndTimestampLocal": 1616051220000,
    "deepSleepSeconds": 1260,
    "lightSleepSeconds": 19260,
    "remSleepSeconds": 7560,
    "awakeSleepSeconds": 720,
    "averageSpO2Value": 90,
    "lowestSpO2Value": 82,
    "highestSpO2Value": 100,
    "averageSpO2HRSleep": 55,
    "averageRespirationValue": 16,
    "lowestRespirationValue": 11,
    "highestRespirationValue": 21
  },
  "sleepMovement": [
    {
      "_comment": "a lot of stuff removed here",
    }
  ],
  "wellnessSpO2SleepSummaryDTO": {
    "userProfilePk": 00,
    "deviceId": 0000,
    "sleepMeasurementStartGMT": "2021-03-17T21:08:00.0",
    "sleepMeasurementEndGMT": "2021-03-18T05:06:00.0",
    "alertThresholdValue": null,
    "numberOfEventsBelowThreshold": null,
    "durationOfEventsBelowThreshold": null,
    "averageSPO2": 90,
    "averageSpO2HR": 55,
    "lowestSPO2": 82
  },
  "wellnessEpochSPO2DataDTOList": [
    {
      "userProfilePK": 00,
      "epochTimestamp": "2021-03-17T21:09:00.0",
      "deviceId": 0000,
      "calendarDate": "2021-03-17",
      "epochDuration": 60,
      "spo2Reading": 84,
      "readingConfidence": 2,
      "spo2Mode": null
    },
    {
      "userProfilePK": 00,
      "epochTimestamp": "2021-03-17T21:10:00.0",
      "deviceId": 0000,
      "calendarDate": "2021-03-17",
      "epochDuration": 60,
      "spo2Reading": 84,
      "readingConfidence": 2,
      "spo2Mode": null
    },
      
    ...
      
    {
      "userProfilePK": 00,
      "epochTimestamp": "2021-03-18T05:01:00.0",
      "deviceId": 0000,
      "calendarDate": "2021-03-18",
      "epochDuration": 60,
      "spo2Reading": 90,
      "readingConfidence": 13,
      "spo2Mode": null
    },
    {
      "userProfilePK": 00,
      "epochTimestamp": "2021-03-18T05:06:00.0",
      "deviceId": 0000,
      "calendarDate": "2021-03-18",
      "epochDuration": 60,
      "spo2Reading": 90,
      "readingConfidence": 11,
      "spo2Mode": null
    }
  ],
  "wellnessEpochRespirationDataDTOList": [
     ... removed a lot of data
  ],
  "sleepStress": [
     ... removed a lot of data
  ]
}
Post Reply Post Reply






Donate to Apnea Board  
#2
RE: Garmin O2 oximetry import to Oscar
Hi,

Nothing to do with your question, but data are recorded in which time interval?
Is there a mode to have more records?

thanks.
Post Reply Post Reply
#3
RE: Garmin O2 oximetry import to Oscar
The data looks like 1 minute samples. Average SpO2 of 90% seems pretty low - is this accurate/normal for you?

Currently there is no way to import this SpO2 data in to OSCAR. You could potentially convert it in to a format that OSCAR recognises such as the Viatom file format (which has 4 second samples). I don't know how useful 1 minute samples are but I guess it's better than nothing. We could potentially create a new importer for smart watch type data - could pull sleep stage, movement, HR and SpO2 data.

What mechanism have you used to get this json data from Garmin? I've done a bit of data extract from Garmin by means of downloading daily zip files using "Export Original" from the daily summary on connect.garmin and then extracting historical heart rate data from the .fit files. It's a bit clunky so a cleaner approach would be useful.

[Edit: looks like your data is coming from connect.garmin via /modern/proxy/wellness-service/wellness/dailySleepData/<user>?date=YYYY-MM-DD or similar?]
Post Reply Post Reply
#4
RE: Garmin O2 oximetry import to Oscar
Data is recorded once a minute, usually there are some slots missing in the data when e.g. the clock could not read the data for 20 min. It is always one minute, but today I guess a software update could change that any time.
For me 90% is about average for a night, seems to be 88-93 average per night. We should not trust too much the exact numbers but the trend seems to be trustable.
I used garmin-connect from github, it works fine but you need coding experience to use it (this package use connect.garmin as you suggested). I agree that the .fit file handling wasn't that fun so I tried this other way.
It would be great to be able to import those data you suggest directly to Oscar, we will definitely see more smart watches in the future.
I looked the web for the Viatom file format, some example files, but didn't find any, is there some good place to dig into that?
Post Reply Post Reply






Donate to Apnea Board  
#5
RE: Garmin O2 oximetry import to Oscar
The OSCAR code for the viatom loader is here:
https://gitlab.com/pholy/OSCAR-code/-/bl...loader.cpp
Post Reply Post Reply
#6
RE: Garmin O2 oximetry import to Oscar
Can someone create the Oscar software as an apps and that it can have bluetooth connection to our cpap machines. So we don't have to pull out the simcard daily just to check how we are doing, Thanks
Post Reply Post Reply
#7
RE: Garmin O2 oximetry import to Oscar
(05-25-2021, 07:20 AM)Daniel Goh Wrote: Can someone create the Oscar software as an apps and that it can have bluetooth connection to our cpap machines. So we don't have to pull out the simcard daily just to check how we are doing, Thanks

There's no way to do this, currently. AFAIK. The internal modem doesn't allow end user access (assuming one is present as in the Resmed 10).

You CAN set up a way around that, using a Toshiba FlashAir wifi-enabled SDCard - but these are no longer manufactured and tend to go for excessively high prices now. I was very lucky to find an unused but opened one for almost the same as it would have initially cost, but that's the exception, not the rule). Once you have that configured correctly, you can copy the data from your machine to your computer where you run OSCAR without having to remove the card every day.  

The main thread is quite long but all the info you need, if you go that route, is right HERE.


See my comparison of Viatom/Wellue and CMS50F oximeters here.

Not a doctor, definitely not your doctor, all advice is given as-is and represents simply my own understanding as a fellow patient and OSCAR user.
Post Reply Post Reply






Donate to Apnea Board  
#8
RE: Garmin O2 oximetry import to Oscar
Thanks you so much for the quick response. I shall try it if it work. I am using Phillip dream station. a big big thanks you
Post Reply Post Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Wellue O2Ring - import data to Oscar? Steve320 29 425 09-22-2021, 03:47 AM
Last Post: dolceitalia
  CMS50D+ import issues moarZs 11 276 09-20-2021, 02:10 PM
Last Post: Crimson Nape
  Hard Crash on import - OS X Catalina beta Patriceg 6 608 08-30-2021, 11:05 AM
Last Post: sawinglogz
  Viatom Data import Oscar Error lvmickey 9 291 08-29-2021, 05:24 AM
Last Post: lvmickey
  OSCAR crashes when setting time for oximeter import larch 0 138 08-28-2021, 11:06 AM
Last Post: larch
Angry BMC REsmart Software - Cannot import SD card zipperjones 3 619 08-20-2021, 03:47 PM
Last Post: WHB74
  New Oscar User - Can't Import RobertR 8 198 08-09-2021, 03:56 PM
Last Post: RobertR


New Posts   Today's Posts






About Apnea Board

Apnea Board is an educational web site designed to empower Sleep Apnea patients.