whoop-connect
Connect your WHOOP band to OpenClaw so your agent can fetch your recovery, sleep, HRV, strain, and workout data.
Setup (once)
WHOOP does not have a public API. To access your own data, you need to register a personal developer app (free, takes 5 minutes). This gives you OAuth credentials so the skill can read your data on your behalf. All data stays local in ~/.whoop/whoop.db — nothing is uploaded anywhere.
- - Register at https://developer.whoop.com (sign in with your WHOOP account, create an app, get Client ID and Client Secret). Full walkthrough: INLINECODE1
- Set env vars:
WHOOP_CLIENT_ID, INLINECODE3 - First invocation auto-creates config and runs OAuth
When env vars are missing, explain to the user: "WHOOP requires a free developer account to access your data via API. It takes about 5 minutes — I can walk you through it step by step." Then follow {baseDir}/references/setup-guide.md.
If config missing: python3 {baseDir}/scripts/setup.py --init, then ask user's language and python3 {baseDir}/scripts/setup.py --set language=zh (or en).
If token missing: python3 {baseDir}/scripts/whoop_client.py auth.
If deps missing: bash {baseDir}/scripts/install.sh.
Common commands
- - Today's recovery: INLINECODE10
- Last night's sleep: INLINECODE11
- Recent workouts: INLINECODE12
- Weekly strain: INLINECODE13
- Multi-day summary: INLINECODE14
- Single metric history: INLINECODE15
- Profile: INLINECODE16
- Body measurements: INLINECODE17
- Force sync: INLINECODE18
- Start auto-sync daemon: INLINECODE19
- Single sync check: INLINECODE20
- Auto-sync with custom interval: INLINECODE21
Use --json for raw data when combining multiple queries. Use --days N to match user's time range ("this week" = 7, "this month" = 30).
Available metrics: recovery_score, hrv, resting_hr, spo2, skin_temp, strain, sleep_duration, sleep_efficiency, sleep_performance, INLINECODE33
Settings
- - Change setting: INLINECODE34
- Show config: INLINECODE35
- Re-run wizard: INLINECODE36
Keys: language (en/zh), detail_level (compact/detailed), units (metric/imperial), push_recovery, push_sleep, push_workout, webhook_enabled (bool), webhook_port (int), sync_interval (int, minutes — polling interval when webhook is off, default 5), sync_interval_webhook (int, minutes — fallback interval when webhook is on, default 20), daily_api_limit (int, default 10000)
Users may change settings in natural language (e.g. "switch to Chinese", "use detailed mode"). Map to --set accordingly.
Auto-sync
The skill supports automatic data syncing with adaptive intervals:
- - No webhook: polls WHOOP API every
sync_interval minutes (default 5) as the primary data source - Webhook enabled: webhook delivers real-time events; auto-sync polls every
sync_interval_webhook minutes (default 20) as fallback - Dedup: only new, scored records trigger notifications; already-seen data is silently skipped
- API guard: tracks daily API calls and pauses when
daily_api_limit (default 10,000) is reached - Start daemon: INLINECODE52
- Single check: INLINECODE53
Webhook (optional)
For real-time push, set up webhooks — see {baseDir}/references/setup-guide.md § "Optional: Webhook Setup". Set webhook_enabled=true in config. The webhook server writes a heartbeat file so auto-sync can detect if webhook is healthy and reduce polling frequency automatically.
Notes
- - Never fabricate health data. If a command returns empty or errors, say so.
- Never expose WHOOPCLIENTID, WHOOPCLIENTSECRET, or token contents in output.
- Never delete DB files or config without explicit user confirmation.
- Confirm before changing user settings.
- Respect
language and detail_level from config. - If WHOOP API returns 429, the client auto-retries. Do not flood.
Troubleshooting
- -
ModuleNotFoundError: INLINECODE59 - INLINECODE60 : check env vars
- INLINECODE61 : INLINECODE62
- INLINECODE63 : re-authorize with INLINECODE64
- INLINECODE65 : transient WHOOP-side issue, retry in a few minutes
- Empty results: widen
--days; data may not be scored yet
References
- -
{baseDir}/references/setup-guide.md — New user onboarding + webhook setup - INLINECODE68 — WHOOP API v2 field documentation
- INLINECODE69 — Webhook event types and payload format
- WHOOP Developer Docs: https://developer.whoop.com/docs/developing/user-data/recovery
- WHOOP API Reference: https://developer.whoop.com/api
whoop-connect
将您的WHOOP手环连接至OpenClaw,让您的智能体能够获取您的恢复、睡眠、心率变异性、负荷及锻炼数据。
初始设置(一次性操作)
WHOOP没有公开API。要访问您自己的数据,您需要注册一个个人开发者应用(免费,耗时5分钟)。这将为您提供OAuth凭证,使技能能够代表您读取数据。所有数据均保留在本地 ~/.whoop/whoop.db 中——不会上传至任何地方。
- - 在 https://developer.whoop.com 注册(使用您的WHOOP账户登录,创建应用,获取客户端ID和客户端密钥)。完整指南:{baseDir}/references/setup-guide.md
- 设置环境变量:WHOOPCLIENTID、WHOOPCLIENTSECRET
- 首次调用将自动创建配置并运行OAuth
当缺少环境变量时,向用户说明:WHOOP需要一个免费开发者账户才能通过API访问您的数据。大约需要5分钟——我可以逐步引导您完成。然后按照 {baseDir}/references/setup-guide.md 操作。
如果缺少配置:python3 {baseDir}/scripts/setup.py --init,然后询问用户语言并执行 python3 {baseDir}/scripts/setup.py --set language=zh(或 en)。
如果缺少令牌:python3 {baseDir}/scripts/whoop_client.py auth。
如果缺少依赖:bash {baseDir}/scripts/install.sh。
常用命令
- - 今日恢复:python3 {baseDir}/scripts/whoopclient.py recovery --days 1
- 昨晚睡眠:python3 {baseDir}/scripts/whoopclient.py sleep --days 1
- 近期锻炼:python3 {baseDir}/scripts/whoopclient.py workout --days 7
- 周负荷:python3 {baseDir}/scripts/whoopclient.py cycle --days 7
- 多日摘要:python3 {baseDir}/scripts/whoopclient.py trends --days 7
- 单一指标历史:python3 {baseDir}/scripts/db.py trends --metric <名称> --days N
- 个人资料:python3 {baseDir}/scripts/whoopclient.py profile
- 身体测量:python3 {baseDir}/scripts/whoopclient.py body
- 强制同步:python3 {baseDir}/scripts/dailysync.py --days 2
- 启动自动同步守护进程:python3 {baseDir}/scripts/autosync.py
- 单次同步检查:python3 {baseDir}/scripts/autosync.py --once
- 自定义间隔自动同步:python3 {baseDir}/scripts/auto_sync.py --interval 10
在组合多个查询时使用 --json 获取原始数据。使用 --days N 匹配用户的时间范围(本周=7,本月=30)。
可用指标
recoveryscore、hrv、restinghr、spo2、skintemp、strain、sleepduration、sleepefficiency、sleepperformance、respiratory_rate
设置
- - 更改设置:python3 {baseDir}/scripts/setup.py --set <键>=<值>
- 显示配置:python3 {baseDir}/scripts/setup.py --show
- 重新运行向导:python3 {baseDir}/scripts/setup.py
键:language(en/zh)、detaillevel(compact/detailed)、units(metric/imperial)、pushrecovery、pushsleep、pushworkout、webhookenabled(布尔值)、webhookport(整数)、syncinterval(整数,分钟——关闭webhook时的轮询间隔,默认5)、syncintervalwebhook(整数,分钟——开启webhook时的备用间隔,默认20)、dailyapi_limit(整数,默认10000)
用户可以用自然语言更改设置(例如切换为中文、使用详细模式)。相应地映射到 --set。
自动同步
该技能支持自适应间隔的自动数据同步:
- - 无webhook:每 syncinterval 分钟(默认5)轮询WHOOP API作为主要数据源
- 启用webhook:webhook传递实时事件;自动同步每 syncintervalwebhook 分钟(默认20)轮询作为备用
- 去重:仅新的、已评分的记录触发通知;已见过的数据静默跳过
- API保护:跟踪每日API调用,达到 dailyapilimit(默认10,000)时暂停
- 启动守护进程:python3 {baseDir}/scripts/autosync.py
- 单次检查:python3 {baseDir}/scripts/auto_sync.py --once
Webhook(可选)
如需实时推送,请设置webhook——参见 {baseDir}/references/setup-guide.md § 可选:Webhook设置。在配置中设置 webhook_enabled=true。webhook服务器会写入心跳文件,以便自动同步检测webhook是否健康并自动降低轮询频率。
注意事项
- - 切勿编造健康数据。如果命令返回空结果或错误,请如实说明。
- 切勿在输出中暴露 WHOOPCLIENTID、WHOOPCLIENTSECRET 或令牌内容。
- 未经用户明确确认,切勿删除数据库文件或配置。
- 更改用户设置前需确认。
- 遵守配置中的 language 和 detail_level。
- 如果WHOOP API返回429,客户端会自动重试。请勿频繁请求。
故障排除
- - ModuleNotFoundError:bash {baseDir}/scripts/install.sh
- WHOOPCLIENTID must be set:检查环境变量
- No refresh token:python3 {baseDir}/scripts/whoop_client.py auth
- 401 Unauthorized:使用 auth 重新授权
- 500 Server Error:WHOOP端临时问题,几分钟后重试
- 空结果:扩大 --days 范围;数据可能尚未评分
参考资料
- - {baseDir}/references/setup-guide.md — 新用户引导 + webhook设置
- {baseDir}/references/api-reference.md — WHOOP API v2字段文档
- {baseDir}/references/webhook-events.md — Webhook事件类型和负载格式
- WHOOP开发者文档:https://developer.whoop.com/docs/developing/user-data/recovery
- WHOOP API参考:https://developer.whoop.com/api