Xiaomi Mi Air Purifier 3H

Tags: #<Tag:0x00007f7393d05e18>

I have the same problem with the Xiaomi Mi Air Purifier 3H. home assistant does not detect this device. I also tried to install as a custom component but still gives an error and does not appear in the list of devices

I found in GitHub that is going to be supported in 0.109


Is it possible to get graphs of the AQI or other stuff from the purifier like temperature and humidity?

is there a way of getting the 3H temperature/humidity etc on a Sensor/History Graph card?

With the 109 release, what is the way to integrate the 3H into HA?

Like this:

  - platform: xiaomi_miio
    host: YOUR IP
    token: YOUR TOKEN
    model: zhimi.airpurifier.mb3

Using template sensors you should be able to do that.

Thanks, thought it would be a sensor but after changing that to fan, entities showed up.

How is this working for everyone? Looks like connection to the 3H is somewhat intermittent


Heard from other they experience the same. Ping response times to the unit are very high and a lot of drops. Appears to me the esp32 is very busy, not always able to respond to queries.

I’ve been waiting for this integration for four months, but I am absolutely unable to make it work with my Air Purifier 3 (zhimi.airpurifier.ma4).

My configuration.yaml is like this:

  - platform: xiaomi_miio
    name: Purificador Salón
    token: secret_token_removed
    model: zhimi.airpurifier.ma4

And the logs:

INFO (MainThread) [homeassistant.components.fan] Setting up fan.xiaomi_miio
INFO (MainThread) [homeassistant.components.xiaomi_miio.fan] Initializing with host (token 91977...)
WARNING (MainThread) [homeassistant.components.fan] Setup of fan platform xiaomi_miio is taking over 10 seconds.
ERROR (SyncWorker_2) [miio.miioprotocol] Got error when receiving: timed out
ERROR (MainThread) [homeassistant.components.xiaomi_miio.fan] Got exception while fetching the state: No response from the device
INFO (MainThread) [homeassistant.setup] Setup of domain fan took 21.2 seconds.

The entity appears in HA, but always as “Not available”:
If I click on the gear icon, I get a message stating that this entity has no unique ID.

Is there anything I’m doing wrong?

Thanks and regards.

Edit. My “pings” are perhaps too high but never lost

Ive got the 3H working now and don’t get dropouts. Mind you it is 2 metres away for the AP. Pings are pretty bad however.
Pinging with 32 bytes of data:
Reply from bytes=32 time=115ms TTL=255
Reply from bytes=32 time=443ms TTL=255
Reply from bytes=32 time=57ms TTL=255
Reply from bytes=32 time=177ms TTL=255
Reply from bytes=32 time=4ms TTL=255
Reply from bytes=32 time=114ms TTL=255
Reply from bytes=32 time=32ms TTL=255
Reply from bytes=32 time=54ms TTL=255
Reply from bytes=32 time=381ms TTL=255
Reply from bytes=32 time=299ms TTL=255
Reply from bytes=32 time=217ms TTL=255

yep I’m also seeing timeouts but not as frequently as you…

@aluisperezh you might want to hide your ip address and token?

Both are already hidden :slight_smile:. But thanks anyway…

Mine is hardly 1 meter from the AP:

Respuesta desde bytes=32 tiempo=86ms TTL=255
Respuesta desde bytes=32 tiempo=608ms TTL=255
Respuesta desde bytes=32 tiempo=511ms TTL=255
Respuesta desde bytes=32 tiempo=4ms TTL=255
Respuesta desde bytes=32 tiempo=107ms TTL=255
Respuesta desde bytes=32 tiempo=114ms TTL=255
Respuesta desde bytes=32 tiempo=130ms TTL=255
Respuesta desde bytes=32 tiempo=430ms TTL=255
Respuesta desde bytes=32 tiempo=328ms TTL=255
Respuesta desde bytes=32 tiempo=143ms TTL=255

Just to clarify: what token do I need to put in the “configuration.yaml” file? I was thinking that it should be the Purifier token, but by reading the instructions it seems it points to the gateway token.

I tried both of them without luck, anyway :cry:

Not sure what you mean by purifier token or gateway token. The token is in the ‘token’ field of the logs you retrieve from the app on your phone. Check https://github.com/Maxmudjon/com.xiaomi-miio/blob/ed0428f96ab3fdaa26fffacd864681c9496aa267/docs/obtain_token.md for details


I have the same issue.
Did you find a solution?

you could download the mi hack app and use that. Go in network info and get the token

1 Like

Also I managed to find this nice guide on how to get the other sensors to appear.

However in mine I had to tweak the layout and some of the spacing to get it to work

  - platform: template
        friendly_name: "PM2.5" 
        unit_of_measurement: 'μg / m³' 
        value_template: "{{state_attr ('fan.air_purifier', 'aqi')}}"
        friendly_name: "Temperature" 
        unit_of_measurement: '° C' 
        value_template: "{{state_attr ('fan.air_purifier', 'temperature') | float | round (2)}}"
        friendly_name: "Humidity" 
        unit_of_measurement: '%' 
        value_template: "{{state_attr ('fan.air_purifier', 'humidity')}}"
        friendly_name: "Mode" 
        value_template: "{{state_attr ('fan.air_purifier', 'speed')}}"
        friendly_name: "Favorite Level" 
        value_template: "{{state_attr ('fan.air_purifier', 'favorite_level')}}"
        friendly_name: "Motor Speed" 
        unit_of_measurement: 'rpm' 
        value_template: "{{state_attr ('fan.air_purifier', 'motor_speed')}}"

That did the trick :partying_face:. For some reason, my token was wrong. got it using an old MiHome app and it seems it was not right. Or it has changed after I got it…


Hi guys, I have created here a complete card for 3H: Lovelace: Xiaomi - Mi air purifier 3H card. Next step is to translate in something more compact.

1 Like