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

3 Likes

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:

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

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

image

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:

fan:
  - platform: xiaomi_miio
    name: Purificador Salón
    host: 192.168.1.134
    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 192.168.1.134 (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”:
purif.
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 192.168.1.40 with 32 bytes of data:
Reply from 192.168.1.40: bytes=32 time=115ms TTL=255
Reply from 192.168.1.40: bytes=32 time=443ms TTL=255
Reply from 192.168.1.40: bytes=32 time=57ms TTL=255
Reply from 192.168.1.40: bytes=32 time=177ms TTL=255
Reply from 192.168.1.40: bytes=32 time=4ms TTL=255
Reply from 192.168.1.40: bytes=32 time=114ms TTL=255
Reply from 192.168.1.40: bytes=32 time=32ms TTL=255
Reply from 192.168.1.40: bytes=32 time=54ms TTL=255
Reply from 192.168.1.40: bytes=32 time=381ms TTL=255
Reply from 192.168.1.40: bytes=32 time=299ms TTL=255
Reply from 192.168.1.40: bytes=32 time=217ms TTL=255

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

@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 192.168.1.134: bytes=32 tiempo=86ms TTL=255
Respuesta desde 192.168.1.134: bytes=32 tiempo=608ms TTL=255
Respuesta desde 192.168.1.134: bytes=32 tiempo=511ms TTL=255
Respuesta desde 192.168.1.134: bytes=32 tiempo=4ms TTL=255
Respuesta desde 192.168.1.134: bytes=32 tiempo=107ms TTL=255
Respuesta desde 192.168.1.134: bytes=32 tiempo=114ms TTL=255
Respuesta desde 192.168.1.134: bytes=32 tiempo=130ms TTL=255
Respuesta desde 192.168.1.134: bytes=32 tiempo=430ms TTL=255
Respuesta desde 192.168.1.134: bytes=32 tiempo=328ms TTL=255
Respuesta desde 192.168.1.134: 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

Hi,

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
    sensors:
      air_purifier_aqi: 
        friendly_name: "PM2.5" 
        unit_of_measurement: 'μg / m³' 
        value_template: "{{state_attr ('fan.air_purifier', 'aqi')}}"
      air_purifier_temperature: 
        friendly_name: "Temperature" 
        unit_of_measurement: '° C' 
        value_template: "{{state_attr ('fan.air_purifier', 'temperature') | float | round (2)}}"
      air_purifier_humidity: 
        friendly_name: "Humidity" 
        unit_of_measurement: '%' 
        value_template: "{{state_attr ('fan.air_purifier', 'humidity')}}"
      air_purifier_speed: 
        friendly_name: "Mode" 
        value_template: "{{state_attr ('fan.air_purifier', 'speed')}}"
      air_purifier_favorite_level: 
        friendly_name: "Favorite Level" 
        value_template: "{{state_attr ('fan.air_purifier', 'favorite_level')}}"
      air_purifier_motor_speed: 
        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…

THANK YOU VERY MUCH!!!

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