Qingping cleargrass CGD1 alarm clock with temperature and humidity measurements

Here is an interesting new BLE device from cleargrass; an alarm clock with temperature and humidity measurement with the following characteristics:

Brand ClearGrass (XIAOMI Cooperation Brand)
Model CGD1
Material Plastic
Color Blue / Green White
Weight 106g
Size 80.3 x 41 x 83mm
Screen Size 61 x 61mm
Temperature Range -9.9℃~49.9℃
Humidity Range 0~99.9%
Battery 2 x AA Batteries(Not Include)
Alarm 16 Set
Date Display Day / Month / Year
Date Language Display English or Chinese (Optional)
Temperature Display Support
Humidity Display Support
Bluetooth 5.0
APP Control Mijia APP (Support temperature and humidity linkage with other devices)
Customize Alarm Repeat Mode Support
Snooze Function Support
Backlight Duration Adjustment Off-On For 30 Seconds
Backlight Brightness Adjustment Support
Alarm Volume Adjustment Support
Alarm Replacement Support

It is compatible with the Mi Home app.

You can put it in pairing mode by pressing several seconds the bottom button.
You can search for the device into the app and connect to it.

The app enable to access to firmware upgrade, currently the latest is 1.0.1_0063

You can program the alarm function with the Mi Home app, add severals, change the snooze, choose the intensity and duration of the backlight.

I’m able to read temperature & humidity with OMG like a normal cleargrass device:
{"tem":20.1,"hum":51.2}

This is integrated from this PR:

Here is some pictures:

Got openMQTTgateway version 0.9.4 working in Home Assistant and ClearGrass and mijia temp displays show temp/battery humidity in HA however the CDG1 alarm clock never appears, any pointers? I can see the alarm clock in Xiaomi Mi Home do I need to remove it from there first?

It must be not connected to your smartphone, you don’t need to necessary remove it from the Xiaomi app but the bluetooth connection should be off

turned off bluetooth on the iPhone for 1 hour and nothing appearing

May you indicate the firmware version of the CGD1 please?

You may, the firmware version is 1.0.1_0067

Nothing appears for the Alarm clock in MQTT Explorer but I could be wrong as I am no expect. I see tem and hum for both round Mijia and ClearGrass (e-ink) devices (which appear in HA) but cannot see much for the alarm clock.

Check maybe the history of each topic, it could have been overwritten by the id values.

nothing found of any use

This plugin talks about the CDG1 being encrypted?
CGD1

(Cleargrass (Qingping) CGD1 alarm clock, segment LCD, broadcasts temperature and humidity (once in about 3 minutes?), and battery level (we do not have accurate periodicity information yet), advertisements are encrypted, therefore you need to set the key in your configuration, the procedure is similar to the LYWSD03MMC sensor)

I cannot see my HHCCJCY01 flower care in HA either however that does appear in the MQTT logs. Mi scales appear in HA with the last 2 minutes once I turned them on.

Got this in HA logs

Can't decode payload b'{"id":"c7:0d:35:37:bd:8e","manufacturerdata":"W\x01\x02\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x02\xc7\\r57\xbd\x8e","rssi":-59,"distance":1.01076}' on home/OpenMQTTGateway_ESP32/BTtoMQTT/C70D3537BD8E with encoding utf-8 (for <function MqttSensor._subscribe_topics.<locals>.message_received at 0x7f53eada8b00>)

I finally saw both items in the MQTT logs but nothing in HA? any ideas why they are not appearing in HA?

Manually added this code but it fails to populate

  - platform: mqtt
    state_topic: 'home/OpenMQTTGateway/BTtoMQTT/582D34524F09' # MQTT topic, check MQTT messages; replace AA... with id (BLE MAC) of your device
    name: "mijia_thermometer_temperature"
    unit_of_measurement: '°C'
    value_template: '{{ value_json.tem | is_defined }}'
    expire_after: 21600 # 6 hours

I have 1.0.1_0063 and I confirm it is working:

Now let’s update it

Still receiving data with: 1.0.1_0067

image

To troubleshot it you can go to:homeassistant/sensor in MQTT explorer

You will see the different devices created.

neither the flower or alarm clock appear in MQTT explorer home assistant/#

May you give me different (2 or 3) servicedata extract taken from the sensor 582D34524F09

extract for the missing alarm clock.

{“id”:“58:2d:34:52:4f:09”,“rssi”:-72,“distance”:4.287841,“servicedata”:“080c094f52342d580104f3005101020164”,“servicedatauuid”:“0000fdcd-0000-1000-8000-00805f9b34fb”}

{“id”:“58:2d:34:52:4f:09”,“rssi”:-84,“distance”:13.81901,“servicedata”:“080c094f52342d580104f0005801020164”,“servicedatauuid”:“0000fdcd-0000-1000-8000-00805f9b34fb”}

{“id”:“58:2d:34:52:4f:09”,“rssi”:-72,“distance”:4.287841,“servicedata”:“080c094f52342d580104f3005101020164”,“servicedatauuid”:“0000fdcd-0000-1000-8000-00805f9b34fb”}

{“id”:“58:2d:34:52:4f:09”,“rssi”:-77,“distance”:7.119795,“servicedata”:“3058760599094f52342d5808”,“servicedatauuid”:“0000fe95-0000-1000-8000-00805f9b34fb”}

