I’m not sure how to solve it, but I had already noticed that the Xiaomi purifier has a small issue: it provides status as lowercase (auto, silent, favourite), but accepts status setting using capitals (Auto, Silent, Favorite).
This way when the automations compare the value seti in Lovelace with the value reported from Xiaomi, the two don’t match perfectly due to capitalization.
Or at least this was what I got from the error logs, then I temporarily abandoned the issue because I don’t change settings from Lovelace anyway, but I know they one day I’ll have to find out how to solve the issue.
I won’t have access to my server for a while, but try this: stop HA, go to the folder where HA is installed, look for the components subfolder, then for xiaomi_miio, then edit the file fan.py.
In that file look for the text “Silent” (it appears only in few lines) and replace all occurrences of the uppercase Auto, Silent, Favourite with the lowercase equivalents.
Start HA and see if the fan still works and accept the new statuses. The automations should be adapted to also have everything lowercase.
If it works, the Xiaomi component should be updated. If not, the component needs to implement a case conversion.
Hey guys, i have 2 purifiers a 2s and a pro. I cannot get both of them to work at the same time, if only 1 is added it works, the moment i define the second one, the first goes offline.
i define each as a separate entity, do i need to use
fan:
- platform: xiaomi_miio
name: Air Purifier 1
host: Your IP
token: Your token
- platform: xiaomi_miio
name: Air Purifier 2
host: Your IP
token: Your token
Hey guys! Sorry I didnt receive any mails for this post. They made breaking changes so the names of the services have changed and some buttons were no more working. I updated my initial post so now everythings works again!
What never worked for me is the “Fan speed”. When rebooting hass.io it shows the current value but then never gets updated. Someone has an idea for that?
Yes you can have more than one. I have two. Unfortunately you have to duplicate the configuration but set a different name. I tried to keep mine organized by making comments with #.
And then my devices are named fan.air_purifier_2s_bedroom and fan.air_purifier_2s_living_room. You can find the names developer tools -> entity autocomplete.
Maybe I did something wrong, but when I start the application, the favorite mode’s slider is set to 0 (initial: 0) despite of checking the actual value. Is it possible to query its setting and start with that one?
Is there an interest from your side to read the actual value at start and set the slider to that value? Or is there a difficulty to do this?
I can’t fully agree with you. For me it is continuously updated, although it is a bit slow. It takes 20-30 seconds to update, but when I move the slider, the fan speed indicator follows the reality. So I think it is ok (or I misunderstood something).
Last month I’ve bought a brand new Xiaomi Mi Air Purifier 2H (European model) and since then I’m using it with your settings recommendations without any issue. It works flawlessly and I’m very happy.
The problem is my ‘configuration.yaml’ file. It is a real mess and I would like to keep it clean the more I can.
So I’m wondering if I may I use the ‘!include’ function for keep it clean, moving all the “purifier commands” stored in ‘configuration.yaml’ to a new file called ‘mi_purifier_2H.yaml’ (for instance).
In other words, I’m talking about writing a command line (inside my ‘configuration.yaml’ file) as the one below:
fan: !include mi_purifier_2H.yaml
Until now, the best I could was moving the ‘switch:’ command to a ‘switch.yaml’ file and the ‘sensor:’ command to a ‘sensor.yaml’ file.
Instead, ‘fan:’, ‘input_select:’ and ‘input_number’ commands are stored into ‘configuration.yaml’ file.