File contents 全屋设备控制技能
⚠️ 重要说明:GET vs POST 操作
GET 操作:主动查询设备实时状态
数据来源 :主动向设备发起查询请求
时效性 :实时/近实时的设备状态
设备要求 :设备必须在线
适用场景 :需要获取设备的精确实时状态
POST 操作:向设备发送控制命令
功能 :控制设备开关、调节参数等
响应 :实时返回控制结果
适用场景 :远程控制设备、调节参数、执行场景
核心能力
向指定设备发送控制命令(POST)
主动查询设备实时状态(GET)
支持多种操作类型(开关、调节、场景等)
实时返回控制结果和查询结果
支持调试模式查看详细请求和响应
适用设备范围
灯光、开关、插座等通用设备
传感器、窗帘等智能家居设备
不包含智慧屏(devType='09C')设备
调用方式
1. 获取设备信息(获取devId和prodId)
node smarthome-claw.js get_devices_info
2. 控制设备
# 基本格式
node common-skill/bin/smarthome-claw.js control_device --dev-id <设备ID> --prod-id <产品ID> --operation <操作类型> --sid <服务ID> --data <{cid: value}>
# 示例:开关灯
node common-skill/bin/smarthome-claw.js control_device --dev-id "xxx" --prod-id "xxx" --operation "POST" --sid "switch" --data '{\"on\":1}'
# 示例:查询状态
node common-skill/bin/smarthome-claw.js control_device --dev-id "xxx" --prod-id "xxx" --operation "GET" --sid "switch" --data '{}'
# 调试模式
node common-skill/bin/smarthome-claw.js control_device --dev-id "xxx" --prod-id "xxx" --operation "POST" --sid "switch" --data '{\"on\":1}' --verbose
参数说明
--dev-id: 设备ID(必填),从 get_devices_info 获取
--prod-id: 产品ID(必填),从 get_devices_info 获取
--operation: 操作类型(必填),如 "GET"、"POST" 等
--sid: 服务ID(必填),如 "switch"、"brightness" 等
--data: 控制数据JSON字符串(必填),如 {\"cid\":value} "GET" 类型传'{}'即可
在profile定义中定义了设备对外开放的服务能力,介绍,参数和参数类型,可选范围的介绍,可以参考查询到的设备状态和profile定义来组装控制报文,
https://smartlife-sandbox-drcn.things.dbankcloud.cn/device/guide/ <产品ID>/<产品ID>.json
#示例
https://smartlife-sandbox-drcn.things.dbankcloud.cn/device/guide/V0FW/V0FW.json
适用场景
POST 操作(控制)
远程控制设备开关
调节设备参数(亮度、温度等)
GET 操作(查询)
获取设备的实时精确状态
确认设备是否在线并响应
查询设备当前属性值(实时)
与 get_device_detail 的区别
对比项
get_device_detail
control_device (GET)
数据来源
云端缓存
主动查询设备
时效性
可能有延迟
实时/近实时
响应速度
快
较慢(需要设备响应)
设备在线要求
不需要
需要
适用场景
快速查看信息
获取精确实时状态
选择建议 :
快速查看设备信息、了解设备能力 → 使用 get_device_detail
需要精确的实时状态、确认设备在线 → 使用 control_device 的 GET 操作
1 --- 2 name: control-device 3 description: 全屋设备控制技能 4 --- 5 # 全屋设备控制技能 6 7 ## ⚠️ 重要说明:GET vs POST 操作 8 9 > **GET 操作:主动查询设备实时状态** 10 > - **数据来源**:主动向设备发起查询请求 11 > - **时效性**:实时/近实时的设备状态 12 > - **设备要求**:设备必须在线 13 > - **适用场景**:需要获取设备的精确实时状态 14 > 15 > **POST 操作:向设备发送控制命令** 16 > - **功能**:控制设备开关、调节参数等 17 > - **响应**:实时返回控制结果 18 > - **适用场景**:远程控制设备、调节参数、执行场景 19 20 ## 核心能力 21 1. 向指定设备发送控制命令(POST) 22 2. 主动查询设备实时状态(GET) 23 3. 支持多种操作类型(开关、调节、场景等) 24 4. 实时返回控制结果和查询结果 25 5. 支持调试模式查看详细请求和响应 26 27 ## 适用设备范围 28 - 灯光、开关、插座等通用设备 29 - 传感器、窗帘等智能家居设备 30 - **不包含智慧屏(devType='09C')设备** 31 32 ## 调用方式 33 ### 1. 获取设备信息(获取devId和prodId) 34 ```bash 35 node smarthome-claw.js get_devices_info 36 ``` 37 38 ### 2. 控制设备 39 ```bash 40 # 基本格式 41 node common-skill/bin/smarthome-claw.js control_device --dev-id <设备ID> --prod-id <产品ID> --operation <操作类型> --sid <服务ID> --data <{cid: value}> 42 43 # 示例:开关灯 44 node common-skill/bin/smarthome-claw.js control_device --dev-id "xxx" --prod-id "xxx" --operation "POST" --sid "switch" --data '{\"on\":1}' 45 46 # 示例:查询状态 47 node common-skill/bin/smarthome-claw.js control_device --dev-id "xxx" --prod-id "xxx" --operation "GET" --sid "switch" --data '{}' 48 49 # 调试模式 50 node common-skill/bin/smarthome-claw.js control_device --dev-id "xxx" --prod-id "xxx" --operation "POST" --sid "switch" --data '{\"on\":1}' --verbose 51 ``` 52 53 ## 参数说明 54 - `--dev-id`: 设备ID(必填),从 get_devices_info 获取 55 - `--prod-id`: 产品ID(必填),从 get_devices_info 获取 56 - `--operation`: 操作类型(必填),如 "GET"、"POST" 等 57 - `--sid`: 服务ID(必填),如 "switch"、"brightness" 等 58 - `--data`: 控制数据JSON字符串(必填),如 `{\"cid\":value}` "GET" 类型传'{}'即可 59 60 在profile定义中定义了设备对外开放的服务能力,介绍,参数和参数类型,可选范围的介绍,可以参考查询到的设备状态和profile定义来组装控制报文, 61 https://smartlife-sandbox-drcn.things.dbankcloud.cn/device/guide/<产品ID>/<产品ID>.json 62 63 #示例 64 https://smartlife-sandbox-drcn.things.dbankcloud.cn/device/guide/V0FW/V0FW.json 65 66 ## 适用场景 67 ### POST 操作(控制) 68 1. 远程控制设备开关 69 2. 调节设备参数(亮度、温度等) 70 71 ### GET 操作(查询) 72 1. 获取设备的实时精确状态 73 2. 确认设备是否在线并响应 74 3. 查询设备当前属性值(实时) 75 76 ## 与 get_device_detail 的区别 77 78 | 对比项 | get_device_detail | control_device (GET) | 79 |--------|-------------------|---------------------| 80 | **数据来源** | 云端缓存 | 主动查询设备 | 81 | **时效性** | 可能有延迟 | 实时/近实时 | 82 | **响应速度** | 快 | 较慢(需要设备响应) | 83 | **设备在线要求** | 不需要 | 需要 | 84 | **适用场景** | 快速查看信息 | 获取精确实时状态 | 85 86 > **选择建议**: 87 > - 快速查看设备信息、了解设备能力 → 使用 `get_device_detail` 88 > - 需要精确的实时状态、确认设备在线 → 使用 `control_device` 的 GET 操作
18816132863/xiaoyi-claw-omega-final/tree/main/skills/xiaoyi-HarmonyOSSmartHome-skill/common-skill/control_device commit 6f4450c840
Frequently asked questions How do I install the Control Device skill? Run npx skillmds@latest add 18816132863/control-device in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
What does the Control Device skill do? 全屋设备控制技能 It is listed under Coding & Dev Tools on SkillMD.
Is Control Device safe to use? This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
Which AI agents work with Control Device? This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Is Control Device free to use? Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
Who published Control Device? 18816132863 (@18816132863) published this skill. Their other Agent Skills are listed on their SkillMD profile.