戴森设备本地控制
通过MQTT本地控制
通过Google Smart Device Management API连接并操控Nest智能设备,支持温控器温度调节、模式切换、摄像头实时画面获取及门铃事件监听。
前置准备
https://www.google.com获取Refresh Token
https://nestservices.google.com/partnerconnections/PROJECT_ID/auth?redirect_uri=https://www.google.com&access_type=offline&prompt=consent&client_id=CLIENT_ID&response_type=code&scope=https://www.googleapis.com/auth/sdm.servicecurl -X POST https://oauth2.googleapis.com/token -d "client_id=CLIENT_ID" -d "client_secret=CLIENT_SECRET" -d "code=AUTH_CODE" -d "grant_type=authorization_code" -d "redirect_uri=https://www.google.com"安装与配置
推荐1Password存储:创建条目包含字段 project_id、client_id、client_secret、refresh_token
或环境变量方式:
export NEST_PROJECT_ID="your-project-id"
export NEST_CLIENT_ID="your-client-id"
export NEST_CLIENT_SECRET="your-client-secret"
export NEST_REFRESH_TOKEN="your-refresh-token"
基础命令
# 列出设备
python3 scripts/nest.py list
# 查看温控器状态
python3 scripts/nest.py get <device_id>
# 设置温度(摄氏)
python3 scripts/nest.py set-temp <device_id> 21 --unit c --type heat
# 切换模式
python3 scripts/nest.py set-mode <device_id> HEAT
# 获取摄像头流地址
python3 scripts/nest.py stream <device_id>
实时事件配置(可选)
需配置Google Cloud Pub/Sub + Cloudflare Tunnel webhook,详见原始文档。
见下方输入与输出表格。
| 项目 | 内容 |
|---|---|
| 输入 | device_id(设备标识符)、temperature_value(目标温度)、temperature_unit(c/f)、mode_type(HEAT/COOL/HEATCOOL/OFF)、eco_mode(MANUAL_ECO) |
| 输出 | 设备列表、温控器状态、RTSP流地址、实时事件通知 |
| 适用人群 | Nest设备用户、远程温控需求家庭、监控集成开发者、Google Cloud配置经验者 |
| 不包含 | 非Nest设备控制、历史数据存储、多房间独立策略、语音助手原生集成 |
原始链接:https://github.com/openclaw/skills/tree/main/skills/amogower/nest-devices/SKILL.md
来源类型:GitHub仓库