Anyone hacked Xiaomi Temp sensor with eink display?

Hi

Has anyone hacked Xiaomi Temp sensor with eink display?

I was wondering whether I could you them as a low energy display across the house - they look neat.

Last I heard (in May) in this video people were working on it but no success at the time.

I think it will be soon implemented in ESPhome:
https://github.com/esphome/esphome/pull/664

3 Likes

It is already working here:

But not testet, yet. I do have the same device, but the official app (Android) is not working. How can I set the time???

I think I did see this one having been cracked recently, not sure where it was though.

Too bad. It looks pretty neat as a small display :/.

Here you are https://github.com/h4/LYWSD02-home-assistant

1 Like

Change your country in the app to China and it will work fine.

Hi, iā€™ve managed to get this one working from this guy h4, but my hass instance is getting stuck when i enable this module and restart hass. Why this could be happening?
Sometimes it works for some time and then it stops responsing, after one check, at least i cannot access it thought web ui. Iā€™ve seen it reported temp and hum in the log.

post your log.

Hmm, thatā€™s too bad. I added this custom component to my HA setup today. Hopefully it wonā€™t be putting my HA down. Iā€™ll be monitoring this.
Itā€™s a bit weird you experience such issues as this component is asynchronous and looks ok from the coding point of view (altough Iā€™m not HA integration expert here).
Iā€™m really glad it exists, so I can see the readings in my HA. But what I donā€™t like is the fact it needs a template sensors to get the values separated. Iā€™ll take this code and Iā€™ll try to rewrite it and make it work like the ā€œmitemp_btā€ sensor (round one). Letā€™s see

Why not post an issue on github?

How I get it work with hass.io? Any idea?
I tried to add custom_components directory under config-dir (because configuration.yaml is there), but no success.

What did you put inside custom_components?

Hi!
That lywsd02 directoryā€¦ Actually HA red that directory, tried to start that python code, butā€¦ There was include errors and it uses different Bluetooth library what does not exists at hassio installation. It would be better if this current mitemp_bt code would include that needed protocol (itā€™s little bit different than LYWSDCGQ) for Xiaomi LYWSD02 BLE Sensor.

I use this clock/thermometer with ESP32 running ESPhome. This way is better for me as I can have the RaspberryPi running HASS anywhere and just the ESP must be in the Bluetooth signal range. Also the installation is pretty easy.

I would be more interested in another way of hacking this device - according to Xiaomi you can pair some devices (toothbrush) so they can display some information directly on the clock. This would be awesome to have this clock as universal 7 segment ā€œ88:88ā€ display to use!

Also I would welcome the time sync - the clock is running its internal RTC but it is slowly drifting. Even I have Yeelight lights that act as bluetooth bridge (so I can see the temp reading in Mi Home app even if I am out of range or have bluetooth disabled), the communication is unidirectional - the lights donā€™t connect to the clock and they donā€™t sync the time. As I donā€™t like (and need) to use mi home app my clock is slowly drifting from real time. In the event of DST they donā€™t adjust automatically etc. That is quite a bad product design to be honestā€¦

1 Like

Hey @Atlantis any details on the ESPHome config you used to flash and readout the info from the clock? And the info is than displayed in Home Assistant?

Hi, I use very simple code.
Those 3 sensors appear in HASS (temp+humidity+bluetooth RSSI)

esp32_ble_tracker:

sensor:
  - platform: ble_rssi
    mac_address: 3F:5B:7D:71:XX:XX
    name: "Clock RSSI"   
  
  - platform: xiaomi_lywsd02
    mac_address: 3F:5B:7D:71:XX:XX
    temperature:
      name: "Clock temp"
    humidity:
      name: "Clock humidity"
      
1 Like

You can use GadgetBridge on Android to set the time very nicely.

1 Like

I posted details on how to do this from a Pi on a ticket in github.

Summary,

  • get the MAC using sudo hcitool lescan,
    • note you may need to hcitool hci0 down then hcitool hci0 up the interface, then
  • use gatttool -b 00:00:00:00:00:00 -I
  • in that connect
  • use a web browser groovy console to execute some bit shifting hex magic, then
  • take the output and append
  • in gatttool to the command char-write-req 0x002f the magic value from above.