by dean2021
管理和控制小米/米家智能家居设备的SIKIL,兼容claude code或openclaw等agent,支持设备发现、开关控制、亮度调节、颜色设置等功能。
# Add to your Claude Code skills
git clone https://github.com/dean2021/mijia-device-managerGuides for using ai agents skills like mijia-device-manager.
mijia-device-manager is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by dean2021. 管理和控制小米/米家智能家居设备的SIKIL,兼容claude code或openclaw等agent,支持设备发现、开关控制、亮度调节、颜色设置等功能。. It has 130 GitHub stars.
mijia-device-manager's catalog security scan is still queued. You can run an instant dependency and prompt-injection check now with the "Scan for vulnerabilities" button above.
Clone the repository with "git clone https://github.com/dean2021/mijia-device-manager" and add it to your Claude Code skills directory (see the Installation section above). mijia-device-manager ships a SKILL.md manifest, so compatible agents can discover and load it automatically.
Yes. AgentsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh mijia-device-manager against similar tools.
No comments yet. Be the first to share your thoughts!
Unlocks once the catalog security scan passes (runs nightly).
The deep catalog scan for this skill is still queued. Run an instant dependency check now instead.
此技能用于管理和控制小米/米家智能家居设备,直接调用 mijiaAPI CLI 通过小米云端 API 控制设备。
pip install mijiaAPI
python -m mijiaAPI --list_homes
python -m mijiaAPI --list_homes
运行后会显示二维码,使用米家 APP 扫描即可完成登录。
python -m mijiaAPI -l
输出中每条设备信息包含 did,后续控制命令使用该值。
# 开灯
python -m mijiaAPI set --did "123456789" --prop_name "on" --value True
# 设置亮度
python -m mijiaAPI set --did "123456789" --prop_name "brightness" --value 50
# 获取状态
python -m mijiaAPI get --did "123456789" --prop_name "brightness"
python -m mijiaAPI --help
python -m mijiaAPI get --help
python -m mijiaAPI set --help
常用命令示例:
# 列出所有设备
python -m mijiaAPI -l
# 从列表中找到 did
python -m mijiaAPI -l | grep did
# 列出所有家庭
python -m mijiaAPI --list_homes
# 获取设备属性
python -m mijiaAPI get --did "123456789" --prop_name "brightness"
# 设置设备属性
python -m mijiaAPI set --did "123456789" --prop_name "on" --value True
python -m mijiaAPI set --did "123456789" --prop_name "brightness" --value 50
# 执行场景
python -m mijiaAPI --run_scene "回家"
常见设备属性名称:
| 属性名 | 说明 | 类型 | 示例值 |
|---|---|---|---|
on |
开关状态 | bool | True/False |
brightness |
亮度 | int | 0-100 |
color-temperature |
色温 | int | 2700-6500 |
color |
颜色 | int | RGB值 |
注意: 不同设备支持的属性不同,操作前先使用 --get_device_info DEVICE_MODEL 获取设备属性信息,确认可操作的属性后再执行控制命令。DEVICE_MODEL 可通过 --list_devices 获取。
操作步骤:
python -m mijiaAPI -l 列出设备,确认 did 与 DEVICE_MODEL。python -m mijiaAPI --get_device_info DEVICE_MODEL 获取可用属性与范围。get 或 set 命令完成查询或控制。问题:无法登录或提示认证失败
删除认证文件重新登录:
rm ~/.config/mijia-api/auth.json
python -m mijiaAPI --list_homes
检查网络连接是否正常
确认米家APP账号和密码正确
问题:找不到设备
-l 命令查看准确的设备名称问题:不知道 did
python -m mijiaAPI -l 列出设备,在输出中找到设备的 did 字段问题:属性设置失败
--get_device_info DEVICE_MODEL 获取属性信息)问题:想知道某个设备都有哪些属性
--list_devices 获取 DEVICE_MODEL,再用 --get_device_info DEVICE_MODEL 获取属性信息,例如:
python -m mijiaAPI --get_device_info yeelink.light.lamp27
管理和控制小米/米家智能家居设备的 Skill,兼容 openclaw 或 Claude Code 等智能体环境,支持设备发现、开关控制、亮度调节、颜色设置等功能。
.
├── SKILL.md
└── README.md
将本仓库放入技能目录即可使用:
git clone https://github.com/dean2021/mijia-device-manager ~/.openclaw/skills/mijia-device-manager
如果是手动下载压缩包,解压后将目录移动到:
~/.openclaw/skills/mijia-device-manager
在 openclaw 对话中,直接用自然语言描述你要控制的米家设备。只要需求包含“控制设备”“查询设备列表/状态”“调节亮度/颜色/色温”等意图,就会触发该技能。
推荐触发方式
示例