Xiaomi LYWSD03MMC BLE Temperature and Humidity Display

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)

Thanks for the feedback. I will use the sensor near the pi, for now. If I need, I buy the ESP32 later.
Btw, I don’t have the Pi yet, I was thinking about the 4gb version. From what I see is more than enough for home assistant, right? No need for the 8gb.

Yes, sure, they all work fine, 4 gb should be enough for normal installations.

1 Like

Hi Ernst,
How can you connect two LYWSD03MMC sensors to home assistant? Just tried that via Configuration file, but I can only make 1 sensor to communicate with HA successfully. The other one, stays “unknow”.
Here goes the code on the configuration file for the integration of the sensors:

ble_monitor:
  hci_interface: 0
  discovery: True
  active_scan: False
  report_unknown: False
  batt_entities: False
  decimals: 1
  period: 60
  log_spikes: False
  use_median: False
  restore_state: False
  devices:
    - mac: 'A4:C1:38:ED:55:97'
      name: 'WineSensor'
      encryption_key: '1b74335c4fad14e3e7897************'
      temperature_unit: C
      decimals: 2
      use_median: False
      restore_state: default
    - mac: 'A4:C1:38:4A:A4:04'
      name: 'Clarinha'
      encryption_key: 'ffcfb7ac0377fd3deb31c1ab**********'
      temperature_unit: C
      decimals: 2
      use_median: False
      restore_state: default      
      

The config looks ok, although it isnt needed to specify all options. Most of them are optional.

So either the mac or encryption key is wrong (the last should give an error in the log) or there is an issue with the signal strength. The faq on github gives some tips on how to improve the communication. Normally it is just too far away or an SSD attached to you pi in blocking the signal.

Thanks Ernst. Actually it were the encryption keys that were wrong. Configure them a long time ago, and now they were different. Didn’t know they changed over time.
Thanks for you guidance

Normally they only change when you re-add them to MiHome. But good to know it is solved.

Hi guys! This is my first message :slight_smile: . I did the integration with HACS and BLE Monitor… has anyone tried to run automation with this. I cant find a way. I can see the sensor data but it never triggers it . My setup is Xiami sensor → raspberry pi with BT.

Maybe post what you tried. Then we can see what is wrong.

1 Like

Did you enter your encryption key in the configuration options of the device?

Sorry, misunderstood your question. Show us what you have now. You can trigger automations on a state change (e.g. humidity above xx).

1 Like

HI guys! Thanks for help here. I was able to make it work! There was misconfiguration. :zipper_mouth_face: .

I like the Passive BLE Monitor custom component a lot…but Bluetooth coverage from my HA host was not good enough to pick up the BLE updates across my house from the Xiaomi LYWSD03MMC sensors…so I found another inexpensive solution that increased Bluetooth coverage considerably…and now I get reliable updates. Here’s my writeup on the solution: Using Switchbot Mini Plug with Tasmota32 and MQTT as BLE Gateway for Xiaomi LYWSD03MMC Temp Sensors

Nice. I have the same issue in my place so I have a couple of pi zeros doing the same thing.