I wanted two Xiaomi thermometers in Zigbee2MQTT. The first flash reached 100%, the flasher said Update done, and the thermometer showed something like 188e. Bluetooth disappeared. When I put the battery back in, the stock firmware was there again.

Both sensors reported hardware B1.6 and stock firmware 2.1.1_0159. I eventually converted both without a cable. The file I had missed was the signed 0159c intermediate. It is not the stock image with B1.6 in the filename.

The two stock files are different

I tried flashing ATC directly, first in the browser and then from Linux with a small Python port of the web flasher. I also tried the stock image named Original_OTA_Xiaomi_LYWSD03MMC_v2.1.1_0159_B1.6.bin. None of those attempts gave me a verified boot into custom firmware. I was reading Update done as a boot result. The flasher prints it when it sends the last command.

Another owner in issue #702 described the same freeze and return to stock. The useful clue was a later report in #602: flash 0159c, cycle the battery, then flash ATC_v58. The maintainer’s screenshot shows that same 0159c file. It already contains the Xiaomi signature block.

The sequence that worked

I ran this sequence from Linux with the Python port. The upstream browser tool is pvvx’s TelinkMiFlasher. In that tool, connect to the sensor, select the exact file, then click Start Flashing. Use Choose File if the firmware buttons offer different builds. I did not verify the full sequence in the browser. The maintainer also notes that the final Zigbee OTA does not work on macOS.

Work on one sensor at a time and check its hardware and firmware before using these files. I registered each sensor in Mi Home and used Xiaomi Cloud Tokens Extractor to get the values for the stock login:

Flasher fieldExtractor field
Device known idID
Mi TokenTOKEN
Mi Bind KeyBLE KEY

Use the values for that sensor and keep them private.

1. Send the signed 0159c intermediate

Connect to LYWSD03MMC and log in. Send Original_OTA_Xiaomi_LYWSD03MMC_v2.1.1_0159c.bin as supplied. Do not append another signature to this file.

Wait for the transfer to end before removing the battery. I took it out for 10 seconds, then put it back. Both displays went blank, but both sensors still answered over Bluetooth. They still reported 2.1.1_0159, so the version string alone did not tell me whether the intermediate had booted. If Bluetooth does not come back, stop here.

2. Flash ATC_v58 and check the version

Reconnect and log in again. Use the May build of ATC_v58.bin. The stock upload for this file needs the signature block that TelinkMiFlasher adds. My Python port added the same block.

After the transfer, both devices advertised with ATC_ names. A new connection reported V5.8, github.com/pvvx, and hardware B1.1. That last value is how the custom firmware identifies this version of the board. The displays started updating again. This was the first time I could verify that the new firmware had booted.

3. Flash Zigbee and verify a report

From V5.8, send 1141-020a-01403001-Z03MMC.zigbee (ZigbeeTLc 0.1.4.0) using extended OTA. Use the .zigbee file, not the raw .bin image. Leave the battery in during the transfer. This step erases the sensor’s Mi Home data and measurement history.

Enable joining in Zigbee2MQTT. The first sensor joined right away; the second only appeared after I reopened permit join. Its display was already updating, and the solid Bluetooth icon made me think it was still on BLE. ZigbeeTLc uses that icon to show that the sensor has not joined or has lost its Zigbee connection.

Wait for Zigbee2MQTT to identify the device as LYWSD03MMC-z and check for temperature and humidity reports. A device entry can appear before Zigbee2MQTT finishes its interview. I got timeouts during setup, but both sensors eventually sent readings. I did not flash either one again.

One setting I left alone

Zigbee2MQTT let me enter a measurement interval of 120 seconds. The UI showed the new value, but both devices answered 20 when I read it back. The source for this build sets a 60-second ceiling for these sensors. I left both at 20. The measurement interval controls sampling, not the Zigbee report schedule.