{“id”:“58:2d:34:52:4f:09”,“rssi”:-77,“distance”:7.119795,“servicedata”:“080c094f52342d580104f9004b01020164”,“servicedatauuid”:“0000fdcd-0000-1000-8000-00805f9b34fb”}

{“id”:“58:2d:34:52:4f:09”,“rssi”:-77,“distance”:7.119795,“servicedata”:“3058760595094f52342d5808”,“servicedatauuid”:“0000fe95-0000-1000-8000-00805f9b34fb”}

{“id”:“58:2d:34:52:4f:09”,“rssi”:-72,“distance”:4.287841,“servicedata”:“3058760593094f52342d5808”,“servicedatauuid”:“0000fe95-0000-1000-8000-00805f9b34fb”}

Updated with more

{“id”:“58:2d:34:52:4f:09”,“rssi”:-75,“distance”:5.832737,“servicedata”:“58587605cc094f52342d587cb22609e40900001945c996”,“servicedatauuid”:“0000fe95-0000-1000-8000-00805f9b34fb”}

{“id”:“58:2d:34:52:4f:09”,“rssi”:-75,“distance”:5.832737,“servicedata”:“58587605cc094f52342d587cb22609e40900001945c996”,“servicedatauuid”:“0000fe95-0000-1000-8000-00805f9b34fb”}

{“id”:“58:2d:34:52:4f:09”,“rssi”:-83,“distance”:12.61001,“servicedata”:“080c094f52342d580104db008101020164”,“servicedatauuid”:“0000fdcd-0000-1000-8000-00805f9b34fb”}

{“id”:“58:2d:34:52:4f:09”,“rssi”:-77,“distance”:7.119795,“servicedata”:“080c094f52342d580104db008001020164”,“servicedatauuid”:“0000fdcd-0000-1000-8000-00805f9b34fb”}

{“id”:“58:2d:34:52:4f:09”,“rssi”:-82,“distance”:11.4949,“servicedata”:“080c094f52342d580104db008101020164”,“servicedatauuid”:“0000fdcd-0000-1000-8000-00805f9b34fb”}

{“id”:“58:2d:34:52:4f:09”,“rssi”:-73,“distance”:4.756481,“servicedata”:“305876051b094f52342d5808”,“servicedatauuid”:“0000fe95-0000-1000-8000-00805f9b34fb”}

{“id”:“58:2d:34:52:4f:09”,“rssi”:-72,“distance”:4.287841,“servicedata”:“080c094f52342d580104db008e01020164”,“servicedatauuid”:“0000fdcd-0000-1000-8000-00805f9b34fb”}

{“id”:“58:2d:34:52:4f:09”,“rssi”:-73,“distance”:4.756481,“servicedata”:“5858760516094f52342d58690e54080a000054eb5db3”,“servicedatauuid”:“0000fe95-0000-1000-8000-00805f9b34fb”}

and here are the extracts for the missing Mi flora

{“id”:“c4:7c:8d:61:7d:ae”,“rssi”:-77,“distance”:7.119795,“servicedata”:“310298000dae7d618d7cc40d”,“servicedatauuid”:“0000fe95-0000-1000-8000-00805f9b34fb”}

{“id”:“c4:7c:8d:61:7d:ae”,“rssi”:-78,“distance”:7.85288,“servicedata”:“310298000dae7d618d7cc40d”,“servicedatauuid”:“0000fe95-0000-1000-8000-00805f9b34fb”}

{“id”:“c4:7c:8d:61:7d:ae”,“rssi”:-78,“distance”:7.85288,“servicedata”:“310298000dae7d618d7cc40d”,“servicedatauuid”:“0000fe95-0000-1000-8000-00805f9b34fb”}

{“id”:“c4:7c:8d:61:7d:ae”,“rssi”:-80,“distance”:9.521558,“servicedata”:“310298000dae7d618d7cc40d”,“servicedatauuid”:“0000fe95-0000-1000-8000-00805f9b34fb”}

{“id”:“c4:7c:8d:61:7d:ae”,“rssi”:-77,“distance”:7.119795,“servicedata”:“310298000dae7d618d7cc40d”,“servicedatauuid”:“0000fe95-0000-1000-8000-00805f9b34fb”}

{“id”:“c4:7c:8d:61:7d:ae”,“rssi”:-62,“distance”:1.429824,“servicedata”:“310298000dae7d618d7cc40d”,“servicedatauuid”:“0000fe95-0000-1000-8000-00805f9b34fb”}

{“id”:“c4:7c:8d:61:7d:ae”,“rssi”:-71,“distance”:3.860897,“servicedata”:“310298000dae7d618d7cc40d”,“servicedatauuid”:“0000fe95-0000-1000-8000-00805f9b34fb”}

{“id”:“c4:7c:8d:61:7d:ae”,“rssi”:-72,“distance”:4.287841,“servicedata”:“310298000dae7d618d7cc40d”,“servicedatauuid”:“0000fe95-0000-1000-8000-00805f9b34fb”}

{“id”:“c4:7c:8d:61:7d:ae”,“rssi”:-72,“distance”:4.287841,“servicedata”:“310298000dae7d618d7cc40d”,“servicedatauuid”:“0000fe95-0000-1000-8000-00805f9b34fb”}

I do not expect a fix straight away but does that explain what is wrong?