Set Bindkey for Xiaomi CGDK2
Copyright: Aaron Christophel / Atc1441 https://ATCnetz.de

Modified by Zaluthar to support setting the bindkey for Xiaomi CGDK2, for method see ESPHome Xiaomi BLE site.
The only functions setup and tested are 'Connect', 'Do Activation' and 'Mi Bind Key'.
Warning: The new bind key will work with ESPHome, but the Mi Home app will not recognise the sensor anymore once the device has been activated by the TeLink flasher application. To use the sensor again with the Xiaomi Mi Home app, the device needs to be removed and then re-added inside the Mi Home app.






Please select a .bin file you want to flash to a Telink BLE device.

Select Firmware:
Status: waiting for you to connect a device

Temp/Humi: waiting for data, this will not change on devices with custom firmware, only on stock firmware

#enable-experimental-web-platform-features may be needed to read MAC

Device known id:

Mi Token:

Mi Bind Key:


When doing an activation here the device is needed to be activated in the Mi app again when wanted to use there.
Send settings to custom firmware:


Smiley:

Advertising Type:

Sensor display:

Show battery in LCD:

Advertising interval:

Sensor offset:
To set a precise offset use the text input field with FA+offset for Temp and FB+offset for Humiditiy convert an int8 to hex.

Sensor instant Advertising:
To set other values use the text input with FC+temp alarm or FD+humi alarm with uint8_t values. This can be used to get instant advertising if the sensor data changes to fast. Temp divided by 10

Log: