Recently, Xiaomi brought out a new specification named MIoT-Spec
. Let’s call it MIoT
for short. It is used to communicate with ALL Xiaomi IoT devices. Compared with the old miio
, this new specification is clear, highly adaptive, and open to all. Thanks to MIoT, nearly all Xiaomi IoT devices can be integrated into HASS in a very easy way. So I worked out this integration.
A list of supported devices: [meta] list of miot-enabled devices · Issue #627 · rytilahti/python-miio · GitHub
(TL/NR: ALL XIAOMI DEVICES!)
Installation
Using HACS (recommended):
- Search for the integration “Xiaomi MIoT” and add it
Manual installation:
-
Download https://github.com/ha0y/xiaomi_miot_raw/archive/master.zip
-
Extract the ‘./custom_components/’ folder to your installation
Configuration
Configure In UI:
- After installation, add
Xiaomi MIoT
in ‘Integrations’ page, just like any other integrations.
(If you can’t find ‘Xiaomi MIoT’ but you are sure you have installed and restarted, this may because of your browser cache. Please try with another web browser.)
If you want to add devices from your Xiaomi account:
-
Select “登录小米账号”. Enter your credientals. Click “submit”.
-
If your devices are not in China server, select corresponding server in “Options”.
-
Add the integration again. Now, all devices in your account should appear in the list. Select the one you want to add.
-
You will see a window with two textboxes and two checkboxes. The textbox describes how device is read and controlled. You don’t need to change them unless you have some special needs. The checkboxes are for “Cloud Access”. Try uncheck them at first and click submit, if fails, check both of them.
-
If “Success” is shown, your device is ready to use!
Or if you prefer to add them by IP and token:
- Select “接入设备”. A form will be shown shown to input them.
Configure In YAML (Deprecated):
- Please refer to these example files
What is “Cloud Access”?
Although Xiaomi has switched to MIoT, device manufacturers seems unwilling to use it. They stick to the old, unopened miio protocol. The device that implements miio instead of MIoT cannot be accessed via LAN. But don’t worry. Xiaomi Cloud is able to convert MIoT commands to miio commands and send them to the device via Internet. With your Xiaomi account, the integration sends commands - instead of to devices - to Xiaomi Cloud, so that all devices can work properly.
You can specify each device whether use Cloud Access or not. Please not that these devives will not work without Internet. Take care when use them in some important automations. To help you tell out devices with Cloud Access, there will be cloud
in their entity ids.
Tested devices
-
chuangmi.plug.212a01 (works perfectly)
-
cuco.plug.cp1 (works perfectly)
-
mrbond.airer.m1t (requires Cloud)
-
leshi.light.wyfan (works perfectly)
-
lumi.acpartner.mcn02 (requires Cloud)
-
dmaker.fan.* (some requires Cloud and some not)
-
zhimi.fan.* (some requires Cloud and some not)
-
zhimi.airpurifier.* (some requires Cloud and some not)
-
deerma.humidifier.mjjsq (requires Cloud)
… and so on
For more information, please refer to xiaomi_miot_raw/README_en.md at master · ha0y/xiaomi_miot_raw · GitHub
If you have any questions or suggestions, please create an issue. You may use both English and Chinese.