Adding Xiaomi Miio devices to Home Assistant. Xiaomi air purifier example [zhimi.airpurifier.m1]

Igor Mullin
3 min readSep 5, 2021

--

Today we will add xiaomi air purifier (zhimi.airpurifier.m1) to the smart home. The article will also be interesting for those who want to add other xiaomi miio devices from this manufacturer.

This is a translation of my article in Zen. Also, do not forget to read us in other services: Instagram, telegram (RU, EN, DE). Medium, LiveJournal, YouTube.

Earlier in the article, I described the addition of devices from Xiaomi. And if you did everything then, you do not know that xiaomi has updated the applications and the old method does not work yet. Mi home has been updated, new features and problems have appeared, now it will not be easy to find out device tokens. The manufacturer also hid engineering access to the hub. Obviously, everything is being done to prevent users from using alternative systems and working through Chinese clouds. However, enthusiasts have also released a new tool for extracting hidden features. Let’s use it. We will need a program from GitHub. The copy is also here in my cloud. We launch it and see the login window to the mi account. We fill in and get into the window where the tokens of all devices, including gateway, are presented.

Now go to home assistant → integration → select Xiaomi miio and enter the ip address and token of the required device

If you have done everything correctly, a new Air cleaner device will appear. Unfortunately, we do not have access to dust data and control options. We can only turn the device on and off.

For some, this will not seem quite enough, but I do not touch the cleaner at all 90% of the time, and for the standard automation “turn off if the window is open” this is sufficient.

And that’s all, subscribe, likes, repost…

--

--

Igor Mullin

I´m a Hardware and Software Engineer and a PhD. In my professional activity I focus on such things like smart home systems and electric development.