Garmin Connect Pro
The most comprehensive Garmin Connect skill for OpenClaw. Retrieve activities, health data, sleep analysis, heart rate, stress, body battery, training readiness, VO2 max, and more from your Fenix, Forerunner, Index scales, or other Garmin devices.
Security & Privacy
⚠️ Important Security Information:
Credential Options
Option 1: Environment Variables (Recommended for cron jobs)
export GARMIN_EMAIL="your-email@example.com"
export GARMIN_PASSWORD="your-password"
- - More secure for automated/scheduled usage
- Not stored on disk
- Works with cron jobs without leaving plaintext files
Option 2: Credentials File
mkdir -p ~/.config/garmin-connect
echo '{"email": "your-email@example.com", "password": "your-password"}' > ~/.config/garmin-connect/credentials.json
chmod 600 ~/.config/garmin-connect/credentials.json
- - Stored in plaintext (any process with file access can read it)
- File permissions set to 600 (owner read/write only)
- Consider excluding from backups
Third-Party Library
This skill uses the garminconnect Python library for all Garmin API communication.
- - Source code: https://github.com/cyberjunkie/garminconnect
- Trust boundary: All API calls go through this library
- Recommendation: Audit the library if you have strict security requirements
Data Flow
CODEBLOCK2
No data is transmitted to any third parties other than Garmin via the official garminconnect library.
Setup
First-time Login
CODEBLOCK3
Features
| Feature | Description |
|---|
| Natural Language Queries | "how did I sleep?", "what's my body battery?", "should I train today?" |
| ASCII Charts |
Visual trends for steps, HR, stress, battery |
|
Week-over-Week Comparison | Track progress vs last week |
|
Race Predictions | 5K, 10K, half marathon, marathon |
|
Body Composition | Weight, muscle mass, fat percentage |
|
VO2 Max Tracking | Cardio fitness from activities |
|
FIT/GPX Downloads | Export activity files |
|
Training Effect | Aerobic + anaerobic impact |
|
HR Zones per Activity | Time in each zone |
|
Emoji-Powered Output | Quick visual scanning |
Quick Start
CODEBLOCK4
Commands
Natural Language
CODEBLOCK5
Daily Metrics
CODEBLOCK6
Activities
CODEBLOCK7
Training & Performance
CODEBLOCK8
Trends
CODEBLOCK9
Example Output
Natural Language Response
CODEBLOCK10
Weekly Comparison
CODEBLOCK11
ASCII Chart
CODEBLOCK12
Cron Job Setup
⚠️ Security Note: Using environment variables is more secure than storing credentials on disk.
Option A: Environment Variables (Recommended)
CODEBLOCK13
Option B: Credentials File
CODEBLOCK14
Note: Cron jobs that run scripts with access to stored credentials increase the attack surface. Consider:
- - Using a dedicated Garmin account with limited permissions
- Using environment variables instead of credential files
- Running on a secure, isolated system
Data Available
| Category | Metrics |
|---|
| Activities | Name, type, duration, distance, calories, HR zones, training effect, elevation, splits, steps |
| Daily Stats |
Steps, distance, floors, calories (total/active/BMR), HR (resting/min/max), stress, body battery |
|
Sleep | Total, deep, light, REM, awake, sleep score |
|
Heart | Resting HR, min/max HR, HR zones, HRV (heart rate variability) |
|
Training | Readiness score, intensity minutes (moderate/vigorous), aerobic/anaerobic effect |
|
Body | Weight, muscle mass, fat percentage, BMI (with Index scale) |
|
Performance | VO2 max, race predictions (5K-marathon), FTP (cycling) |
|
Health | SpO2, respiration rate, hydration, stress timeline |
|
Devices | Fenix, Forerunner, Index scales, firmware, battery level |
JSON Output
Add --json to any command for scripting:
CODEBLOCK15
Requirements
- - Python 3.7+
- INLINECODE2 library (
pip install garminconnect) - Garmin Connect account with devices synced
Troubleshooting
"Authentication failed"
- - Verify email and password in credentials file or environment variables
- Delete tokens: INLINECODE4
- Re-run login
"No data for date"
- - Device may not have synced yet
- Sleep data appears after morning sync
- Some metrics (HRV, training readiness) require overnight processing
Rate Limits
- - Garmin may rate-limit excessive API calls
- Add delays between bulk requests
The Honest Truth
This won't make you fitter. But it will make it harder to ignore the data. Your Garmin already knows you skipped leg day—now OpenClaw can remind you too.
Want to be fit like @steipete? Well, now you can track every step of your journey—literally.
Garmin Connect Pro
针对OpenClaw最全面的Garmin Connect技能。从您的Fenix、Forerunner、Index体脂秤或其他Garmin设备中检索活动、健康数据、睡眠分析、心率、压力、身体电量、训练准备度、最大摄氧量等信息。
安全与隐私
⚠️ 重要安全信息:
凭证选项
选项1:环境变量(推荐用于定时任务)
bash
export GARMIN_EMAIL=your-email@example.com
export GARMIN_PASSWORD=your-password
- - 对于自动化/定时使用更安全
- 不存储在磁盘上
- 无需保留明文文件即可与定时任务配合使用
选项2:凭证文件
bash
mkdir -p ~/.config/garmin-connect
echo {email: your-email@example.com, password: your-password} > ~/.config/garmin-connect/credentials.json
chmod 600 ~/.config/garmin-connect/credentials.json
- - 以明文存储(任何具有文件访问权限的进程均可读取)
- 文件权限设置为600(仅所有者可读写)
- 建议排除在备份之外
第三方库
本技能使用garminconnect Python库进行所有Garmin API通信。
- - 源代码: https://github.com/cyberjunkie/garminconnect
- 信任边界: 所有API调用均通过此库进行
- 建议: 如有严格安全要求,请审计该库
数据流
您的凭证 → garminconnect库 → Garmin API服务器
↓
OAuth令牌本地缓存
除通过官方garminconnect库与Garmin通信外,不会向任何第三方传输数据。
设置
首次登录
bash
安装依赖
pip3 install garminconnect
选项A:使用环境变量(推荐)
export GARMIN_EMAIL=your-email@example.com
export GARMIN_PASSWORD=your-password
选项B:使用凭证文件
mkdir -p ~/.config/garmin-connect
echo {email: your-email@example.com, password: your-password} > ~/.config/garmin-connect/credentials.json
chmod 600 ~/.config/garmin-connect/credentials.json
登录(生成OAuth令牌)
python3 ~/.agents/skills/garmin-connect-pro/scripts/garmin.py login
功能
| 功能 | 描述 |
|---|
| 自然语言查询 | 我睡得怎么样?、我的身体电量是多少?、今天应该训练吗? |
| ASCII图表 |
步数、心率、压力、电量的可视化趋势 |
|
周环比比较 | 追踪与上周相比的进展 |
|
比赛预测 | 5公里、10公里、半程马拉松、全程马拉松 |
|
身体成分 | 体重、肌肉量、体脂率 |
|
最大摄氧量追踪 | 活动中的有氧适能 |
|
FIT/GPX下载 | 导出活动文件 |
|
训练效果 | 有氧+无氧影响 |
|
每项活动的心率区间 | 各区间时长 |
|
表情符号输出 | 快速视觉扫描 |
快速开始
bash
自然语言提问
python3 scripts/garmin.py ask 我睡得怎么样?
python3 scripts/garmin.py ask 我的训练准备度如何?
每日摘要
python3 scripts/garmin.py summary
带图表的趋势
python3 scripts/garmin.py trends --days 7
python3 scripts/garmin.py chart steps --days 14
周对比
python3 scripts/garmin.py compare
下载活动
python3 scripts/garmin.py download --id 123456 --format fit
命令
自然语言
bash
python3 scripts/garmin.py ask 我睡得怎么样?
python3 scripts/garmin.py ask 我压力大吗?
python3 scripts/garmin.py ask 今天走了多少步?
每日指标
bash
python3 scripts/garmin.py summary # 完整每日摘要
python3 scripts/garmin.py stats --today # 步数、心率、卡路里
python3 scripts/garmin.py sleep --today # 睡眠阶段
python3 scripts/garmin.py hr --today # 心率数据
python3 scripts/garmin.py hrv --today # 心率变异性
python3 scripts/garmin.py stress --today # 压力水平
python3 scripts/garmin.py body-battery --today # 能量水平
活动
bash
python3 scripts/garmin.py activities --limit 5
python3 scripts/garmin.py activity --id 123456 --full
python3 scripts/garmin.py download --id 123456 --format fit
训练与表现
bash
python3 scripts/garmin.py training --today # 准备度+强度
python3 scripts/garmin.py vo2max # 最大摄氧量+预测
python3 scripts/garmin.py body # 身体成分
python3 scripts/garmin.py race # 比赛预测
趋势
bash
python3 scripts/garmin.py week --days 7
python3 scripts/garmin.py trends --days 14
python3 scripts/garmin.py compare # 周与周对比
python3 scripts/garmin.py chart steps --days 30
示例输出
自然语言响应
🔋 身体电量:
当前:45%
⚠️ 中等水平 - 建议轻度活动
周对比
📊 本周与上周对比
─────────────────────────────────────────────────
指标 本周 上周 变化
─────────────────────────────────────────────────
步数 42,500 38,200 ↑ 11.3%
距离(公里) 35.2 28.9 ↑ 21.8%
卡路里 18,500 17,200 ↑ 7.6%
静息心率 56.0 57.5 ↓ 2.6%
ASCII图表
📈 步数 - 最近7天
──────────────────────────────────────────────
10000 │ █ █
8000 │ █ █ █ █
6000 │ █ █ █ █ █
4000 │ █ █ █ █ █ █
2000 │ █ █ █ █ █ █ █
0 └────────────────────────────────
周一 周二 周三 周四 周五 周六 周日
定时任务设置
⚠️ 安全提示: 使用环境变量比将凭证存储在磁盘上更安全。
选项A:环境变量(推荐)
bash
在您的crontab或OpenClaw定时任务配置中:
GARMIN
EMAIL=your-email@example.com GARMINPASSWORD=your-password python3 ~/.agents/skills/garmin-connect-pro/scripts/garmin.py summary
选项B:凭证文件
bash
早上6:30简报
openclaw cron add --name 晨间健身 --cron 30 6
* \
--message python3 ~/.agents/skills/garmin-connect-pro/scripts/garmin.py summary
中午12:00检查
openclaw cron add --name 午间检查 --cron 0 12
* \
--message python3 ~/.agents/skills/garmin-connect-pro/scripts/garmin.py ask 身体电量
晚上20:00总结
openclaw cron add --name 晚间总结 --cron 0 20
* \
--message python3 ~/.agents/skills/garmin-connect-pro/scripts/garmin.py week --days 1
注意: 运行可访问存储凭证的脚本的定时任务会增加攻击面。建议考虑:
- - 使用权限有限的专用Garmin账户
- 使用环境变量而非凭证文件
- 在安全的隔离系统上运行
可用数据
| 类别 | 指标 |
|---|
| 活动 | 名称、类型、时长、距离、卡路里、心率区间、训练效果、海拔、分段、步数 |
| 每日统计 |
步数、距离、楼层、卡路里(总计/活动/基础代谢率)、心率(静息/最低/最高)、压力、身体电量 |
|
睡眠 | 总计、深度、浅度、快速眼动、清醒、睡眠评分 |
|
心脏 |