← Back to Skills Marketplace
pipluuup

Ha Xiaomi Control

by XB Yan · GitHub ↗ · v0.1.0 · MIT-0
cross-platform ⚠ suspicious
343
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install haxiaomicontrol
Description
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...
README (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
Usage Guidance
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.
Capability Analysis
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.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install haxiaomicontrol
  3. After installation, invoke the skill by name or use /haxiaomicontrol
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
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.
Metadata
Slug haxiaomicontrol
Version 0.1.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is 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... It is an AI Agent Skill for Claude Code / OpenClaw, with 343 downloads so far.

How do I install Ha Xiaomi Control?

Run "/install haxiaomicontrol" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is Ha Xiaomi Control free?

Yes, Ha Xiaomi Control is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does Ha Xiaomi Control support?

Ha Xiaomi Control is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created Ha Xiaomi Control?

It is built and maintained by XB Yan (@pipluuup); the current version is v0.1.0.

💬 Comments