π¦ ClawHub
Lovefromio Garmin Connect
by @lovefromio
Garmin Connect integration for Clawdbot: sync fitness data (steps, HR, calories, workouts, sleep) every 5 minutes using OAuth.
π‘ Examples
1. Install Dependencies
pip install -r requirements.txt
2. OAuth Authentication (One-time)
python3 scripts/garmin-auth.py your-email@gmail.com your-password
This saves your OAuth session to ~/.garth/session.json β fully local and secure.
3. Test Sync
python3 scripts/garmin-sync.py
You should see JSON output with today's stats.
4. Set Up 5-Minute Cron
Add to your crontab:
*/5 * * * * /home/user/garmin-connect-clawdbot/scripts/garmin-cron.sh
Or manually:
*/5 * * * * python3 /home/user/garmin-connect-clawdbot/scripts/garmin-sync.py ~/.clawdbot/.garmin-cache.json
5. Use in Clawdbot
Import and use in your scripts:
from scripts.garmin_formatter import format_all, get_as_dictGet all formatted data
print(format_all())Or get raw dict
data = get_as_dict()
print(f"Steps today: {data['summary']['steps']}")
π Tips & Best Practices
OAuth authentication fails
No data appears
1. Sync your Garmin device with the Garmin Connect app
2. Wait 2-3 minutes for data to sync
3. Check that data appears in Garmin Connect web/app
4. Then run garmin-sync.py again
Permission denied on cron
chmod +x scripts/garmin-cron.sh
chmod +x scripts/garmin-sync.py
chmod +x scripts/garmin-auth.py
Cache file not found
Run garmin-sync.py at least once to create cache:
python3 scripts/garmin-sync.py
TERMINAL
clawhub install lovefromio-garmin-connect