Hi, im totally new to HA and have just found my way into this automation section.
I have an xiaomi air purifier pro and want to add these automations lines to my home assistant configuration but dont exactly know which parts of the code that i must change. entity_id: is that the name of the sensor?
You need to change entity_id for the purifier and sensors if you use an external one. If not, just replace both of them with reading from the purifier.
@artkrz Hi thanks for your work. I dont have a xiaomi air purifier but I have a levoit c300 with d1 mini and4 relays to control the fan speed. I tried to change your code but I cant make it work. and I’m on a dead end. If you can, could you help me as it might help someone trying to do a more DIY solution like me in the future. bellow is the code from my air purifier. Is programed to only have one speed on at one given time:
Can someone please advise me how I can create an automation for selecting the “AUTO” operating mode of the Xiaomi air purifier ?
I am unable to create such an automation within the function for “Automation and scenes”, this operating mode function is not offered at all.
I don’t know the YAML code for this either. Only fan speeds and favorites are there.
I have 2 such purifiers at home, model “zhimi.airpurifier.mc1” (2S) and model “zhimi.airpurifier.mb3” (3H).
I don’t know how to handle it at all, I don’t know if the integration is loaded correctly.
The whole point is not to use built in Auto mode! My automation works by controlling the air purifier’s Favourite level. If you don’t know YAML just use GUI and after You create new automation (that’s empty) switch to YAML mode and copy paste it, then switch back to GUI.
I guess at this point my code could be transferred into blueprint but I do not have time to to this now, sorry.
But my Xiaomi air purifiers do not react to changing the “Favorite Level” in H.A., or the purifier beeps when changing, but stays in the previous mode.
There is nothing to “Favorite Level” in the app, I can’t see anything through the control panel either.
I would need to be able to set the cleaner’s mode in H.A., th. “AUTO”, or “NIGHT” or “TURBO” etc… In the integration description these modes are mentioned, but I don’t even have them in the panel in H.A…
Use service fan.set_preset_mode and set the preset_mode to Auto. Similarly you can set other modes supported by your air purifier like Night and Favorite. You can use yaml as well as GUI.
- service: fan.set_preset_mode
target:
entity_id: fan.xiaomi_air_purifier
data:
preset_mode: Auto