Sends Withings weight (with body composition) and blood pressure to Garmin Connect, adding only what Garmin doesn't already have. No server and no database: it runs, syncs, and exits.
- Checks each reading against Garmin by time. A weigh-in or blood pressure reading counts as already there when Garmin has one within 2 minutes of the Withings timestamp. Weight and blood pressure are checked separately, so a missing one is sent on its own.
- Weight with body composition: body fat %, body water % (Withings reports kilograms; this converts it), bone mass and muscle mass. Blood pressure with pulse.
- Same file format as the Withings Sync Raycast extension (a FIT weight
file via
@markw65/fit-file-writer), uploaded with the Garmin sign-in that hevy-sync already holds, so there's no separate Garmin password. - Won't double-send while Garmin processes uploads: an upload is remembered
for a day in
data/ledger.json.
On the garmin-dashboard server
(CT 208) at /opt/withings-sync, deployed by garmin-dashboard's
server/deploy.sh. Every refresh there runs it after the Hevy sync and before
the Garmin pull (last 30 days): at 7:00 and 19:00, and when you press Refresh or use the
Raycast commands.
Run it in one place only: Withings replaces the refresh token on every renewal, so two copies of the sign-in would knock each other out.
Keep the single quotes; they stop your Mac's shell from eating the inner ones.
ssh -t pve 'pct exec 208 -- docker exec -it garmin-worker sh -c "cd /app/withings-sync && node sync.mjs status"'
ssh -t pve 'pct exec 208 -- docker exec -it garmin-worker sh -c "cd /app/withings-sync && node sync.mjs check"'
ssh -t pve 'pct exec 208 -- docker exec -it garmin-worker sh -c "cd /app/withings-sync && node sync.mjs preview --all"'
ssh -t pve 'pct exec 208 -- docker exec -it garmin-worker sh -c "cd /app/withings-sync && node sync.mjs login"'preview and sync take a range: --days N (default 30), --since YYYY-MM-DD
or --all.
.env.localwith your Withings app's credentials (developer.withings.com; the same app the Raycast extension uses):Optional:WITHINGS_CLIENT_ID=... WITHINGS_CLIENT_SECRET=...WITHINGS_REDIRECT_URI(defaulthttps://raycast.com/redirect?packageName=Extension, already registered on that app) andGARMIN_TOKENS_DIR(default../hevy-sync/data/garmin).- Deploy: garmin-dashboard's
server/deploy.sh --data withings-sync, then delete.env.localhere. - Sign in on the server with the
logincommand above. It prints a Withings link; approve, then paste the address you land on. Withings only accepts it for 30 seconds, so paste straight away. preview --allto see what's missing, thensync --allonce to fill gaps.
If Withings rejects the client ID or secret, the secret was renewed on
developer.withings.com (signing in again won't fix it). Put the current secret
in .env.local here, run server/deploy.sh --data withings-sync again, delete
.env.local, then sign in.
| File | What it does |
|---|---|
sync.mjs |
The commands: login, check, preview, sync, status |
sync.sh |
Runs a sync and logs to data/sync.log (what the server runs) |
data/withings_tokens.json |
Withings sign-in (git-ignored, owner-only) |
data/ledger.json |
What was uploaded and when |
data/status.json |
Outcome of the last sync, read by garmin-dashboard for its warnings |
data/blood_pressure.json |
Every Withings blood pressure reading, for garmin-dashboard's chart (Garmin's Personal API has none) |
.env.local and data/ are git-ignored and live on CT 208 only.