Xiaomi PM2.5 Air Quality Monitor Component

Tags: #<Tag:0x00007f3f1fdfcf90>

Hi everyone

I would like to share a project that I haven’t seen mentioned on the forum/official documentation. The github user bit3725 has created a custom component for connecting the Xiaomi PM2.5 sensor to HA.

I have successfully setup the component and have integrated it in my custom automation’s. The component works flawlessly for me. I also really like that the configuration is relatively simple and doesn’t require any messing around with serial connections like DIY alternatives require.

The sensor itself is pricey but I haven’t seen anything that does the job as well. It allows for you to immediately see the air quality in the room, is portable and doesn’t require a Xiaomi gateway. The only thing that is annoying is extracting the key from the Mi Home app.

Once again I didn’t create the component and all credit goes to the original author bit3725.

3 Likes

Update: This is now included as a normal component. For those who are interested here is the link.

1 Like

Hey guys!

I was trying to set up the component yesterday and had continuous error messages in HA log:
Platform xiaomi_miio not ready yet. Retrying in 180 seconds. Moreover, after each 3 minutes I also had Timer got out of sync. Resetting errors from Home Assistant core.

The token I used works just fine with my Xiaomi Vacuum Cleaner so I assume this is not the problem. What else can be wrong?

Based on this thread I also started to get interested by the PM2.5 Air Quality monitor, but then I read the following post and decided not to go forward with it:

The article talks about monitor built into Mi2 air filter. This monitor is known to be inaccurate. The monitor mentioned in this thread is a different thing and uses laser and from what I’ve read is accurate. Laser based monitor is built into Mi2 S filter. I own Mi2, Mi2 S and PM 2.5 monitor and have it working with HA.

Would you mind to share relevant part of your configuration.yaml?
The only case I see here is a wrong token, but it works fine with Xiaomi Vacuum robot.

Update: I just found out that component behavior don’t change with token intentionally set wrong. So, probably, my mirobot token is not working here but it is strange as to my opinion all Xiaomi Wi-Fi devices should share the same token. What method did you use to extract valid token?

I found mine PM2.5 Air Quality monitor quite fast and sensitive detecting even small concentrations of things like cigarette smoke or exhaust gases.
Taking into account Xiaomi products usually not overpriced, the $50 device should contain very good sensor. As opposite, sensors embedded to purifiers and other devices usually quite cheap and their performance may be poor.

The reason was a wrong token. Apparently the tokens for Mi Vacuum and PM2.5 are different and the guide for PM2.5 component refers to the instructions for Mi Robot vacuum which made me confused.
I found correct token by installing modified version of Mi Home app for Android which displays token for any device in the network info window.

Hi guys, bit3725 and HA normal component used different platform, but neither works in my test bed. any one got this Air Quality Moitor worked?