mijia-control
Control and monitor Xiaomi Mijia smart home devices. This skill allows an AI agent to switch device status, list available devices, run automation scenes, and check environmental statistics.
About this skill
The Mijia Control skill empowers AI agents to seamlessly interact with Xiaomi Mijia smart home devices via a locally encapsulated `mijiaAPI`. It provides agents with the ability to manage various aspects of a smart home environment, from basic device control to advanced scene automation and environmental monitoring. Key use cases include allowing an AI agent to respond to user commands for switching lights on or off, adjusting brightness or temperature, querying the status of all connected devices, and triggering predefined automation scenes within the Mijia ecosystem. Users can also request real-time environmental data, such as temperature or humidity, from their smart sensors. This skill is invaluable for anyone looking to integrate their Xiaomi Mijia smart home into an AI-driven automation framework. It enables more intuitive control through natural language commands processed by an AI agent, enhancing convenience and providing a centralized point of management for smart home functionalities.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/mijia-control/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How mijia-control Compares
| Feature / Agent | mijia-control | Standard Approach |
|---|---|---|
| Platform Support | multi | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | medium | N/A |
Frequently Asked Questions
What does this skill do?
Control and monitor Xiaomi Mijia smart home devices. This skill allows an AI agent to switch device status, list available devices, run automation scenes, and check environmental statistics.
Which AI agents support this skill?
This skill is compatible with multi.
How difficult is it to install?
The installation complexity is rated as medium. You can find the installation instructions above.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Mijia Control Skill (Universal AI Agent Skill) 该技能使 AI 代理能够通过本地封装的 `mijiaAPI` 驱动,接管并控制小米米家智能家居设备。 > **注意**:本技能包内的所有脚本路径均为相对于本文件所在目录。执行时请务必使用**绝对路径**。 ## 快速开始 1. **环境自检**:运行 `<SKILL_ROOT>/scripts/setup_env.py`。 2. **安装/登录**: - 安装:`python <SKILL_ROOT>/scripts/setup_env.py --install`。 - 登录:运行 `mijiaAPI -l`。 3. **执行控制**:所有操作均通过 `<SKILL_ROOT>/scripts/` 下的脚本完成。 ## 决策逻辑 (Decision Logic) - **设备查询**:当用户询问“有哪些设备”、“状态如何”时 -> 执行 `scripts/list_devices.py` 获取实时快照。 - **设备控制**:当用户要求开关、调节亮度/温度等 -> 解析意图 -> 查阅 `reference/device_catalogs.md` -> 执行 `scripts/control_device.py`。 - **场景触发**:用户要求运行场景 -> 调用 CLI 命令执行。 ## 约束建议 (Guardrails) - 对于**窗帘、空调、锁**等涉及安全和昂贵能耗的设备,操作前需口头确认。 - 绝不向用户泄露 `auth.json` 中的敏感 Token。 ## 更多信息 - 详尽 SOP 请参阅 [instructions.md](./instructions.md)。