/garminspo2applehealth

Garmin Connect SpO2 data to Apple Health import.

Primary LanguagePython

Garmin SpO2 to Apple Health

For some reason, Garmin Connect on iOS doesn't sync Blood Oxygen (SpO2) data into Apple Health despite syncing various other metrics perfectly fine already.

There's a feature request in their forums from February 2021, but apart from "We've added this to our feature request list" nothing came of it in the past 11 months. And I found similar requests as old as over 4 years (June 2018).

Until Garmin finds the 5 minutes to implement this feature, I've resorted to use the wonderful garminconnect Python-library to download my SpO2 data, a PHP script to serve the data from the last 2 days as JSON and an iOS Shortcut to sync that to Apple Health.

While it's not the most elegant solution, it works.

Usage

  1. Copy auth.py.example to auth.py and edit it to specify your Garmin Connect credentials
  2. Copy spo2_empty.db3 to spo2.db3
  3. Run pipenv install to install dependencies
  4. Make a cronjob running pipenv run ./fetch.py regularly
  5. Copy the script from the php folder to a webserver and edit the file to point to the SQLite database file.
  6. Install the SpO2 Inserter Shortcut on your iPhone and point it to the PHP script.
  7. Optional: Create an Automation in Shortcuts to run this automatically.