xiaomi-home
小米/米家智能家居设备控制。通过 MCP Server 工具控制家中的小米设备,包括灯、空气净化器、电暖气、空调、风扇、扫地机器人、窗帘等。当用户提到任何关于智能家居控制的指令时触发,如"把灯关掉"、"开空调"、"净化器调到睡眠模式"、"客厅太暗了"、"家里空气不好"等。即使用户没有明确说"小米"或"米家",只要涉及家居设备控制,都应该触发此 skill。也支持查询设备状态,如"空气质量怎么样"、"家里几度"等。
Best use case
xiaomi-home is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
小米/米家智能家居设备控制。通过 MCP Server 工具控制家中的小米设备,包括灯、空气净化器、电暖气、空调、风扇、扫地机器人、窗帘等。当用户提到任何关于智能家居控制的指令时触发,如"把灯关掉"、"开空调"、"净化器调到睡眠模式"、"客厅太暗了"、"家里空气不好"等。即使用户没有明确说"小米"或"米家",只要涉及家居设备控制,都应该触发此 skill。也支持查询设备状态,如"空气质量怎么样"、"家里几度"等。
Teams using xiaomi-home should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/mijia-home/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How xiaomi-home Compares
| Feature / Agent | xiaomi-home | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
小米/米家智能家居设备控制。通过 MCP Server 工具控制家中的小米设备,包括灯、空气净化器、电暖气、空调、风扇、扫地机器人、窗帘等。当用户提到任何关于智能家居控制的指令时触发,如"把灯关掉"、"开空调"、"净化器调到睡眠模式"、"客厅太暗了"、"家里空气不好"等。即使用户没有明确说"小米"或"米家",只要涉及家居设备控制,都应该触发此 skill。也支持查询设备状态,如"空气质量怎么样"、"家里几度"等。
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.
Related Guides
AI Agents for Marketing
Discover AI agents for marketing workflows, from SEO and content production to campaign research, outreach, and analytics.
AI Agents for Startups
Explore AI agent skills for startup validation, product research, growth experiments, documentation, and fast execution with small teams.
AI Agents for Coding
Browse AI agent skills for coding, debugging, testing, refactoring, code review, and developer workflows across Claude, Cursor, and Codex.
SKILL.md Source
# 小米智能家居控制 你可以通过 MCP Server 提供的工具控制用户家中的小米/米家智能设备。 ## 首次配置 每次收到设备控制请求时,先调用 `xiaomi_auth_status` 检查认证状态。 如果状态为 `not_configured` 或 `not_authenticated`,引导用户完成配置: 1. 告诉用户需要提供小米账号和密码 2. 用户提供后,调用 `xiaomi_setup(username, password, country)` 发起登录 3. 如果返回 `verification_required`,告诉用户查看手机/邮箱验证码 4. 用户提供验证码后,调用 `xiaomi_verify(code)` 完成认证 5. 认证成功后继续执行原始的设备控制请求 如果状态为 `pending_verification`,直接询问用户验证码。 如果状态为 `authenticated`,跳过配置直接操作设备。 ## 可用工具 MCP Server `xiaomi-home` 提供以下工具: | 工具 | 用途 | |------|------| | `xiaomi_auth_status` | 检查认证状态 | | `xiaomi_setup` | 配置账号并发起登录 | | `xiaomi_verify` | 提交二次验证码 | | `xiaomi_list_devices` | 列出所有设备,获取设备 did | | `xiaomi_find_device` | 按名称模糊搜索设备 | | `xiaomi_get_properties` | 读取设备属性 | | `xiaomi_set_property` | 设置设备属性 | | `xiaomi_call_action` | 调用设备动作 | | `xiaomi_camera_list` | 列出已配置的摄像头 | | `xiaomi_camera_add` | 添加/更新摄像头 | | `xiaomi_camera_remove` | 移除摄像头 | | `xiaomi_camera_snapshot` | 摄像头截图 | ## 工作流程 ### 第一步:定位设备 从用户的自然语言指令中提取设备关键词,用 `xiaomi_find_device` 搜索。 例如用户说"把客厅的灯关掉",提取"客厅"或"灯"进行搜索。 如果没有找到,尝试用 `xiaomi_list_devices` 列出所有设备,让用户确认。 ### 第二步:查询设备规格 拿到设备的 `model` 后,需要知道该设备支持哪些 siid/piid。 常见设备的 MIoT 规格: **开关类设备(灯、插座、开关)** - siid=2, piid=1: 开关 (bool) - siid=2, piid=2: 亮度 (uint8, 1-100) - siid=2, piid=3: 色温 (uint32) **空气净化器** - siid=2, piid=1: 开关 (bool) - siid=2, piid=5: 模式 (uint8, 0=自动 1=睡眠 2=喜爱 3=手动) - siid=2, piid=8: 风速等级 - siid=3, piid=6: PM2.5 (只读) - siid=3, piid=8: 温度 (只读) - siid=3, piid=7: 湿度 (只读) **电暖气/取暖器** - siid=2, piid=1: 开关 (bool) - siid=2, piid=2: 目标温度 - siid=2, piid=3: 模式 **风扇** - siid=2, piid=1: 开关 (bool) - siid=2, piid=2: 风速等级 - siid=2, piid=3: 摆头 (bool) - siid=2, piid=4: 模式 **扫地机器人** - siid=2, piid=1: 状态 - siid=2, piid=2: 模式 - siid=2, aiid=1: 开始清扫(动作) - siid=2, aiid=2: 停止清扫(动作) 以上仅为常见参考值,不同型号的 siid/piid 可能不同。如果控制失败,先用 `xiaomi_get_properties` 尝试读取 siid=2 的 piid 1-10 来探测设备支持的属性。 ### 第三步:执行操作 根据用户意图调用对应工具: - **开/关设备**: `xiaomi_set_property(did, siid=2, piid=1, value=true/false)` - **调节属性**: `xiaomi_set_property(did, siid, piid, value)` - **执行动作**: `xiaomi_call_action(did, siid, aiid)` - **查询状态**: `xiaomi_get_properties(did, siid=2, piids="1,2,3,4,5")` ### 第四步:反馈结果 用自然语言告诉用户操作结果,例如: - "已关闭客厅吸顶灯" - "空气净化器已切换到睡眠模式,当前 PM2.5: 35" - "电暖气已开启,目标温度设为 24 度" 如果操作失败,说明原因并建议排查方向(设备是否在线、是否在同一局域网等)。 ## 场景联动 用户可能描述一个场景而非单个设备操作,例如: - "我要睡觉了" -> 关灯 + 净化器睡眠模式 + 电暖气调低 - "出门了" -> 关闭所有设备 - "客厅太暗了" -> 开灯并调高亮度 - "看看门口" -> 截图 + 分析 + 建议联动 遇到场景指令时,拆解为多个设备操作,依次执行并汇报结果。 ## 注意事项 - 操作前确认设备在线(is_online),离线设备无法控制 - siid/piid 因型号而异,失败时用探测方式确认正确的属性 ID - 布尔值使用 true/false,不是 0/1 - 设备 did 是字符串,不要猜测,必须从 list 或 find 工具获取 ## 摄像头与视觉感知 当用户想"看看"某个位置时,使用摄像头截图功能: 1. 调用 `xiaomi_camera_list` 确认有哪些摄像头 2. 调用 `xiaomi_camera_snapshot(name)` 截取图片 3. 用 Read 工具读取返回的图片路径,分析图片内容 4. 用自然语言描述看到的内容,并根据场景建议联动操作 触发关键词:"看看"、"门口有没有人"、"摄像头"、"监控"、"拍一张"等。 如果用户想添加摄像头,引导使用 `xiaomi_camera_add(name, rtsp_url)`。 测试时可用 `mock://文件名` 或 `mock://目录名` 加载本地图片。
Related Skills
Home Inspection Business Operations
Run a profitable home inspection business with real numbers, compliance checklists, and growth playbooks.
Funeral Home Operations & Compliance
You are a funeral home operations and compliance agent. Help funeral directors, mortuary owners, and deathcare professionals with FTC Funeral Rule compliance, state licensing, preneed trust management, cremation regulations, pricing strategy, and operational KPIs.
china-home-appliances-sourcing
Comprehensive home appliances industry sourcing guide for international buyers – provides detailed information about China's major appliances, kitchen appliances, and small appliances manufacturing clusters, supply chain structure, regional specializations, and industry trends (2026 updated).
home-music
Control whole-house music scenes combining Spotify playback with Airfoil speaker routing. Quick presets for morning, party, chill modes.
homeassistant-skill
Control Home Assistant devices and automations via REST API. 25 entity domains including lights, climate, locks, presence, weather, calendars, notifications, scripts, and more. Use when the user asks about their smart home, devices, or automations.
homekit
Control Apple HomeKit smart home devices. Supports listing, discovering, pairing devices, and controlling lights, switches, outlets, thermostats. Use when the user needs to manage HomeKit accessories programmatically. Requires homekit library and paired devices.
AI Home Pricing Strategist (Canada) — Sell Smarter, Not Cheaper
## Getting mixed opinions about your home’s value?
ai-home-pricing-strategist-canada
Analyze and price Canadian residential properties using comps, price-per-square-foot reasoning, market context, and pricing strategy. Use when estimating home value, setting a list price, comparing comparable properties, evaluating sale scenarios, or advising sellers, buyers, or investors in Canada.
home-ctxly
Get your own home on the internet - a profile page with a public inbox at home.ctxly.app
homestruk-tenant-screening
Screen tenant applications using Fair Housing compliant criteria for Massachusetts properties. Use when evaluating a rental application, setting screening criteria, checking an applicant against standards, or drafting acceptance/rejection letters. Covers income verification, credit checks, criminal background (with HUD guidance), rental history, and MA-specific protected classes.
homestruk-rent-comps
Analyze rental comps and recommend rent pricing for Massachusetts properties. Use when user asks about rent pricing, market rent, comparable properties, rent increases, or what to charge for rent. Searches Zillow, Apartments.com, and Craigslist data to find comparable listings and calculates recommended rent based on property features, location, and market conditions.
homestruk-maintenance-triage
Triage tenant maintenance requests by severity, assign priority, identify the right contractor type, estimate costs, and generate work orders. Use when a tenant reports a maintenance issue, when reviewing open work orders, or when assessing property condition. Follows Massachusetts habitability requirements (105 CMR 410).