Install
openclaw skills install smartpiSmartPi 设备绑定、扫码、设备管理与连接故障排查。Use when the user mentions binding SmartPi, SmartPi QR code, 9002, SmartPi connection failure, listing SmartPi devices, or removing a SmartPi device.
openclaw skills install smartpi帮助用户完成 SmartPi 插件安装检查、设备扫码绑定、设备列表查看、设备删除,以及 9002 / 连接失败等常见问题排查。
description 必须直接覆盖用户常见说法,例如 SmartPi 绑定、二维码、9002、连接失败、查看设备、删除设备。openclaw 命令、Gateway 配置和日志,不假设外部服务可用。当用户提出以下请求时使用本 Skill:
9002、AI response timeout、语音请求无响应或超时。openclaw-smartpi、检查插件是否启用、修复 channels.openclaw-smartpi。openclaw-smartpi 插件无关。| 用户意图 | 首选流程 | 主要成功判定 |
|---|---|---|
| 绑定/添加 SmartPi | 流程:绑定设备 | 日志出现 WebSocket connected: <deviceKey> |
| 查看/列出设备 | 流程:查看设备 | accounts list 返回设备列表 |
| 删除设备 | 流程:删除设备 | 删除命令成功且列表不再包含该设备 |
| 安装/启用插件 | 流程:首次安装或修复插件 | plugins list 显示 openclaw-smartpi: enabled |
| 9002/超时 | 流程:9002 排查 | 定位为连接、路由或 AI 响应链路问题 |
在执行会改变状态的动作前,先确认用户意图是否明确。
openclaw --helpopenclaw plugins listopenclaw smartpi accounts list生成 SmartPi 绑定二维码,让用户扫码绑定,并确认设备通过 WebSocket 上线。
openclaw smartpi accounts bind
绑定ID: 后的 bindingId。bindingId 生成 smartpi_qr.png。请用微信扫一扫,绑定成功后我会继续确认设备连接状态。WebSocket connected: <deviceKey>。设备已连接,可以对着 SmartPi 说话了。优先使用当前环境已经安装的二维码工具,不要为了生成二维码自动安装依赖。
Python:
import qrcode
binding_id = "REPLACE_WITH_ACTUAL_BINDING_ID"
qrcode.make(binding_id).save("smartpi_qr.png")
Node.js:
node -e "const id=process.argv[1]; require('qrcode').toFile('smartpi_qr.png',id,{type:'png'},e=>e&&console.error(e))" "REPLACE_WITH_ACTUAL_BINDING_ID"
WebSocket connected: <deviceKey>。openclaw smartpi accounts list 能看到新设备。bindingId:反馈绑定命令输出异常,并展示关键输出让用户确认。openclaw smartpi accounts list
deviceKey、在线状态或命令输出中的关键字段。openclaw smartpi accounts list
deviceKey。openclaw smartpi accounts remove <deviceKey>
accounts list 验证设备已删除。deviceKey,必须先列出设备并让用户选择。安装并启用 openclaw-smartpi 插件,确保 Gateway 能加载 SmartPi channel。
openclaw plugins list
openclaw plugins install openclaw-smartpi
plugins.allow 和 channels 内容,只追加 SmartPi 所需项。openclaw gateway restart
plugins list 和日志。openclaw plugins list 显示 openclaw-smartpi: enabled。channels.openclaw-smartpi。cannot resolve agentId。openclaw plugins listopenclaw smartpi accounts listWebSocket connectedWebSocket disconnectedcannot resolve agentId,检查 channels.openclaw-smartpi。9002 表示 AI 未在限定时间内回复。不要直接假设是设备坏了,应按链路排查。
openclaw plugins list,确认 openclaw-smartpi: enabled。openclaw smartpi accounts list,确认存在设备。WebSocket connected,确认设备在线。cannot resolve agentId,确认 channels.openclaw-smartpi 存在。AI response timeout,判断是否由模型慢、MCP 阻塞或工具调用卡住导致。cannot resolve agentId:修复 channels.openclaw-smartpi。plugins.allow 是整体替换config.patch 对数组是整体替换,不是追加。修改前必须先读取当前完整配置,构造包含原有插件和 openclaw-smartpi 的完整数组后再 patch。
channels 是整体替换不要只 patch channels.openclaw-smartpi。这可能覆盖掉已有 channel,例如 discord、telegram。必须保留所有已有 channels,再追加 openclaw-smartpi。
channel.id 必须匹配插件内部 channel.id = "openclaw-smartpi",配置中必须是 channels.openclaw-smartpi,一字不差。否则消息无法路由,常见日志为 cannot resolve agentId。
{
"channels": {
"openclaw-smartpi": {
"enabled": true,
"defaultAgentId": "main"
}
}
}
| 命令 | 用途 | 风险 |
|---|---|---|
openclaw --help | 检查 CLI 是否可用 | 只读 |
openclaw plugins list | 确认插件状态 | 只读 |
openclaw smartpi accounts list | 查看已绑定设备 | 只读 |
openclaw smartpi accounts bind | 扫码绑定新设备 | 创建绑定 |
openclaw smartpi accounts remove <deviceKey> | 删除设备并解绑 | 高风险 |
openclaw plugins install openclaw-smartpi | 安装插件 | 修改环境 |
openclaw gateway restart | 重启 Gateway | 中断服务 |
| 关键字 | 含义 | 下一步 |
|---|---|---|
WebSocket connected | 设备已上线 | 验证设备列表和语音交互 |
WebSocket disconnected | 设备断开 | 检查网络、设备状态、绑定状态 |
cannot resolve agentId | 缺少或错误配置 channels.openclaw-smartpi | 修复 channels 配置 |
AI response timeout | AI 响应超时,可能导致 9002 | 排查模型、MCP、Tools 响应链路 |
每次使用本 Skill 后,最终回复必须包含: