百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
H

hass-xiaomi-miot

> 编程语言
开源

通过 miot-spec 自动集成所有小米设备到 HomeAssistant,支持 Wi-Fi、BLE、ZigBee 设备。

6.0K stars0 点赞0 次浏览
访问官网GitHub

工具介绍

通过 miot-spec 自动集成所有小米设备到 HomeAssistant,支持 Wi-Fi、BLE、ZigBee 设备。

Xiaomi Miot For HomeAssistant

English | 简体中文

MIoT-Spec: The protocol specification for Xiaomi IoT devices, is a standard designed by the Xiaomi IoT platform to describe the function definition of hardware products according to the networking mode of hardware products, the characteristics of product functions, the characteristics of user usage scenarios and the user's requirements for hardware product use experience specification.

This component uses the miot protocol to automatically integrate Xiaomi devices into HomeAssistant, and currently supports most Xiaomi IoT devices. And it supports HA Web UI, and you can easily integrate Xiaomi devices into HA without configuring yaml.

Installation

Method 1: HACS

  • First installation

    HACS > Integrations > ➕ EXPLORE & DOWNLOAD REPOSITORIES > Xiaomi Miot > DOWNLOAD THIS REPOSITORY

  • Update component

    HACS > Integrations > Xiaomi Miot > UPDATE / Redownload

Method 2: Manually installation via Samba / SFTP

Download and copy custom_components/xiaomi_miot folder to custom_components folder in your HomeAssistant config folder

Method 3: Onkey shell via SSH / Terminal & SSH add-on

wget -O - https://get.hacs.vip | DOMAIN=xiaomi_miot bash -

# Or

wget -O - https://raw.githubusercontent.com/al-one/hass-xiaomi-miot/master/install.sh | ARCHIVE_TAG=latest bash -

Method 4: shell_command service

  1. Copy this code to file configuration.yaml
    shell_command:
      update_xiaomi_miot: |-
        wget -O - https://get.hacs.vip | DOMAIN=xiaomi_miot bash -
    
  2. Restart HA core
  3. Call this service: shell_command.update_xiaomi_miot in Developer Tools
  4. Restart HA core again

Config

⚙️ Configuration > Devices and Services > Integrations > ➕ Add Integration > Search Xiaomi Miot

Or click:

Add devices using Mi Account:

Starting from the v0.4.4 version, the component has added support for selecting the connection device mode when integrated by account:

  • Automatic: The component will regularly update the devices that support miot-spec in LAN, and automatically use the local connection for the supported devices (recommended)
  • Local: All devices filtered by the integrated configuration will use local connection. If you check the devices that do not support miot in LAN, they will be unavailable
  • Cloud: All devices filtered by the integrated configuration will use cloud connection. It is recommended that miio, BLE, ZigBee devices use this mode

Note: For Local mode, some devices require Home Assistant to be on the same subnet/VLAN. They will not respond to requests from a different subnet. A workaround is to NAT your Home Assistant IP to the device's subnet.

Add device using host/token:

Suitable for devices support miot-spec protocol in LAN

Config Xiaomi Cloud:

Config Xiaomi cloud for the devices integrated by host/token

# configuration.yaml
xiaomi_miot:
  username: xiaomi_username
  password: xiaomi_password
  # server_country: cn # Location of xiaomi cloud: cn(default), de, i2, ru, sg, tw, us
  # http_timeout: 15   # Timeout (seconds) for requesting the xiaomi apis

⚙️ Configuration > Devices and Services > Integrations > Xiaomi Miot > Options > ☑️ Enable miot cloud

Translations

Looking forward to your contribution.

# configuration.yaml
xiaomi_miot:
  language: zh # Using the built-in dictionary, currently only `zh` is supported
  # https://github.com/al-one/hass-xiaomi-miot/blob/master/custom_components/xiaomi_miot/core/translation_languages.py
  translations:
    # Global dictionary
    idle: '空闲'
    busy: '工作中'
    # Dictionary for specifying fan modes
    fan.mode:
      straight wind: '直吹模式'
      natural wind: '自然风'
    # Dictionary for specifying the drying modes of the washer
    washer.drying_level:
      moist: '微湿'
      extra: '特干'

Customize entity

…

Filter entity attributes

Too many entity attributes will make your HA's database very large. If some entity attributes are useless to you, you can configure exclude_state_attributes to ignore them.

# configuration.yaml
xiaomi_miot:
  exclude_state_attributes:
    - miot_type
    - stream_address
    - motion_video_latest

YAML configuration reloading

This component has added support for configuration reloading (to avoid having to restart HomeAssistant instance after a YAML configuration change):

Developer tools > YAML Configuration > YAML configuration reloading > Look for Xiaomi Miot (almost at the bottom of the list)

Supported Devices

  • outlet / switch
  • light
  • ❄️ air-conditioner / air-conditioner-outlet / ir-aircondition-control
  • fan / ceiling-fan
  • bath-heater / heater / thermostat
  • camera / video-doorbell ❓️
  • television / ️ projector / tv-box
  • ️ intelligent-speaker ❓️
  • ️ ir-remote-control ❓️
  • lock / door
  • washer / dryer / fridge
  • water-purifier / kettle
  • ♻️ air-purifier / air-fresh / hood
  • temperature-humidity-sensor / submersion-sensor / smoke-sensor
  • cooker / pressure-cooker / electric-steamer
  • induction-cooker / oven / microwave
  • air-fryer / multifunction-cooking-pot
  • health-pot / ☕️ coffee-machine
  • juicer / fruit-vegetable-purifier
  • ♨️ water-heater / dishwasher / foot-bath
  • steriliser / towel-rack
  • curtain / window-opener / airer
  • vacuum / mopping-machine
  • humidifier / dehumidifier / diffuser
  • air-monitor / plant-monitor
  • bed / blanket / sleep-monitor
  • chair / table
  • massager / magic-touch
  • walking-pad / treadmill
  • toilet / cat-toilet / toothbrush
  • pet-feeder / ⛲ pet-drinking-fountain / fish-tank
  • mosquito-dispeller / germicidal-lamp
  • rearview-mirror / head-up-display
  • ⌚️ watch / bracelet
  • motion-sensor / magnet-sensor ❓️
  • vibration-sensor
  • router / printer

Unsupported devices

This component uses the polling method to obtain the device state, so it cannot listen the events of some devices in real time.

  • Wireless Switch (like: lumi.sensor_switch.v1 / lumi.remote.b686opcn01)
  • Motion Sensor (like: lumi.sensor_motion.v1)
  • Window and Door Sensor (like: lumi.sensor_magnet.v1)

Services

Since the HA support service response has been for some time, this component no longer triggers events starting from v0.7.18.

xiaomi_miot.set_property

service: xiaomi_miot.set_property
data:
  entity_id: camera.isa_hlc7_xxxx
  field: camera_c

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Pythoncustom-componenthasshome-assistanthome-assistant-integration

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言