Bring Xiaomi Bluetooth Mesh Devices into Home Assistant: Xiaomi Miio, Xiaomi Miot Auto, and Xiaomi Gateway 3

Bring Xiaomi Bluetooth Mesh Devices into Home Assistant: Xiaomi Miio, Xiaomi Miot Auto, and Xiaomi Gateway 3


If you are a fan of Xiaomi Bluetooth Mesh devices, you might have encountered some challenges in bringing them into Home Assistant. This is because the protocol is proprietary and not well-documented.

But don’t worry, the Home Assistant community has come up with some amazing integrations to make your Xiaomi Bluetooth Mesh devices work with Home Assistant. In this article, we will compare 3 of these integrations and help you decide which one is the best for you.

Integrations

  1. Xiaomi Miio (official Home Assistant integration)
  2. Xiaomi Miot Auto (HACS)
  3. Xiaomi Gateway 3 (HACS)

You can find and install these integrations from the Home Assistant Community Store (HACS) or the official Home Assistant integration page.

TL;DR - Xiaomi Gateway 3 > Xiaomi Miot Auto > Xiaomi Miio

Background information

Bluetooth Mesh device: Mi Home Smart Floor Lamp Mijia device model: intelligent dual-color lamp V2 (MESH) (ftd.light.ftdlmp) Xiaomi server: China Gateway: Xiaomi Smart Multimode Gateway 2 (purchased in January 2024) Gateway version: 1.0.3_0028 HA version: 2024.1.3 HACS version: 1.33.0

Intial setup

I have already paired the lamp with the Xiaomi Gateway 3 using the Xiaomi Smart Home App. Now, let’s see how we can make the lamp shine in Home Assistant! πŸ’‘

Xiaomi Miio

The Xiaomi Miio integration is the official Home Assistant integration for Xiaomi devices. To add the integration to Home Assistant, I need to enter a Xiaomi Account. It sounds promising, right? Well, not so fast. After selecting my lamp from the devices dropdown, an error message popped up! 😱

It turns out that the Xiaomi Miio integration only supports a limited range of Xiaomi devices, and my lamp model is not one of them. Bummer.

Xiaomi Miot Auto

After installing this integration from HACS, setting up this integration is a breeze. I just enter a Xiaomi Account and voila, my lamp is automatically discovered. πŸŽ‰

My lamp is displayed as a light entity with full brightness and color temperature control. Awesome!

Xiaomi Gateway 3

After installing this integration from HACS, setting up this integration is a bit tricky. First, I have to enter the credentials of my Xiaomi Account. After successfully connecting my Xiaomi Account, I have to set up the integration again to connect to my Xiaomi Smart Multimode Gateway 2.

(I have submitted a PR which was merged into the Xiaomi Gateway 3 integration to add support for my lamp model)

After successfully connecting to my gateway, I expect to see my lamp in Home Assistant. But no, my lamp is nowhere to be found?! 😭 After looking into the docs, it seems like my lamp is not supported by this integration either. Luckily, there is a workaround. I can manually write a configuration file for my lamp and add it to the integration.

(I have submitted a PR which was merged into the Xiaomi Gateway 3 integration to add support for my lamp model)

UPDATE: my lamp could be discovered automatically after updating the Xiaomi Gateway 3 integration to the latest version.

Test Data

Now that I have integrated my lamp into Home Assistant using two different integrations, I want to test how well they perform. I have measured the latency of updating the lamp using the Xiaomi Miot Auto and Xiaomi Gateway 3 integrations.

LatencyXiaomi Miot AutoXiaomi Gateway 3
HA -> lamp~3s~0.5s
HA -> Xiaomi App~3s~1s
Xiaomi App -> lamp~1s~1s
Xiaomi App -> HA~15s~1s
Lamp -> HACloud pollingCloud polling
Lamp -> Xiaomi AppCloud pollingCloud polling

As you can see, the Xiaomi Gateway 3 integration has much lower latency than the Xiaomi Miot Auto integration.

But there is more. I have also tested what happens when I disconnect the Gateway from the Internet. To my surprise, the lamp could only be controlled via Xiaomi Gateway 3. The Xiaomi Miot Auto integration stopped working without an Internet connection. 😲

Conclusion

Xiaomi Miio

πŸ‘ easy to set up

πŸ‘Ž supports fewer devices

Xiaomi Miot Auto

πŸ‘ easy to set up

πŸ‘ more supported devices

πŸ‘Ž No local control

Xiaomi Gateway 3

πŸ‘ easy to set up

πŸ‘ supports local control

🀨 fewer supported devices (unsupported devices can be configured manually by writing a configuration file)