360 Secure SkillHub
360 安全技能中心

Withings (Official API)

这是OpenClaw的数据源技能,核心功能为通过OAuth关联个人Withings账号,本地存储并刷新令牌,可获取体重、体脂、血压、心率等健康指标及睡眠摘要,支持按指定时区获取今日/昨日数据,将数据标准化为符合Wellness hub要求的JSON格式,也可生成markdown消息。需配置必要环境变量,通过脚本完成授权、数据拉取与标准化。

gavinchengcool
gavinchengcool
热度 57.56
最近更新 2026-05-11 17:31:16
分类:生活依赖:代码执行 / 读写文件 / 第三方 API应用场景:健康 / 数据处理 / 自动化脚本

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add openclaw-withings
Metadata
name
openclaw-withings
description
Official Withings OAuth integration for OpenClaw. Use to connect/authorize a personal Withings account, store+refresh tokens locally, and fetch health measurements (weight, body fat, blood pressure, heart rate) plus sleep summaries where available. Supports today/yesterday by timezone and produces normalized daily JSON for the Wellness hub.

Withings (Official API)

This is a source skill. It connects to Withings, fetches data, normalizes it, and renders a short message. Delivery is channel-agnostic.

Configuration

Required env vars:

  • WITHINGS_CLIENT_ID
  • WITHINGS_CLIENT_SECRET
  • WITHINGS_REDIRECT_URI

Optional:

  • WITHINGS_TOKEN_PATH (default: ~/.config/openclaw/withings/token.json)
  • WITHINGS_TZ (default: Asia/Shanghai)
  • WITHINGS_SCOPES (default: user.metrics user.activity)

Connect (OAuth)

Choose one mode:

  • Phone/remote mode (recommended):
python3 scripts/withings_oauth_login.py
  • Desktop loopback mode (optional): if you are authorizing in a browser on the same machine that runs OpenClaw and WITHINGS_REDIRECT_URI is a loopback URL like http://127.0.0.1:58539/callback:
python3 scripts/withings_oauth_login.py --loopback

Fetch + normalize for a day

python3 scripts/withings_fetch_daily.py --date today --out /tmp/withings_raw_today.json
python3 scripts/withings_normalize_daily.py /tmp/withings_raw_today.json --out /tmp/withings_today.json
python3 scripts/withings_render.py /tmp/withings_today.json --format markdown --channel generic

References

  • API/OAuth notes: references/withings_api.md
  • Output schema (for Wellness hub): references/output_schema.md