Xiaomi ClearGrass Air Detector

I still have unit_of_measurement: ‘°C’. I just opened my HA in a different browser and it shows the graphs correctly. That’s not the cache I think.
That rather looks like some issue of clear_grass-ha and xiaomi_miio (I tried to switch all CGS to miio with the same result). I am not a programmer but I looked at the code and they don’t use TEMP_CELSIUS definition from HA like some other integrations do.

HA 2021.12.0 - the integration does not work.

Opened an issue:

Hoping to help someone looking for the answer I couldn’t locate. I just received the Qingping AQ sensor that looks exactly like the one in the first post here. Figured it would be a breeze to integrate, and it was, but not at first. I first tried the Xiaomi Miio integration and that showed my device only by using the China server. However it only showed 1 entity with “Unavailable”.

Today I uninstalled that integration and instead installed the Xiaomi MIoT integration from HACS. The readme can be viewed in English, but the app install dialogue is only in Chinese, so unless you have a problem using the automatic setup (the first choice), then you want to stick with that. It’s pretty apparent the second choice is for when you need to use the Mi Home token because the automatic setup didn’t work.

Once I entered my credentials for Mi Home with the China server selected, my device appeared (Note: I’m in Canada and regardless of the fact that the Xiaomi Miio instructions say that I should use the US server, it will say that it doesn’t find a device on that server. So using the China server is a must with this device it seems). Selecting my device resulted in 8 entities added to HA. No need to even reboot Home Assistant. Just worked right away. No config.yaml settings required.

Only thing I wish I knew how to change is the Air Quality Detector entity. It is showing the Humidity and I would like it to show the AQI if that’s possible. If anyone knows how to fix that, please let me know.

It creates TWO entities:

  1. Of air_quality domain:
    image
  2. Of sensor domain:
    image

Since the 2nd entity does not contain any “battery_charging” info and the whole content looks weird, I decided to keep using clear_grass-ha platform.

Here is a sensor from clear_grass-ha platform:
image

Note that the UoM is “AQI”.
I guess that this is actually a value of “PM2.5” in µg/m3.
And for your question:

AFAIK the device may only measure PM2.5, measuring AQI is not actually a “measuring” since AQI is a “complex” characteristics based on PM2.5, PM10 etc.

1 Like

Switched from Homebridge to HASS because of ESPhome.
Just can’t believe it’s impossible to add in HomeKit the ClearGrass Air Detector with HASS
Tried core_mio, now added with Xiaomi MIoT but it doesn’t expose the sensor to HomeKit…
totally disappointed. In Homebridge it took just 3 minutes counting getting the token…
Can anybody help with that stuff? Begin to regret my migration

Spin up Portainer and add homebridge: https://github.com/MikeJMcGuire/HASSAddons
Quick and easy.

Cant get it working
clear_grass
made custom_components/clear_grass with manifest and sensor files
added in configuration.jaml

# Same as Xiaomi Air Quality Monitor
 sensor:
   - platform: clear_grass
     name: Xiaomi ClearGrass Air Detector
     host: my IP
     token: my token

but after reboot no device / entities are created…
help please, what should i do / fix?
HA 2022.8.6 official image with supervisor…

Now it is possible to connect your device directly to Home Assistant, excluding cloud services, through MQTT.

2 Likes

Does it send battery_level & battery_charging info?

of course

Full data
{
  "mac": "",
  "sensorData": [
    {
      "battery": {
        "status": 1,
        "value": 100
      },
      "co2": {
        "status": 0,
        "value": 543
      },
      "humidity": {
        "status": 0,
        "value": 54.900001525878906
      },
      "pm10": {
        "status": 0,
        "value": 8
      },
      "pm25": {
        "status": 0,
        "value": 13
      },
      "temperature": {
        "status": 0,
        "value": 27.899999618530273
      },
      "timestamp": {
        "value": 1691061672
      },
      "tvoc": {
        "status": 0,
        "value": 699
      }
    }
  ],
  "third_state": 1,
  "timestamp": 1691061672,
  "type": "12",
  "version": "4.1.8_0267"
}
1 Like

Thanks @almirus for sharing this link to the direct MQTT connection! I’ve been able to set it up and even shorten the reporting interval to 1min, worked flawlessly with internet entirely blocked for these sensors.

However ran into a small issue now - they seem to be loosing connection to MQTT and in a weird way too. Latest firmware.

I have three of them, different rooms and MQTT running eclipse-mosquitto. The sensors don’t “drop out” from the MQTT logs, but they just seem to stop sending data. The devices remain powered on, but when I come check on them it says “Disconnected” in Private Cloud. Sending a one-time package and pressing Reconnect usually helps. Haven’t been able to identify a pattern yet and they don’t all behave the same. I would be grateful for any troubleshooting ideas?