← 返回 Skills 市场
pipluuup

Ha Xiaomi Control

作者 XB Yan · GitHub ↗ · v0.1.0 · MIT-0
cross-platform ⚠ suspicious
343
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install haxiaomicontrol
功能描述
Control Xiaomi smart home devices via Home Assistant API. Use when user wants to control Xiaomi or Xiao AI devices such as air conditioner, speakers, and lig...
使用说明 (SKILL.md)

Home Assistant + Xiaomi Device Control

Control Xiaomi smart home devices through Home Assistant API.

Configuration

Load configuration from TOOLS.md智能家居 section, or use these defaults:

  • HA URL: http://192.168.31.35:8123
  • Access Token: Read from user's environment or TOOLS.md
  • Xiao AI Speaker: media_player.xiaomi_lx06_3ff3_play_control
  • Xiao AI Command Entity: text.xiaomi_lx06_3ff3_execute_text_directive
  • Air Conditioner: button.miir_ir02_8112_turn_off / button.miir_ir02_8112_turn_on

Control Rules

Xiao AI Speaker Control

When user message contains "小爱同学" or "小爱":

  1. Extract the command after the trigger word
  2. Call HA API to execute text directive

Example:

User: "小爱同学 播放音乐 天后"
→ Execute: text.xiaomi_lx06_3ff3_execute_text_directive with value "播放音乐天后"

API Call:

curl -X POST \
  -H "Authorization: Bearer ${TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{"entity_id": "text.xiaomi_lx06_3ff3_execute_text_directive", "value": "${COMMAND}"}' \
  ${HA_URL}/api/services/text/set_value

Air Conditioner Control

When user message contains "空调":

Command Entity Service
关闭空调 button.miir_ir02_8112_turn_off button/press
打开空调 button.miir_ir02_8112_turn_on button/press
空调 26 度 number.miir_ir02_8112_temperature_for_ir number/set_value
空调制冷 select.miir_ir02_8112_mode_for_ir select/select_option (option: "Cool")
空调制热 select.miir_ir02_8112_mode_for_ir select/select_option (option: "Heat")

Example - Turn Off:

curl -X POST \
  -H "Authorization: Bearer ${TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{"entity_id": "button.miir_ir02_8112_turn_off"}' \
  ${HA_URL}/api/services/button/press

Example - Set Temperature:

curl -X POST \
  -H "Authorization: Bearer ${TOKEN}" \
  -H "Content-Type: application/json" \
  -d '{"entity_id": "number.miir_ir02_8112_temperature_for_ir", "value": 26}' \
  ${HA_URL}/api/services/number/set_value

Available Entities

See references/entities.md for complete entity list.

Error Handling

  1. Connection Failed: Check if HA is running and accessible
  2. 401 Unauthorized: Token expired, ask user to regenerate
  3. Entity Not Found: Verify entity ID in TOOLS.md
  4. Device Offline: Check device status in Mi Home app

Security Notes

  • ⚠️ Access Token is sensitive - never log or expose it
  • ✅ Store token in environment variable or secure config
  • ✅ Use HTTPS for remote HA access
安全使用建议
This skill appears to do what it claims (call Home Assistant services for Xiaomi devices), but take these precautions before installing: - Expect to provide an HA access token (HA_TOKEN) and optionally HA_URL; the skill metadata fails to declare these — verify with the author and prefer a skill that lists required credentials explicitly. - The SKILL.md defaults HA_URL to a specific local IP (http://192.168.31.35:8123) — change that to your HA instance or remove the default to avoid accidental calls to someone else's host. - The SKILL.md references TOOLS.md (智能家居) which is not included; ask where that file lives and what it may contain before allowing the skill to read it. - Review the included scripts/ha_control.py yourself (it's short and readable). It prints HTTP responses (which may reveal device state) but does not log the token. Ensure the runtime environment protects the token (use a secure secret store or environment variable with least privilege). - If you will expose Home Assistant remotely, use HTTPS and a scoped long-lived token. Consider running the skill in a sandboxed agent or with a token that has minimal permissions for the entities the skill needs. If you cannot confirm the missing metadata (required env vars and location of TOOLS.md) or you do not trust the default HA_URL, treat the skill cautiously or ask the author to correct the declarations before installing.
功能分析
Type: OpenClaw Skill Name: haxiaomicontrol Version: 0.1.0 The skill bundle provides a straightforward interface for controlling Xiaomi devices via a Home Assistant API. The Python script (ha_control.py) uses standard libraries to make authenticated POST requests to a user-configured or local IP address (defaulting to a private network range), and the instructions in SKILL.md are consistent with the stated purpose without any signs of malicious intent, data exfiltration, or prompt injection.
能力评估
Purpose & Capability
The skill's name, description, SKILL.md, and the included Python script all describe Home Assistant control and the included entity IDs align with that purpose. However, the registry metadata declares no required environment variables or primary credential even though both the SKILL.md and script expect an HA access token (HA_TOKEN) and optionally HA_URL; this mismatch is unexpected and should be corrected.
Instruction Scope
Runtime instructions and the script only call the user's Home Assistant API endpoints to trigger services (curl examples and a Python helper). They do not reference external network endpoints beyond the HA_URL. Concern: SKILL.md tells the agent to 'Load configuration from TOOLS.md → 智能家居' but TOOLS.md is not included or referenced in metadata — that is an ambiguous external dependency and could allow unintended config lookups.
Install Mechanism
There is no install spec (instruction-only + small script included). The Python script is small, readable, and uses standard libraries (urllib). No downloads or archive extraction occur. This is low-install risk.
Credentials
The skill needs sensitive credentials (HA access token) and optionally a HA_URL, but the registry metadata lists no required env vars or primary credential. The SKILL.md and script expect HA_TOKEN (and use HA_URL, defaulting to a specific local IP). Requiring a token is proportionate to the task, but failing to declare it is a configuration omission that could confuse users and lead to accidental exposure or misconfiguration.
Persistence & Privilege
The skill does not request permanent presence (always=false), does not modify other skills or system config, and does not persist credentials itself. Autonomous invocation is allowed (platform default) but this is not combined with other high-privilege requests.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install haxiaomicontrol
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /haxiaomicontrol 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.1.0
ha-xiaomi-control v0.1.0 – Initial Release - Introduces Xiaomi smart home device control via Home Assistant API. - Supports command-based control for Xiao AI speakers and air conditioners. - Provides entity and service mappings for controlling power, temperature, and modes. - Includes detailed API examples for each supported action. - Adds troubleshooting and security guidance for setup and operation.
元数据
Slug haxiaomicontrol
版本 0.1.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Ha Xiaomi Control 是什么?

Control Xiaomi smart home devices via Home Assistant API. Use when user wants to control Xiaomi or Xiao AI devices such as air conditioner, speakers, and lig... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 343 次。

如何安装 Ha Xiaomi Control?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install haxiaomicontrol」即可一键安装,无需额外配置。

Ha Xiaomi Control 是免费的吗?

是的,Ha Xiaomi Control 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Ha Xiaomi Control 支持哪些平台?

Ha Xiaomi Control 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Ha Xiaomi Control?

由 XB Yan(@pipluuup)开发并维护,当前版本 v0.1.0。

💬 留言讨论