Garmin-Grafana
This directory contains the configuration for a set of services that fetches data from Garmin Connect, stores it in InfluxDB, and visualizes it with Grafana.
Services
- garmin-fetch-data: A service that fetches data from Garmin Connect.
- influxdb: An InfluxDB database for storing Garmin Connect data.
- grafana: A Grafana instance for visualizing the data.
How to start
- Create a
.envfile based on the.env.examplefile. - Set the
GARMINCONNECT_EMAILandGARMINCONNECT_PASSWORD(Base64 encoded) variables in the.envfile. - If you have 2FA enabled: You must authenticate manually once to generate the session tokens.
Enter your 2FA code when prompted. The tokens will be saved to the
docker-compose run --rm garmin-fetch-datagarminconnect_tokensvolume. - Run
docker-compose up -dto start the application.
Setup & Access
After starting the application, you can access the Grafana web interface at http://localhost:3000.
- User:
admin - Password:
admin
Configure a new data source for InfluxDB (URL: http://influxdb:8086, Database: GarminStats) and import the dashboards.
Historical Data Download (Bulk Import)
To download old history, use the MANUAL_START_DATE variable. This will fetch data in reverse chronological order from the current date (or MANUAL_END_DATE) back to the start date.
docker-compose run --rm -e MANUAL_START_DATE=YYYY-MM-DD garmin-fetch-data
Options:
MANUAL_END_DATE=YYYY-MM-DD: Optional end date (defaults to today).FETCH_SELECTION=...: Limit what data is fetched (e.g.,activity,sleep).
Note: Garmin archives intraday data older than 6 months, so very old detailed data (HR, sleep stages) might be missing unless manually refreshed in the Garmin Connect app.