Token导航 LogoToken导航TokenDH.com
开发敏感数据clawhub未标认证来源可访问clear审计提醒

mijia-control米家控

Agent Skill

mijia-control 用于辅助部署、云资源、容器和基础设施运维,适合在 OpenClaw 中需要检查配置、整理部署步骤或排查环境问题时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

6,379

周安装

274

GitHub Stars

公开资料未说明

下载量

2,236
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:mijia-control(米家控)
来源仓库:https://github.com/jasonzhang2015/mijia-control
安装命令:
openclaw skills install mijia-control
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install mijia-control

简介

用于通过小米云 API 控制米家智能设备。

  • 适合在 OpenClaw 中管理智能家居设备如灯、空调、开关等时调用。
  • 通过自然语言指令触发,需结合来源仓库和 README 确认配置方式。
  • 安装命令为 openclaw skills install mijia-control。
  • 使用前请确认权限范围及是否涉及联网或设备控制操作。

SKILL.md

name
mijia-control
description
|
Triggers
开灯", "关灯", "开空调", "关空调", "开浴霸", "我要洗澡", "设备状态",

Mi Home (米家) Control

Control Xiaomi smart home devices and create automations via cloud API.

Setup

Prerequisites: pip3 install micloud

Credentials: ~/.mijia_creds.json (chmod 600)

{"userId":"...", "serviceToken":"...", "ssecurity":"...", "cUserId":"..."}

If login requires 2FA (device trust verification), obtain credentials via browser:

  1. Open https://account.xiaomi.com/pass/serviceLogin?sid=xiaomiio&_json=true in browser with existing cookies
  2. POST to serviceLoginAuth2 with hash password to get ssecurity + location
  3. Follow location URL to get serviceToken from cookies

Device Control

List devices

python3 scripts/mijia.py devices

Read property

python3 scripts/mijia.py get <did> <siid> <piid>

Set property

python3 scripts/mijia.py set <did> <siid> <piid> <value>
# value: true/false for bool, integer for uint8, etc.

Note: Mesh devices (BLE switches) return code:1 on set — this is normal (async confirmation). The command still executes. Verify by reading the property after a 1-2 second delay.

Batch control

Create a JSON file with commands:

[
  {"did": "946635824", "siid": 2, "piid": 1, "value": true},
  {"did": "946633803", "siid": 2, "piid": 1, "value": false}
]
python3 scripts/mijia.py batch /tmp/commands.json

MIoT Spec Reference

Each device has services (siid) → properties (piid). Look up specs at: https://home.miot-spec.com/spec/<model>

Common patterns:

  • Switch/Light: siid:2 piid:1 = on/off (bool)
  • 3-way switch: siid:2/3/4 piid:1 = channel 1/2/3 (bool)
  • AC: siid:2 piid:1 = on/off, piid:2 = mode, piid:3 = target temp
  • Bath heater: siid:2 = light, siid:3 = PTC heater, siid:10 = environment (temp sensor)
  • Water heater: siid:2 piid:1 = on/off, piid:2 = target temp, piid:3 = current temp

Create Automation Scenes

python3 scripts/mijia.py scene_create scene.json

Scene JSON format (see references/scene_template.json):

{
  "name": "回家自动开灯",
  "identify": "homelight_1234",
  "st_id": 8,
  "setting": {"enable": 1, "enable_push": 0},
  "trigger": {
    "key": "event.<did>.<siid>.<eiid>",
    "did": "<trigger_device_did>",
    "model": "<model>",
    "extra": "{\"siid\":2,\"eiid\":1}"
  },
  "action_list": [
    {
      "did": "<target_device_did>",
      "model": "<model>",
      "extra": "{\"props\":[{\"siid\":2,\"piid\":1,\"value\":true}]}",
      "type": "device_ctrl"
    }
  ]
}

Key fields:

  • trigger.key: format event.<did>.<siid>.<eiid> for device events
  • launch.attr_filter: optional conditions (e.g., only if light is off)
  • action_list[].extra: JSON string with props array
  • st_id: 8 = user automation
  • home_id and uid are auto-filled if omitted

Predefined Scenes

🚿 Bath Mode (洗澡模式)

When user says "我要洗澡":

  1. Read bathroom temp: get 927361805 10 1
  2. If temp < 28°C → turn on bath heater: set 927361805 3 1 1 (暖风), target 30°C
  3. If temp ≥ 28°C → skip heater
  4. Turn on water heater: set 965879649 2 1 1, set 43°C: set 965879649 2 2 43
  5. Turn on bathroom light: set 946635824 2 1 true

🐟 Auto Fish Feeding (出门自动喂鱼)

Feeds fish once per day when BOSS leaves home.

Architecture:

  1. OpenClaw cron (every 5min): polls door lock event log via /user/get_user_device_data
  2. If today has an auto-lock event (action=1) AND not fed yet → feed fish → record state
  3. After feeding, all subsequent checks skip immediately (daily dedup)
  4. State file ~/.fish_feed_state.json: tracks last feed date

Components:

  • Door lock events: 智能门锁2 Pro (did: 1175215651), event key 2.1020, action=1 = auto-lock (leaving home)
  • Fish feeder: 智能鱼缸 (did: 2026943875), action siid:2 aiid:1, in:[1] (1 portion)

- ⚠️ Action 参数格式: "in": [1] 而不是 [{"piid":5,"value":1}]

  • Script: scripts/fish_auto_feed.py

Manual commands:

python3 scripts/fish_auto_feed.py              # Normal run
python3 scripts/fish_auto_feed.py --dry-run    # Check without feeding
python3 scripts/fish_auto_feed.py --force      # Feed regardless
python3 scripts/fish_auto_feed.py --status     # Show state

Trigger logic:

  • Polls lock event log for auto-lock (action=1) today → feed fish
  • Once fed, skips all further checks until next day
  • No米家自动化 needed, pure OpenClaw polling

小爱音箱 TTS

Make the XiaoAI speaker say something aloud.

python3 scripts/mijia.py tts <did> "<text>"
# Example: python3 scripts/mijia.py tts 100783118 "你好"

Flow: unmute → play-text → wait → pause playback → re-mute. This prevents the speaker from auto-playing music after TTS.

Important:

  • Speaker may be muted (default state at night) — script handles unmute/re-mute automatically
  • After TTS, always pause playback to prevent auto-music
  • Cloud API cannot control screen UI — returning to clock display requires physical tap or voice command

Token Refresh

Tokens expire periodically. If API returns decode errors or auth failures:

  1. Re-login via browser (same flow as initial setup)
  2. Update ~/.mijia_creds.json with new serviceToken and ssecurity

The ssecurity changes each login. The serviceToken is session-bound.

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

73.34%
按下载量换算1,640

安全审计

VirusTotal

通过

ClawScan

可疑

Static analysis

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills