Xiaomi Mijia ClearGrass (Qingping)

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

I also came across this topic searching for software regarding the cleargrass E-Ink display.

Thanks to alexV for providing the nodejs scripts. That made it easy for me to re-engineer the protocol in go :slight_smile:

Hello,
Did someone tried to disassemble this ClearGrass Wifi? Can you share a high res picture of the inside of the product? Does it have an esp8266? If yes, we might be able to upload a custom firmware to it.
Thanks!

Hi,

It looks like FCC did. Quality isn’t great but it could be a start? It looks it has a few TPs, as well as a couple of headers. I can’t really read the silkscreen from the pics, but one header has interestingly 4 pins… :wink:

Firmware can be downloaded via the mobile app, so it should also be possible to get a copy of the binary. Hope this helps!