Xiaomi Mijia ClearGrass (Qingping)

I have LCD model working on ESPhome and HomeAssistant, but this e-ink does not work.
This guy tried but with no luck:

Hope that someone decodes also this one, it’s screen is WAY better than LCD version.

1 Like

Hey guys! I got the readings with a Node.js app I wrote.
I just dont know how to write the HA component for it. On Monday I’ll be back home and upload the code to Github so you guys can check.

There you go, guys. Just have to change your MAC Address and it should be good to go.
Now, if someone knows how to turn that into a HA working script, that would be awesome.

1 Like

Thanks for sharing. Good YT vid

Thanks for sharing this. Seems relatively simple code.
I hope this can translated to C and be adopted into esphome.
Seems it was already raised as an enhancement request for esphome

OpenMqttGateway has already support for this devices…


1 Like

That is great to know but unfortunately that involves adding a new BT device such as a Arduino or ESP8266 in order for it to work.
The main goal is to have it reporting directly to HA, since most of us running on Raspberry Pi have bluetooth capabilities.
I am actually quite surprised no one wrote the component until now. I provided the whole code working. :frowning:

would be nice to have direct support

I created two PoC scripts for getting data from these new Xiaomi sensors:
https://github.com/andras-tim/poc/tree/master/bluetooth

But, I don’t know (yet), how can I easily integrate into Home Assistant. I think I will check the mitemp_bt module for the base, but not now.

So, feel free hacking! :wink:

This PR adds support for this device into ESPHome, it’s been merged a few days ago :wink: https://github.com/esphome/esphome/pull/664
[edit: I was wrong as pointed out by @1technophile , this PR adds support for the eInk display Clock with temperature/humidity sensor, and not the Cleargrass round eInk sensor.]

This PR add support for LYWSD02 ; the clock with temperature and humidity, not for cleargrass which is providing temperature and humidity only. Cleargrass can be seen as an improved version of Mi Jia with a smaller temperature range.

Thanks for the clarification! I wish that the Xiaomi Ecosystem’s device naming convention would be as good and straightforward as their products are! :slight_smile:

3 Likes

I registered 2 new feature request to HA:

Feel free to vote these up :wink:

Here you go

4 Likes

@kalininandrey Thanks for sharing!

Tried this with 2 pcs of CCG1 Clear Grass
Working almost* fine,

*One of sensor I’ve placed to far from my Rpi4, so in future I will need to add some ESP32 with ESPHome to link via WiFi, and when CGG1 is out of range, the last available reading is cloned every time as result.
How I can fix it to record something like “unavailable” instead? to be sure that I’m get a correct reading (sensor in range)

Sorry, I’m not a real hass guy, I just mixed together mitemp_bt code with the code by @andras-tim.

I don’t this it’s possible now, this limitation affects all similar sensors (like mitemp_bt, miflora, etc). Maybe you should ask someone on forum who really know how to write sensors.

Anyone else who has the problem that the device stops reporting after some time? After a HA restart reporting continues. Don’t know if its the integration or the device.

A LYWSDCGQ BT sensor works perfect.

I have all 4 Xiaomi devices working perfectly.

Only LYWSD02 is having problems some times but I think there is problem with range. I f I put it closer to ESP32 it works also perfectly.

Does anyone know the update rate of these sensors? Or at what temperature difference they send the new value?

@Roeland54 about 20-25 readings per minute (in case of BLE advertisements).

I came across this topic in search of information on ClearGrass CGD1.
If for someone the question is still relevant, then here is a custom component with CGG1 sensor support (and some others from Xiaomi ecosystem).

1 Like