← 返回 Skills 市场
158
总下载
2
收藏
0
当前安装
5
版本数
在 OpenClaw 中安装
/install duwi-smart-home
功能描述
迪惟智能家居技能,基于 Duwi 开放平台 API,支持设备控制、场景执行、状态查询等功能
使用说明 (SKILL.md)
\r \r
Duwi 迪惟智能家居技能\r
\r 基于 Duwi 开放平台 API,支持设备控制、场景执行、状态查询等功能。\r \r
功能特性\r
\r
房屋管理\r
- 多房屋支持\r
- 楼层管理\r
- 房间管理\r \r
状态查询\r
- 设备在线状态\r
- 设备实时数值(温度、湿度、光照度、电压、电流等)\r
- 传感器历史统计数据\r
- 用电量统计数据\r \r
设备控制\r
- 电源断路器控制:开关控制等\r
- 灯光控制:开关、亮度调节 (0-100%)、色温调节 (2700-6200K)、颜色调整(HSV 格式)等\r
- 窗帘控制:开/关/停、百分比 (0-100%)、角度调节等\r
- 空调控制:开关、温度设置 (5-35℃)、模式设置、风速设置、风向设置等\r
- 地暖控制:开关、温度设置 (10-30℃) 等\r
- 新风控制:开关、湿度设置(0-100%)、风速设置、工作模式设置等\r
- 热泵控制:开关、温度设置、模式设置等\r
- 二联供控制:开关、模式设置、温度设置(5-35℃)、湿度设置(0-100%)、风速控制等\r \r
场景控制\r
- 场景列表查询\r
- 场景执行\r \r
快速开始\r
\r
1. 配置应用凭证\r
\r 配置前确认:\r
- ✅ 你已从迪惟开放平台获取了 APPKEY 和 SECRET\r \r 方式 1:非交互模式(适合大模型)\r
python init_config.py --appkey \x3CAPPKEY> --secret \x3CSECRET>\r
```\r
\r
**方式 2:交互模式**\r
```bash\r
python init_config.py\r
```\r
按提示输入 APPKEY 和 SECRET(输入时 SECRET 会隐藏显示)。\r
\r
### 2. 登录账户\r
\r
**方式 1:提供密码**\r
```bash\r
python duwi_cli.py login \x3C手机号> \x3C密码>\r
```\r
\r
**方式 2:不输入密码(会提示输入,隐藏显示)**\r
```bash\r
python duwi_cli.py login \x3C手机号>\r
```\r
\r
### 3. 选择房屋\r
\r
**方式 1:交互选择**\r
```bash\r
python duwi_cli.py choose-house\r
```\r
按提示选择房屋。\r
\r
**方式 2:直接指定房屋编号(推荐,无需交互)**\r
```bash\r
python duwi_cli.py choose-house --house_no \x3C房屋编号>\r
```\r
\r
### 4. 开始控制\r
```bash\r
python duwi_cli.py device-operate switch on --room 客厅 --device_name 顶灯\r
```\r
\r
---\r
\r
## 功能参考\r
\r
### 账户管理\r
| 功能 | CLI 指令 |\r
|------|---------|\r
| 登录 | `python duwi_cli.py login \x3C手机号> [密码]` |\r
| 退出 | `python duwi_cli.py logout` |\r
\r
**💡 提示**:登录成功后 token 会自动保存,下次使用无需重新登录。Token 过期时会自动刷新。\r
\r
### 房屋管理\r
| 功能 | CLI 指令 |\r
|------|---------|\r
| 房屋列表 | `python duwi_cli.py houses` |\r
| 选择房屋 | `python duwi_cli.py choose-house --house_no \x3C编号>` |\r
| 楼层列表 | `python duwi_cli.py floors` |\r
| 房间列表 | `python duwi_cli.py rooms [--floor \x3C楼层名>]` |\r
\r
**大模型提示:** 通过楼层名称查找房间列表,未找到相应的楼层时,先查找楼层列表,匹配相似的楼层名称,再通过精准楼层名称查找房间列表。\r
\r
### 设备查询\r
| 功能 | CLI 指令 |\r
|------|---------|\r
| 设备列表 | `python duwi_cli.py devices [--room \x3C房间>] [--floor \x3C楼层>] [--online]` |\r
| 设备详情 | `python duwi_cli.py device-info \x3C设备编号>` |\r
| 设备状态 | `python duwi_cli.py device-value \x3C设备编号>` |\r
\r
**大模型提示:** 设备列表的查询支持 `--floor`(楼层)、`--room`(房间)、`--online`(是否在线)、`--type`(设备类型编号)参数来精确定位设备,参数可选,可同时传入多个参数。\r
\r
### 设备控制\r
\r
**命令格式:** `python duwi_cli.py device-operate \x3C动作> \x3C值> [定位参数]`\r
\r
**定位参数优先级:** `--device_no` > `--floor + --room + --device_name` > `--room + --device_name` > `--device_name`\r
\r
| 设备类型(类型前缀) | 动作 | 动作说明 | 值说明 | 示例 |\r
|---------|------|---------|--------|------|\r
| **电源** (1-*) | `switch` | 开关 | `on`/`off` | `switch on --room 客厅 --device_name 断路器` |\r
| **灯光** (3-*) | `switch` | 开关 | `on`/`off` | `switch off --room 卧室 --device_name 顶灯` |\r
| | `light` | 调光 | 亮度 (0-100) | `light 80 --room 客厅 --device_name 灯带` |\r
| | `color_temp` | 调色温 | 色温 (2700-6200K) | `color_temp 4000 --room 书房 --device_name 台灯` |\r
| | `color` | 调色 | HSV 格式 (H:S:V) | `color 180:100:100 --room 卧室 --device_name 灯` |\r
| **窗帘** (4-*) | `control` | 开关停 | `open`/`close`/`stop` | `control open --room 客厅 --device_name 窗帘` |\r
| | `control_percent` | 设开合度 | 百分比 (0-100) | `control_percent 50 --room 主卧 --device_name 窗帘` |\r
| **空调** (5-001) | `ac_switch` | 开关 | `on`/`off` | `ac_switch on --room 客厅 --device_name 空调` |\r
| | `ac_set_temp` | 设温度 | 温度 (5-35℃) | `ac_set_temp 26 --room 客厅 --device_name 空调` |\r
| | `ac_mode` | 设模式 | `auto`/`cold`/`hot`/`fan`/`wet` | `ac_mode cold --room 卧室 --device_name 空调` |\r
| | `ac_wind_speed` | 设风速 | `auto`/`high`/`mid`/`low` | `ac_wind_speed mid --room 客厅 --device_name 空调` |\r
| | `ac_wind_direction` | 设风向 | `auto`/`stop`/`swing`/`up_down`/`left_right` | `ac_wind_direction auto --room 客厅 --device_name 空调` |\r
| | `ac_lock_mode` | 设锁定模式 | `lock`/`half_lock`/`unlock` | `ac_lock_mode lock --room 客厅 --device_name 空调` |\r
| **地暖** (5-002) | `fh_switch` | 开关 | `on`/`off` | `fh_switch on --device_name 地暖` |\r
| | `fh_set_temp` | 设温度 | 温度 (10-30℃) | `fh_set_temp 25 --device_name 地暖` |\r
| | `fh_lock_mode` | 设锁定模式 | `lock`/`half_lock`/`unlock` | `fh_lock_mode lock --device_name 地暖` |\r
| **新风** (5-003) | `fa_switch` | 开关 | `on`/`off` | `fa_switch on --device_name 新风机` |\r
| | `fa_work_mode` | 设模式 | `fresh`/`auto`/`manual`/`sleep` | `fa_work_mode fresh --device_name 新风机` |\r
| | `fa_wind_speed` | 设风速 | `auto`/`high`/`mid`/`low` | `fa_wind_speed mid --device_name 新风机` |\r
| | `fa_set_humidity` | 设湿度 | 湿度 (0-100%) | `fa_set_humidity 60 --device_name 新风机` |\r
| | `fa_clean_switch` | 开关UV 杀菌 | `on`/`off` | `fa_clean_switch on --device_name 新风机` |\r
| | `fa_fan_speed` | 设排风风速 | `auto`/`high`/`mid`/`low` | `fa_fan_speed mid --device_name 新风机` |\r
| **热泵** (5-004) | `hp_switch` | 开关 | `on`/`off` | `hp_switch on --device_name 热泵` |\r
| | `hp_set_temp` | 设温度 | 温度 (5-55℃) | `hp_set_temp 45 --device_name 热泵` |\r
| | `hp_mode` | 设模式 | `cold`/`hot` | `hp_mode hot --device_name 热泵` |\r
| **温控** (5-005) | `tc_switch` | 开关 | `on`/`off` | `tc_switch on --device_name 温控器` |\r
| | `tc_set_temp` | 设温度 | 温度 (5-35℃) | `tc_set_temp 26 --device_name 温控器` |\r
| | `tc_set_humidity` | 设湿度 | 湿度 (0-100%) | `tc_set_humidity 26 --device_name 温控器` |\r
| | `tc_mode` | 设模式 | `auto`/`cold`/`hot` | `tc_mode cold --device_name 温控器` |\r
| | `tc_wind_speed` | 设风速 | `auto`/`high`/`mid`/`low` | `tc_wind_speed auto --device_name 温控器` |\r
| | `tc_lock_mode` | 设锁定模式 | `mix`/`lock`/`mode_wind`/`floorheat` | `tc_lock_mode lock --device_name 温控器` |\r
\r
\r
**颜色 HSV 参考:** 红色=`0:100:100` | 绿色=`120:100:100` | 蓝色=`240:100:100` | 白色=`0:0:100` | 黄色=`60:100:100`\x3Cbr>\r
**空调模式说明:** `auto` (自动)、`cold` (制冷)、`hot` (制热)、`fan` (送风)、`wet` (除湿)、`air` (换气)\x3Cbr>\r
**空调风速说明:** `auto` (自动)、`super_strong` (超强)、`super_high` (超高)、`high` (高)、`mid` (中)、`low` (低)、`super_low` (超低)、`super_quiet` (超静)\x3Cbr>\r
**空调风向说明:** `auto` (自动)、`stop` (停止)、`swing` (摇摆)、`up_down` (上下)、`left_right` (左右)\x3Cbr>\r
**空调锁定模式说明:** `lock` (全锁)、`half_lock` (半锁)、`unlock` (解锁)\x3Cbr>\r
**地暖锁定模式说明:** `lock` (全锁)、`half_lock` (半锁)、`unlock` (解锁)\x3Cbr>\r
**新风风速和新风排风风速说明:** `auto` (自动)、`extreme_strong` (极强)、`super_high` (超高)、`high` (高)、`mid` (中)、`low` (低)、`super_low` (超低)、`super_quiet` (超静)\x3Cbr>\r
**新风工作模式说明:** `fresh` (新风)、`wet` (除湿)、`auto` (自动)、`manual` (手动)、`indoor_loop` (内循环)、`sleep` (睡眠)、`pass` (旁通)、`common` (普通)、`smart` (智能)、`ventilate` (通风)、`outdoor_loop` (外循环)、`smart_auto` (智慧自动)、`eco_fresh` (节能新风)、`normal_air` (普通换气)、`cold_wet` (制冷除湿)、`hot_humidify` (制热加湿)、`cold_hot_auto` (冷暖自动)、`smart_humidify` (智慧调湿)、`timing` (定时)、`air` (换气)、`clean` (净化)、`program` (编程)、`exhaust` (排风)、`heat_exchange` (热交换)、`powerful` (强力)、`cold_room` (冷房)、`hot_room` (暖房)、`energy_recycle` (能量回收)、`night` (夜间)、`holiday` (假日)\x3Cbr>\r
**热泵模式说明:** `cold` (制冷)、`hot` (制热)\x3Cbr>\r
**温控模式说明:** `auto` (自动)、`cold` (制冷)、`hot` (制热)、`ventilate` (通风)、`floorheat` (地暖)、`mix` (一体)、`smart_floorheat` (智能地暖)、`cold_floorcold` (制冷制热)\x3Cbr>\r
**温控风速说明:** `auto` (自动)、`super_strong` (超强)、`strong` (强劲)、`super_high` (超高)、`high` (高)、`mid` (中)、`low` (低)、`super_low` (超低)、`super_quiet` (超静)\x3Cbr>\r
**温控锁定模式说明:** `mode` (锁定模式)、`mode_wind` (锁定模式&风速)、`mode_wind_temp` (锁定模式&风速&温度)、`unlock` (解锁)、`floorheat` (地暖)、`mix` (一体)、`lock` (锁定)\x3Cbr>\r
\r
### 场景控制\r
| 功能 | CLI 指令 |\r
|------|---------|\r
| 场景列表 | `python duwi_cli.py scenes [--room \x3C房间>] [--floor \x3C楼层>]` |\r
| 执行场景 | `python duwi_cli.py execute-scene --scene_no \x3C编号>` 或 `--scene_name \x3C名称>` |\r
\r
### 统计数据\r
| 功能 | CLI 指令 |\r
|------|---------|\r
| 传感器统计 | `python duwi_cli.py sensor-stats \x3C设备编号> --type \x3C类型> --days \x3C天数>` |\r
| 电量统计 | `python duwi_cli.py elec-stats [--device_no \x3C编号>] --days \x3C天数>` |\r
\r
**传感器类型:** 1=温度,2=湿度,3=光照度,4=甲醛,5=PM2.5,6=CO2,7=AQI,8=人体感应 \x3Cbr>\r
\r
### 缓存管理\r
| 功能 | CLI 指令 |\r
|------|---------|\r
| 缓存统计 | `python duwi_cli.py cache stats` |\r
| 清理缓存 | `python duwi_cli.py cache clean` |\r
| 清空缓存 | `python duwi_cli.py cache clear` |\r
\r
---\r
\r
## 大模型集成指南\r
\r
### 意图识别 → CLI 命令映射\r
\r
| 用户说法 | 识别要素 | 生成的 CLI 命令 |\r
|---------|---------|----------------|\r
| "打开客厅的灯" | 房间=客厅,设备=灯,动作=开 | `python duwi_cli.py device-operate switch on --room 客厅 --device_name 灯` |\r
| "关闭一楼卧室的空调" | 楼层=一楼,房间=卧室,设备=空调 | `python duwi_cli.py device-operate ac_switch off --floor 一楼 --room 卧室 --device_name 空调` |\r
| "把主卧窗帘开到 50%" | 房间=主卧,设备=窗帘,值=50 | `python duwi_cli.py device-operate control_percent 50 --room 主卧 --device_name 窗帘` |\r
| "客厅空调 26 度制冷" | 房间=客厅,温度=26,模式=制冷 | `python duwi_cli.py device-operate ac_set_temp 26 --room 客厅 --device_name 空调` |\r
| "把灯调成红色" | 设备=灯,颜色=红色 | `python duwi_cli.py device-operate color 0:100:100 --device_name 灯` |\r
\r
---\r
\r
## 房屋结构\r
\r
```\r
房屋 → 楼层 → 房间 → 设备/场景\r
```\r
\r
```\r
房屋 (House)\r
├── 一楼 (Floor)\r
│ ├── 客厅 (Room)\r
│ │ ├── 顶灯 (Device)\r
│ │ ├── 会客模式 (Scene)\r
│ │ └── 客厅群组 (Group)\r
│ └── 厨房 (Room)\r
└── 二楼 (Floor)\r
└── 次卧 (Room)\r
```\r
\r
| 层级 | 说明 | 示例 |\r
|------|------|------|\r
| 房屋 | 最高层级 | 北京的家 |\r
| 楼层 | 房屋的楼层 | 一楼、二楼 |\r
| 房间 | 楼层下的房间 | 客厅、卧室 |\r
| 设备 | 智能设备 | 灯、窗帘、空调 |\r
| 场景 | 预设场景 | 会客模式、睡眠模式 |\r
\r
---\r
\r
## 注意事项\r
\r
1. **Token 管理:** 登录后自动缓存,过期自动刷新\r
2. **房屋选择:** 首次使用需选择房屋,配置保存到 `config.json`\r
3. **设备在线:** 控制前请确认设备在线\r
4. **参数范围:** 亮度 0-100%,色温 2700-6200K,空调温度 5-35℃,地暖温度 10-30℃\r
5. **缓存刷新:** 设备控制后自动刷新缓存,如需手动刷新执行 `cache clear`\r
6. **安全:** 配置文件仅本地保存,不要分享或提交到 Git\r
7. **控制反馈**:如果控制失败,请反馈给用户相关控制失败原因\r
8. **设备缓存**:设备列表会自动缓存 5 分钟,如需刷新请等待或调用 `cache clear`\r
9. **用户反馈处理**:如果提出设备状态和实际设备状态不一致,请及时调用 `cache clear`\r
\r
---\r
\r
## 错误码\r
\r
| 返回码 | 说明 |\r
|-------|------|\r
| 10000 | 操作成功 |\r
| 10001 | 请求参数不正确 |\r
| 10002 | accessToken 异常或过期 |\r
| 10003 | 暂无访问权限 |\r
| 11000 | 账户名或者密码错误 |\r
| 99001 | appKey 异常 |\r
| 99002 | 签名错误 |\r
| 99003 | 时间戳请求超时 |\r
| 19999 | 系统错误 |\r
\r
---\r
\r
## 依赖\r
\r
```bash\r
pip install requests\r
```\r
安全使用建议
This skill appears to do what it says: it implements a Duwi API client and CLI for smart-home control. Before installing, consider: (1) it requires a Python runtime and the 'requests' library — install/verify these before use; (2) you will provide an APPKEY and SECRET (application-level credentials) and your account phone/password; these are stored locally in app_config.json and token_cache.json in the skill directory — check and, if desired, relocate or protect those files; (3) the skill talks to https://openapi.duwi.com.cn/homeApi/v1 — if you need to verify the vendor, confirm this endpoint and the package origin (source/homepage are unknown in the registry metadata); (4) review the included scripts yourself (they are plain Python and human-readable) if you have sensitive environments; (5) run the tool in a constrained environment or VM if you want to limit blast radius. Overall, nothing in the code indicates covert exfiltration or unrelated behavior, but verify the APPKEY/SECRET handling and the network endpoint if provenance is a concern.
功能分析
Type: OpenClaw Skill
Name: duwi-smart-home
Version: 1.0.6
The duwi-smart-home skill bundle is a legitimate integration for the Duwi smart home platform. It provides a CLI tool and an API client (duwi_cli.py, duwi_client.py) to control IoT devices like lights, AC, and curtains. The code follows security best practices by using restricted file permissions (0o600) for local credential storage, utilizing getpass for sensitive input, and implementing input validation for device parameters. No evidence of data exfiltration, malicious execution, or prompt injection was found.
能力标签
能力评估
Purpose & Capability
Name/description (Duwi Smart Home) align with the code: a DuwiClient, CLI, device handlers and an init_config helper implement device control, queries and scene execution against Duwi's open API. The requested/used resources (appkey/secret, user login, local config/token files) are expected for this purpose.
Instruction Scope
SKILL.md instructs the user/agent to configure APPKEY/SECRET, run init_config.py and use duwi_cli.py for login and device control. The runtime instructions and code access only local config/token files (in the skill folder) and the Duwi API endpoint (BASE_URL = https://openapi.duwi.com.cn/homeApi/v1). There are no instructions to read unrelated system files or to transmit data to unexpected endpoints.
Install Mechanism
There is no install spec (no packages downloaded at install time) which reduces risk. However, the package contains Python scripts and the SKILL.md/CLI assume a Python runtime and the 'requests' package; the registry metadata declared no required binaries. This mismatch is a minor issue: the skill needs Python (and the requests library) to run but does not declare that dependency in the registry metadata or provide an install step.
Credentials
The skill does not request environment variables or external credentials beyond the Duwi APPKEY/SECRET and user phone/password (entered interactively). Those credentials are proportionate to the described functionality. The code saves tokens and the app config locally (app_config.json, token_cache.json) and sets file permissions where possible.
Persistence & Privilege
The skill does not request always: true and does not modify other skills or system-wide settings. It persists only its own configuration and token files in the skill directory. Agent autonomous invocation is allowed by default (not a flag on its own) and is not combined with other concerning privileges.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install duwi-smart-home - 安装完成后,直接呼叫该 Skill 的名称或使用
/duwi-smart-home触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.6
duwi-smart-home 1.0.6
- Version bump to 1.0.6.
- Optimize and fix issues.
v1.0.5
- 新增 displayName、summary 字段,丰富 skill 基本信息展示
- tags 增加了 duwi 和 home-automation 标签,便于分类检索
- 版本号从 1.0.4 升级为 1.0.5
- 其余功能、描述文档保持一致,无其他改动
v1.0.4
- Version updated to 1.0.4.
- Skill name capitalized in metadata.
- No other content or functionality changes detected.
v1.0.3
- 更新版本号至 1.0.3
- 技能名称由 "duwi-smart-home" 改为 "duwi smart home"
- 其余内容无变化(无功能或文档更新)
v1.0.2
- Improved documentation with detailed command examples and feature descriptions.
- Added comprehensive CLI usage instructions for device control, scene execution, and status queries.
- Included feature tables for easier command reference and quick start guidance.
- Provided integration tips for large language models.
- Clarified parameter usage and device action mappings for all supported device types.
元数据
常见问题
Duwi Smart Home 是什么?
迪惟智能家居技能,基于 Duwi 开放平台 API,支持设备控制、场景执行、状态查询等功能. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 158 次。
如何安装 Duwi Smart Home?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install duwi-smart-home」即可一键安装,无需额外配置。
Duwi Smart Home 是免费的吗?
是的,Duwi Smart Home 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Duwi Smart Home 支持哪些平台?
Duwi Smart Home 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Duwi Smart Home?
由 迪惟科技(@duwi2024)开发并维护,当前版本 v1.0.6。
推荐 Skills