返回顶部
g

garmin-connect

Garmin Connect integration for Clawdbot: sync fitness data (steps, HR, calories, workouts, sleep) every 5 minutes using OAuth.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
2,181
下载量
5
收藏
概述
安装方式
版本历史

garmin-connect

# Garmin Connect Skill Sync all your Garmin fitness data to Clawdbot: - 🚶 **Daily Activity**: Steps, heart rate, calories, active minutes, distance - 😴 **Sleep**: Duration, quality, deep/REM/light sleep breakdown - 🏋️ **Workouts**: Recent activities with distance, duration, calories, heart rate - ⏱️ **Real-time sync**: Every 5 minutes via cron ## Quick Start ### 1. Install Dependencies ```bash pip install -r requirements.txt ``` ### 2. OAuth Authentication (One-time) ```bash 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 ```bash python3 scripts/garmin-sync.py ``` You should see JSON output with today's stats. ### 4. Set Up 5-Minute Cron Add to your crontab: ```bash */5 * * * * /home/user/garmin-connect-clawdbot/scripts/garmin-cron.sh ``` Or manually: ```bash */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: ```python from scripts.garmin_formatter import format_all, get_as_dict # Get all formatted data print(format_all()) # Or get raw dict data = get_as_dict() print(f"Steps today: {data['summary']['steps']}") ``` ## Features ✅ OAuth-based (secure, no password storage) ✅ All metrics: activity, sleep, workouts ✅ Local caching (fast access) ✅ Cron-friendly (5-minute intervals) ✅ Easy Clawdbot integration ✅ Multi-user support ## Data Captured ### Daily Activity (`summary`) - `steps`: Daily step count - `heart_rate_resting`: Resting heart rate (bpm) - `calories`: Total calories burned - `active_minutes`: Intensity minutes - `distance_km`: Distance traveled ### Sleep (`sleep`) - `duration_hours`: Total sleep time - `duration_minutes`: Sleep in minutes - `quality_percent`: Sleep quality score (0-100) - `deep_sleep_hours`: Deep sleep duration - `rem_sleep_hours`: REM sleep duration - `light_sleep_hours`: Light sleep duration - `awake_minutes`: Time awake during sleep ### Workouts (`workouts`) For each recent workout: - `type`: Activity type (Running, Cycling, etc.) - `name`: Activity name - `distance_km`: Distance traveled - `duration_minutes`: Duration of activity - `calories`: Calories burned - `heart_rate_avg`: Average heart rate - `heart_rate_max`: Max heart rate ## Cache Location By default, data is cached at: `~/.clawdbot/.garmin-cache.json` Customize with: ```bash python3 scripts/garmin-sync.py /custom/path/cache.json ``` ## Files | File | Purpose | |------|---------| | `garmin-auth.py` | OAuth setup (run once) | | `garmin-sync.py` | Main sync logic (run every 5 min) | | `garmin-formatter.py` | Format data for display | | `garmin-cron.sh` | Cron wrapper script | | `requirements.txt` | Python dependencies | ## Troubleshooting ### OAuth authentication fails - Check email/password - Disable 2FA on Garmin account (or use app password) - Garmin servers might be rate-limiting — wait 5 minutes ### 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 ```bash 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: ```bash python3 scripts/garmin-sync.py ``` ## Usage Examples ```python from scripts.garmin_formatter import format_all, get_as_dict # Get formatted output print(format_all()) # Get raw data data = get_as_dict() if data: print(f"Sleep: {data['sleep']['duration_hours']}h") print(f"Steps: {data['summary']['steps']:,}") ``` ## License MIT — Use, fork, modify freely. --- Made for [Clawdbot](https://clawd.bot) | Available on [ClawdHub](https://clawdhub.com)

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 garmin-connect-1775972582 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 garmin-connect-1775972582 技能

通过命令行安装

skillhub install garmin-connect-1775972582

下载 Zip 包

⬇ 下载 garmin-connect v1.0.0

文件大小: 10.91 KB | 发布时间: 2026-4-13 10:24

v1.0.0 最新 2026-4-13 10:24
Garmin Connect Skill 1.0.0 – initial release

- Integrates Garmin Connect with Clawdbot for seamless fitness data sync.
- Syncs daily activity, sleep, and workout metrics every 5 minutes via OAuth.
- Features easy setup, local caching, cron support, and multi-user capability.
- Provides scripts and Python API for accessing and formatting fitness data.
- Detailed documentation for installation, usage, and troubleshooting included.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部