📦 SmartThings
v0.1.0通过官方 SmartThings CLI 直接控制 SmartThings hub,无需经过 Home... 即可列出设备、读取设备状态并执行 capability 命令。
0· 19·0 当前·0 累计
下载技能包
最后更新
2026/4/19
安全扫描
OpenClaw
安全
high confidence该技能内部一致:使用 SmartThings CLI 控制设备,依赖 smartthings 二进制文件,唯一敏感需求是已认证的 SmartThings 账户访问(浏览器登录或 PAT)。
评估建议
This skill looks coherent and uses the official SmartThings CLI. Before installing, ensure: (1) you have the smartthings CLI installed and trust the runtime that will execute it; (2) the agent will need authenticated access — prefer browser OAuth (the CLI opens a browser and stores a refresh token) over pasting a PAT; (3) if you must use a PAT, be aware it grants broad read/write/execute control over your devices and scenes and may be short-lived (the doc notes 24-hour expiry for newer PATs); (4...详细分析 ▾
✓ 用途与能力
Name/description match the actual behavior: the skill invokes the official SmartThings CLI to list devices, read status, and send capability commands. The required binary (smartthings) is exactly what is needed and nothing unrelated is requested.
✓ 指令范围
The SKILL.md and the included script only instruct the agent to run smartthings CLI commands and jq, plus suggest where the CLI stores its config. There is no attempt to read unrelated system files or exfiltrate data to external endpoints. The docs do instruct how to place a PAT in the CLI config file (a sensitive action), which is expected for this kind of integration.
✓ 安装机制
No install spec is included (instruction-only), and the doc recommends installing via Homebrew or npm — both are standard, low-risk sources for this CLI. No arbitrary download URLs or archive extraction are present.
ℹ 凭证需求
The skill declares no required env vars and does not request unrelated credentials. However, to operate it needs authenticated SmartThings access (browser OAuth or a Personal Access Token). PAT scopes listed (read/write/execute for devices and scenes) are broad but necessary for device control; treat PATs as highly sensitive. The SKILL.md notes config file paths where a token could be stored, which is expected but important to be aware of.
✓ 持久化与权限
always is false and the skill does not request persistent system-wide privileges. The CLI itself will store tokens in its own config if you choose PAT or browser refresh tokens, which is normal for the CLI but outside the skill's direct behavior.
安全有层次,运行前请审查代码。
运行时依赖
无特殊依赖
版本
latestv0.1.02026/4/19
初始版本:直接支持 SmartThings CLI 技能,用于设备列表、状态查看与命令控制
● 无害
安装命令
点击复制官方npx clawhub@latest install smartthings-direct
镜像加速npx clawhub@latest install smartthings-direct --registry https://cn.longxiaskill.com
技能文档
使用官方 @smartthings/cli 直接控制 SmartThings 中枢。这是底层通道——绕过 Home Assistant 和 Matter 桥接。需要直接访问 SmartThings 设备时使用。如需 Home Assistant / Matter 方案,请改用同级的 smart-home 技能。
安装
``bash
# macOS(推荐)
brew install smartthingscommunity/smartthings/smartthings
# 或 npm(Node 24.8+)
npm install --global @smartthings/cli
`
二进制:smartthings(别名 st)。验证:smartthings --version。 认证
两种方式。浏览器登录更适合长期使用,CLI 会保存刷新令牌。 浏览器登录(推荐)
运行任意命令——首次使用时 CLI 会打开浏览器进行 Samsung 账号 OAuth。
`bash
smartthings locations # 首次调用触发登录
` Personal Access Token (PAT)
- 在 https://account.smartthings.com/tokens 创建 PAT
所需权限:r:devices:、w:devices:、x:devices:、r:locations:、r:scenes:、x:scenes:- 每次命令携带:
bash
smartthings devices --token
`
或写入配置文件:
macOS:~/Library/Preferences/@smartthings/cli/config.yamlLinux:~/.config/@smartthings/cli/config.yaml
yaml
default:
token: your-pat-uuid-here
`
注意: 2024-12-30 后创建的 PAT 24 小时过期。长期运行请用浏览器认证或定期重新签发。随时用 smartthings config 查看配置路径。 核心命令
设备
`bash
smartthings devices # 列出所有设备
smartthings devices --json # JSON 输出
smartthings devices # 设备详情与能力
smartthings devices:status # 当前属性值
smartthings devices:health # 在线/离线
smartthings devices:capability-status
` 执行命令
格式:[component:]:[(args)],component 默认为 main。
`bash
# 开关
smartthings devices:commands switch:switch:on
smartthings devices:commands switch:switch:off # 调光 50%
smartthings devices:commands main:switchLevel:setLevel\(50\)
# 空调制冷设定 24 °C
smartthings devices:commands main:thermostatCoolingSetpoint:setCoolingSetpoint\(24\)
# 色温
smartthings devices:commands main:colorTemperature:setColorTemperature\(3000\)
`
bash/zsh 中括号需转义。不带参数运行 devices:commands 会进入交互式引导,便于发现正确的能力调用。
位置、房间、场景、能力
`bash
smartthings locations
smartthings rooms --location-id
smartthings scenes
smartthings scenes:execute
smartthings capabilities # 标准能力目录
` 输出标志
| 标志 | 作用 |
|------|------|
| -j, --json | JSON 输出到 stdout |
| -y, --yaml | YAML |
| -o | 写入文件(扩展名决定格式) |
无内置字段选择器——用 jq 处理 JSON。 典型代理工作流
当用户说“关掉客厅灯”:
- 名称→设备 ID:
`bash
scripts/st-find.sh "living room"
`
或直接:
`bash
smartthings devices --json | jq '.[] | select(.label | test("living room"; "i")) | {deviceId, label}'
`
- (可选)先查状态:
`bash
smartthings devices:status
`
- 发送命令:
`bash
smartthings devices:commands switch:switch:off
`
- 若操作关键(HVAC 设定、场景执行),再次读取状态确认。
速率限制
- 设备命令:每设备 12 次/分钟,单次请求最多 10 条命令
- 位置:读取 100/分钟,写入 20/小时
- 房间:全部操作 50/小时
- 场景:执行 50/分钟,列表 50/分钟
HTTP 429 = 限流,HTTP 422 = 防护触发。遇限流请退避,不要立即重试。 注意事项
标志放在子命令后:smartthings devices -j,而非smartthings -j devices。SMARTTHINGS_PROFILE环境变量可切换配置集;不存在SMARTTHINGS_TOKEN` 环境变量。- 本技能保持精简,建议直接调用 CLI,而非再包一层脚本。