Xiaomi Temperature & Humidity Sensor Home Assistant Integration (pvvx custom firmware) May 2023

I recently installed the Xiaomi temperature and humidity sensor using the PVVX Custom Firmware. Some information was different from what I found online, so I created this guide. I hope you will find it helpful.

Full guide on my website

Or a video format for anyone who prefers visual content:

Install the firmware

The Xiaomi sensors come with encryption by default. However, utilizing custom firmware can remove this encryption and provide greater configurability options.

Open Chrome and navigate here

  1. Check the “Get Advertising MAC” box and click Connect


  2. Open the Xiaomi sensor and remove, then reinsert the battery to wake up the sensor.

  3. Find your Xiaomi sensor, should be named: LYWSD03MMC and click pair


  1. Click on Do Activation and wait a few seconds for the three fields to fill


  1. Click on Custom Firmware ver 4.2 and then Start Flashing


  1. The flashing process should take approximately a minute or so.

  1. After it finished click on Reconnect and wait for the sensor to connect


  1. Now you can configure the sensor to your liking, such as choosing between Fahrenheit or Celsius.
    For more options refer to the documentation



  1. Make sure to choose the BTHome for seamless integration in Home Assistant


  1. If you made any changes, make sure to click on send config

Integrate Xiaomi sensor in Home Assistant

Navigate to the integrations page

Open your Home Assistant instance and show your integrations.

You should see the Xiaomi sensor integration


Click on “Configure” and then submit.

Congratulations! The sensor has been successfully added to Home Assistant.



very nice! Gonna try it also :slight_smile:

New Firmware - > moving from BLE to zigbee! :wink:

I just converted all my sensors to zigbee, running fine so far.

1 Like

Yeap, I did it yesterday.
Here is my feedback

  1. Do not upgrade the thermometer to the latest Xiaomi firmware (2.01 or something like that) else you have to use USB-TTL interface for flashing and going to a lower version of firmware.
  2. As soon as you got the suitable Xiaomi firmware, it’s a piece of cake for doing the conversion OTA. For some of devices I did it from my mobile.
  3. No need intermediate/transitional firmware anymore.
  4. Take care which telink flasher you are going to use. I was confused with the initial ATC but the correct one is the pvvx (6.9 version these days).
  5. if your zigbee2mqtt version is lower than 1.33.2 the converted devices are not going to be recognized. In my case local zigbee2mqtt is OK but remote/openlumi zigbee2mqtt are 133.1 so far.
  6. if not upgrade is possible then “external converter” is needed. See this link at the bottom for detailed instructions
  7. in my case, the measurements of the converted devices (paired to the reomote coordinators) are not passing through MQTT although are available in local interface.
1 Like

Step 11. Disconnect from Telink Flasher when done configuring. Otherwise the BTHome does not discover the device.

1 Like

I have a similar model rsh-th05 but this method does not work
the model is Tuya Bluetooth Smart Temperature and Humidity Sensor RSH-TH05-Shenzhen RiShengHua Technology Co., Ltd

any idea if battery usage higher or lower with zigbee?

Nice guide. I purchased 15 of those Xiamoi LYWSD03MMC BLE sensors in early December 2023. I was convinced I would get a V2 software which needs manual flashing with soldering/pogo pins and a TTL USB to Serial adapter so I purchased the adapter and some pogo pins to speed up the process.

I purchased the chinese domestic market version and luckily got a v1.x firmware. The aliexpress text was " Note:The sensors is chinese version,when you connect them with mihome app,please change the mihome app location for china mainland,thank you."

So luckily OTA flashing worked no problem.

The spread of 15 sensors is about 2,5,6,2 corresponding to 21.1, 21.2, 21.3, 21.4 degrees celcius. Very impressive. Be sure to cover them with a towel and leave them in a draught/draft free room for 30 minutes before judging the spread. I have not properly calibrated them yet. Iced water or a fertility basal thermometer should give me an accurate offset. A 2nd Gen Shelly bluetooth proxy could handle only 14 sensors but a brand spanking new 3rd Gen had no problem handling all 15.

I set the sensors to 5 seconds advertise and a 24 measure multiplier for two minute updates in Home Assistant. This will probably get 18 months + battery life.

Good luck to anyone pursuing this. It is well worth it.


Thanks for your helpful update. Keen to know how you are getting on and which firmware you selected - Are you using Zigbee as others above?

My use case is similar - I need 11 sensors in total reporting within max. 5 minutely intervals (but preferably more frequently) and +- 0.4C error range and min. 9 months battery life. Your experience above suggests I may finally have a solution :slight_smile:

I have latest HA on a Raspberry Pi 4, various esphome-based bluetooth proxies and Zigbee dongle. Am open to Bluetooth or Zigbee. Very much appreciate any advice you have! Thank you.

I have at least two Zigbee Routers and Shelly Bluetooth proxies per floor. The Zigbee firmware appears to have no way to calibrate the firmware or turn off the smiley. I t seems like a one way flash then flash back if needed with TTL USB Serial I use ZHA which has no way to calibrate / correct the temperature like Z2M has. So I chose thje Bluetooth way considering all that and also the reports of long battery life.

1 Like

Thank you, that’s helpful. Are the Shellies doing their job as BT proxies ok?

Hello. Im having issue after transformation from BLE to Zigbee:( Its not showing temperature and humidity…:confused: Ive searched everything on internet and didnt found solution:(

will report feedback on deconz/conbeeII platform, they just added it

I use it in HA with ATC/pvvx protocol and with esphome as Bluetooth gateway. The only problem is, that sometimes I loose the connection, but the sensor does not go to unavailable… is someone facing the same issue? can be a timeout set for that sensor?

I am experiencing the same problem with the zigbee firmware and am interested in a solution how to deal best with that situation as well

1 Like

here some tip how to work it out - this way this should work also with zigbee:

I have been running one of my many units using the zigbee firmware and it works, but I am not happy that I no longer have the abilities to adjust parameters as I can with the BT firmware. Can someone provide a procedure or link for how to install the BT ir original FW after moving to zigbee?

This is amazing, thank you! I will try it today

I tried this, The BTHome does not discover the sensors. Do I need an extra upgrade to my Home Assistant Green to use Zigbee?

You do need a Zigbee dongle (or an Ethernet Zigbee coordinator)