Files
garmin-activity-loader/README.md
T
tkl f40dd26283 initial commit
Signed-off-by: Thomas Klaehn <tkl@blackfinn.de>
2026-11-02 10:17:43 +01:00

43 lines
1.7 KiB
Markdown

# Garmin Activity Loader
Downloads all Garmin Connect activities (original files, full history on the
first run, then new ones every 5 minutes) and hands the FIT files of selected
activity types to fit-monitor.
Uses the unofficial Garmin Connect login via
[garminconnect](https://github.com/cyberjunky/python-garminconnect); Garmin
changes its login now and then, so a library update may be needed when it
stops working.
## Data layout (`/srv/garmin-activity-loader/data`)
| Path | Content |
|-----------------------|------------------------------------------------------|
| `archive/<typeKey>/` | every activity, `<id>_<date>_<name>.fit` |
| `import/<typeKey>/` | hard links to the FIT files of the selected types; mounted into fit-monitor as `/data/garmin` |
| `garmin-state.json` | downloaded activities, failed downloads, import progress |
| `.garminconnect/` | login tokens |
## Activity type switch
`GARMIN_IMPORT_TYPES` in `.env` is a comma-separated list of Garmin type keys.
A parent key includes its sub types (`cycling` covers `road_biking`,
`virtual_ride`, …). Empty means archive only. List the keys, with `*` marking
the currently selected ones:
```sh
docker compose run --rm garmin-activity-loader types
```
After changing the switch, restart the container; `import/` is updated on the
next cycle. Removing a type only removes its links, activities fit-monitor has
already imported stay in the database.
## Setup
```sh
cp .env.example .env # fill in credentials and GARMIN_IMPORT_TYPES
docker compose run --rm garmin-activity-loader login # asks for the MFA code if needed
docker compose up -d
```