Xiaomi LYWSD03MMC BLE Temperature and Humidity Display

In terms of bluetooth LE range, what would be better? Pi Zero W or ESP32?
How about ESP32 with an external antenna?

Anyone got this working on a RPi2? As it does not have a default bluetooth adapter. Thanks!

Hi @KoalaBear, There is no straightforward way to do this on RPi 2. You would need an external BLE adapter of course. You might like my later solution Interfacing Xiaomi LYWSD03MMC to HA using ESP32 that uses and ESP32 instead.

Thanks @Beantree

Sad that it is not supported. OK, I’ll ask my brother, he has some experience with ESP32/Python.

Does a single ESP32 supports multiple sensors? (4 for me). Thanks again! Also this would be my first not-out-of-the-box thing :slight_smile: Looks like that is how it is supposed to work, hopefully it can pickup the sensors through 2 walls :slight_smile:

A single ESP32 supports multiple sensors. Good luck!

Hi, Tony
thanks for your help, I worked perfectly with an ESP 32 and I have 6 connected Xiaomi devices
Query:
It happens that after a few hours you lose the connection and you have to reconnect the ESP32, I don’t know if the same thing happens to you?

How can I put the time of the last reading on the card?
I want to see the same data that appears when you click on the sensor but on the dashboard card

Thank you

Captura de Pantalla 2020-07-13 a la(s) 20.59.09

This might help you. Last_updated State and last-changed in Lovelave

Can you help me with this repository https://github.com/AnthonyKNorman/ESP32_GPS
I couldn’t find it on this site. If you can help I will send you equipment being used and software problems. Thank you for your consideration.

Here is an easiest way to get the bind key for the Xiaomi LYWSD03MMC sensor. I used a mobile phone.

  1. Keep the Xiaomi Mijia LYWSD03MMC sensor close to the mobile phone.
  2. On the mobile phone, make sure that the bluetooth connection is enabled.
  3. Using the mobile phone’s browser, navigate to https://atc1441.github.io/TelinkFlasher.html.
  4. Enlarge the mobile phone’s screen for better readability.
  5. Now, click the [Connect] button and wait until it shows “Connected.” See the Log section at the bottom.
  6. Once connected, click the [Do Activation] button and wait until the “Mi Bind Key” shows the information.

Source: https://www.youtube.com/watch?v=NXKzFG61lNs at around the 11:40 mark.

4 Likes

If you found that video, use the updated firmware so you don’t need the encryption key anymore. I flashed 4 of them, and they report great using openmqttgateway on an esp32.

ESPHome 1.15 is released yesterday which means support is now in stable!

So there are 2 ways to integrate the sensors:

  1. Custom fork of the Xiaomi Mija BLE integration with Bind Key (which has become quite easy to get in the meantime, even without installing an unknown apk)
  2. Flashing another firmware without needing Bind Key and installing another custom module (openmqttgateway)

So there is still no way to integate it into basic installation…? A custom module is required anyway. Right?

AFAIK, yes, however,

openmqttgateway works too without custom firmware, the orginal firmware works without bindkey, but it connects to the LYWSD03MMC (just as the Custom fork of the Xiaomi Mija BLE integration with Bind Key ) and that has negative impact on the battery life.

This works brilliantly

Is there any way to use the LYWSD03MMC with Home assistant directly (over BLE) without needing to use an ESP with ESPHome?

My Home assistant box already has Bluetooth and I’d rather not dedicate a ESP32 to act as a relay if I don’t need to.

1 Like

Ble_monitor can be used for this, without the need of an esp32. Can be installed via HACS. Works with standard and custom firmware.

2 Likes

I have noticed, that with custom firmware, you have to use “Advertising Type: Mi Like” or ble_monitor / HA won’t find LYWSD03MMC devices.

1 Like

BLE monitor supports both Mi Like and custom advertising type now

1 Like

Maybe it’s a stupid question and maybe it was answered already but I need to have 100% certain about it. Will this work with Raspberry Pi 4 (4 or 8gb)? I ask this because of the bluetooth connectivity. When I first saw this sensor, I got the impression that I must have an ESP32. So, is the raspberry pi capable of supporting this?

Thanks!

Yes, this wil work. I have a raspberry 4 and two LYWSD03MMC sensors. They work fine with BLE monitor. Note however that the Bluetooth range of a raspberry is limited. My sensor is at approx 5 meter with 2 walls in between. and works fine. But a sensor at the second floor is not working, probably due to the reinforced concrete floor. So it depends on the location (and structure of your walls/floor)