XIAOMI LYWSD03MMC temperature and humidity sensor ESP32 or HM10

The XIAOMI LYWSD03MMC sensor is a compact and well-finished temperature and humidity sensor.
It is powered by one CR2032 battery, delivered with the sensor.

Affiliated link

This sensor is compatible with:

  • ZgatewayBT

On ESP32, ESP8266 (HM10) or arduino MEGA (HM10).

When using it with an HM10 module, you will need to update the LYWSD03MMC with the ATC firmware following the process described below.

Note that even if you are using the device with an ESP32 I advise to flash the LYWSD03MMC firmware with the process below so as to increase the battery life of the device and enable more frequent polling of data (every minute with the ATC firmware / every 10 minutes without)

The process takes less than 5 minutes and doesn’t require any cable just a laptop or smartphone with Bluetooth BLE activated.

  • Go to Telink Flasher

  • Verify that the LYWSD03MMC is powered and close

  • Click on connect button
    image

  • Select LYWSD03MMC and associate it
    image

  • Once done you should be able to see the temperature and humidity in the browser:
    image

  • Click on “Custom” in advertising type.

  • Click on “Do activation”

  • Click on “Start flashing”

  • Wait until “Update done”

To verify the firmware variant of the device you can remove the battery and put it again, if it shows ATC this means that you have the ATC version, note also that the smiley blink on the modified version.

The sensor data is now accessible on HM10 or every minutes with ESP32

This tutorial is also available in video:

1 Like

Hello @1technophile and thanks for your amazing work !
I’ve just installed the latest version of OMG (v0.9.5) to capture the data coming from my mutiple LYWSD03MMC devices. They are all flashed with ATC firmware and I’m successfully using them in Homeassistant with the bluetooth of the host. My ESP32 device seems to capture the data just fine too but apparently fails at decoding the payload. Here is an example of msg sent from ESP32 to mqtt broker:

{“id”:“A4:C1:38:6B:F7:53”,“name”:“ATC_6BF753”,“rssi”:-74,“distance”:5.270232,“servicedata”:“50305b059b53f76b38c1a40d1004ba00c602”}

As you can see, there is only a “servicedata” field containing raw value. Is this normal ? I was expecting temperature / humidity fields.

Hi @seblz,

I think this is due to the fact that the LYWSD03MMC were flashed with the Mi like option and not the ATC one (the service data message looks like a Mi one).
OMG supported LYWSD03MMC with ATC before the introduction of the MI like advertising data so we support only the custom advertizing format for the moment.

To sum up

  • LYWSD03MMC stock firmware - supported by BLE connection
  • LYWSD03MMC ATC firmware and ATC custom advertising - supported by BLE scan
  • LYWSD03MMC ATC firmware and Mi Like advertising - not implemented for the moment

I have updated the tutorial

2 Likes