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.
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
#9
RE: Garmin O2 oximetry import to Oscar
I'd love to see this too. I recently upgraded from a Garmin Vivosmart 4 to a Fenix 6. As well as the Sp02, movement etc I now see a calculated Sleep Score. Sleep Score should be visible on all Garmin watches that have the Respiration feature. It combines all the other readings and calculates a score out of 100. In the same way the Body Battery does. Picture attached.

Garmin do provide API access for commercial entities. I applied as a private individual but was knocked back as they wanted to see evidence of commercial activity, website, privacy policy. I gave up at that point.

I dabbled with a couple of the unofficial connectors but didn't manage to get properly into it due to work / babies / chronic lack of sleep...


Attached Files Thumbnail(s)
   
Post Reply Post Reply
#10
RE: Garmin O2 oximetry import to Oscar
How does the Garmin store the data? If locally to your PC or phone, is it in a binary file for each session or is it in a database (.db file type)?
Crimson Nape
Apnea Board Moderator
www.ApneaBoard.com
___________________________________
Useful Links -or- When All Else Fails:
The Guide to Understanding OSCAR
OSCAR Chart Organization
Attaching Images and Files on Apnea Board
Apnea Helpful Tips

INFORMATION ON APNEA BOARD FORUMS OR ON APNEABOARD.COM SHOULD NOT BE CONSIDERED AS MEDICAL ADVICE. ALWAYS SEEK THE ADVICE OF A PHYSICIAN BEFORE SEEKING TREATMENT FOR MEDICAL CONDITIONS, INCLUDING SLEEP APNEA. INFORMATION POSTED ON THE APNEA BOARD WEB SITE AND FORUMS ARE PERSONAL OPINION ONLY AND NOT NECESSARILY A STATEMENT OF FACT.
Post Reply Post Reply






Donate to Apnea Board  


Possibly Related Threads...
Thread Author Replies Views Last Post
  Import to OSCAR from EncorePro2 or EncoreBasic or INFINEER smartcard reader. KeepSmiling 3 72 09-13-2022, 12:36 PM
Last Post: KeepSmiling
  [OSCAR] new user, no import from SD card La DuF 6 202 08-25-2022, 05:40 AM
Last Post: La DuF
  Pulse Ox Import Into OSCAR boxofrain 5 274 07-16-2022, 06:10 PM
Last Post: Jeff8356
  RamboAB - Wellue Import Problems RamboAB 29 687 06-12-2022, 12:19 PM
Last Post: RamboAB
  Can't import data to Oscar bobharford 4 346 06-10-2022, 12:25 PM
Last Post: SuperSleeper
Angry BMC REsmart Software - Cannot import SD card zipperjones 6 2,198 05-14-2022, 02:03 AM
Last Post: return
  Wellue O2Ring - import data to Oscar? Steve320 44 2,517 05-10-2022, 04:29 PM
Last Post: Sleepy Willy


New Posts   Today's Posts






About Apnea Board

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