Home Asssistant Xiaomi Mijia LYWSD03MMC Temperature and Humidity Sensor Tutorial September 2022

Hi

I already had 6 Miia sensors working with the custom FW and recently I adquired a new one to substitute and older and less precise sensor. I followed the process and updated to the last BT Custom FW (5.0) but when trying to calibrate the sensor adjusting the offsets, I cannot find this option in this FW version. How can I adjust the temperature readings in this FW version?

The screenshoots shown in the first post are for older version of the FW

Edit: I include the differents screens I’m getting from different FWs
The first one is from the 4.5 version

The second one is from the V5.0

Sensor settings → Zero offset

Ok, but if I get the values from the device, the original value is -45. Do I have to add my offset to that belt value? Is it in °C?

This is actually important! Always use use the Disconnect button in the Telink flasher when finished flashing or updating parameters! It will unpair the BT device and frees it up to do BLE advertising again (and thus be seen/updated in HA).

You can easily detect if the device is still paired by looking at the Bluetooth symbol (upper right on device’s display)—if it’s on, you’re still paired, if it’s off, you’re unpaired and it will do BLE advertising.

Note: As long as the device is paired, it’ll eat up the battery quickly!


Hint 1: To save cost, Chinese factories try to leave out any component the can get away with (I guess it was a cap in this case), resulting in sometimes flakey behaviour. On some HW revisions, expect a very jumpy battery level indication at battery levels below ~40%.

Also, never try to flash it below said 40% battery level! Always use a (relatively) fresh battery.

For instance, I have my bedroom thermometer ~10m away from the next ESPHome BT Proxy, and it has to go through 3 walls. Below ~30% battery level it starts getting jumpy like hell. I’ve set my “battery low warning level” at 10%, so it gives me many battery low warnings…

On the other hand, these are quite nice cheap little devices that work well and can be astonishingly precise. I use PVVX firmware 5.1 with BTHome protocol over BT LE 4.2, usually not modifying the FW defaults (much). My average battery life, using a quality CR2032, is typically 6+ months, even for the ones in the fridge (!) and outside in the patio.


Hint 2: Don’t try to use BT 5—it’s simply not worth the hassle. Phone, tablet, computer, BT adapter or HA might not support it, and you’d have to reset it to BT 4.2 anyway.


Hint 3: I find that the “ready-made project” ESPHome Bluetooth Proxy and the BT Proxy functionality built into some Shelly products work very well. My HA server is a few rooms away (Proxmox LXC) and has no BT adapter.

Note: If you don’t try to “adopt” or “take control” of the ESPHome BT Proxy, it will suggest and perform updates via the HA UI whenever the ESPHome Builder changes—a nice feature.

3 Likes

Crash Course: Enabling/disabling entities

Newer PVVX firmwares (5.x+) added several new sensors. I don’t really know what these are for, and it’s sometimes a little hard following PVVX’s docs.

I’d suggest deactivating the following, if you don’t need them. It’ll keep HA’s history database from saving unneeded history data, keep it smaller, and reduce wear and tear.


Enable Signal Strength sensor

The signal strength sensor is disabled per default. Follow these steps to enable it (disregard my extra sensors from the wonderful Battery Notes):

Et voilà! A working signal strength indicator!

Note: It can take up to a few minutes until the first sensor reading appears. If in doubt, refresh the web page (F5 or Ctrl+F5 to also clear the browser cache).

You can use the reverse to deactivate unneeded entities, like those shown in the beginning of this post. Just switch them off.

I’m using PVVX custom firmware on LYWSD03MMC. Is there an option to reduce readings resolution to only 1 decimal? Now readings are with 2 decimals

Not within the sensor. Typically you collect data at whatever precision it’s offered, then change the way it’s displayed in Home Assistant.

Within Home Assistant you can click on a sensor and change its display precision. You may need to find the sensor in developer tools.

In HA, yes: