Xiaomi ClearGrass Air Detector

Hi everyone!

I’ve received today an Xiaomi ClearGrass Air Detector:

And implemented this device as sensor into HA:

As 99% of code is copied from Xiaomi air quality monitor (that sensor doesn’t work natively with this device) - setup is same as https://www.home-assistant.io/components/sensor.xiaomi_miio/

You can find integration here:


thanks so much for your sharing, it worked 90% for me, but the tvoc value is inconsistent with my actual device, in my device it is 2514(crazy), the HA shows around 555. Any ideas?

TVOC value is notified from device in ppb (parts per million).
You can activate ppb in settings and it will be the same.

Thanks for much for the reply, the unit problem has been solved according to your solution ;-).
The recent update of HA seems to fail this custom component, I’ve add the manifest.json file in the folder, but it still didn’t work :[ any ideas?

I have 0.92.1 HA version. All custom_components are currently working without any problems and manifest files.
Any logs? How it is failing?

I’ve re-edited my configuration file, now it works fine. Thanks so much for you sharing.

Thank you for your update.
I came here to check the availability regarding the Xiaomi Air monitoring equipment(Not, clear_Grass but similar equipment like below)

Regarding this equipment, It seems that this is very simmilar with clear_grass equipment And i applied for this Py file But it doesn’t works.( I also changed the equipment name from MODEL_AIRQUALITYMONITOR_S1 to MODEL_AIRQUALITYMONITOR_B1)

Can you please check the any way to use this equipment in HA?

1 Like

I dont have this device to test, but it seems that its 99% similar to this one.
You need to find what parameters your device is offering.
For ClearGrass Air Detector i found by bruteforcing by hands next:
‘battery’, ‘battery_state’, ‘co2’, ‘humidity’, ‘pm25’ , ‘temperature’, ‘tvoc’
Important - they must be in alphabetic order.

If your device cant offer any of that parameters - it will not send any of them.
Try replacing all “co2” words to “co2a” in sensor.py(this may be a real solution). Or if you know how - remove all parameters and start adding one by one.

Has been someone capable to integrate xiaomi miijar air monitor cgllc.airmonitor.b1 as it was suggested in the thread?

For those interested Bogdan make it!. He has updated a version in his github which is working with Xiaomi Air Miija unit like posted in Ted post below. You rock Bogdan!!! Thanks for update the code!


Cool to hear especially because i just ordered one lol

Does anyone know if this device supports automation inside the Mi home app? For example “if co2 rises above 500ppm turn on plug x”.

I cannot find any info online you are my last resort. Thanks for your time

Yes, it seems it has such support. I have this:

Is there someting to change in the configuration.yalm or in the files in custom_components/clear_grass to make the cgllc.airmonitor.b1 work ?

Currently you need to checkout another branch:

Thank you Bogdan for you answer and your work but when I try to integrate this sensor with the files in this branch it doesn’t word.
when I put clear_grass in the plateform in the config.yaml, the verif of the config file doesn’t work, It work when I put xiaomi_miio as name of the plateform in the config file but the sensor is not found after rebooting the server.

Currently there is a pull request for adding this sensor natively to HA without custom_components.
I believe that it will be available in new HA release.

Hi all,
I faced the same problem as Ikari - It work when I put xiaomi_miio as name of the platform in the config file but the sensor is not found after rebooting the server.
You can find log here: https://pastebin.com/K4eY1yYs

Hi Ikari, did you ever get all the values from greengrass into HA? Can’t get the custom component to work and the official integration addad in 0.102 only show pm2.5 and tvoc so i miss co2, temp and humidity.

1 Like

Yes I agree , why official components don"t show co2 and other value?