Board randomly receiving BT info from Xiaomi devices

Running ESPhome with a AZ delivery ESP32 board. Setup went fine, and it it running with 3 Xiaomi (lywsd03mmc) humidity/temp sensors. I flashed 2 of them with alternative firmware (ATC, pvvx). And configured them to sent an update every 5 and the other one every minute.

But when I look at the devices in HA, the information is received randomly. Sometimes it even takes one hour before the next update. And this happens with all 3 of them. Useless when you need to control a fan in the shower.

This can be due to several factors:

  • distance between the Lywsd03mmc and the esp32
  • antenna used of the esp32
  • advertising interval not suited with the scan frequency of your ble scanner
  • tx power of your lywsd03mmc but I’m not sure this one can be set

In your case I would try to reflash the Lywsd03mmc with the default interval first. See if it works and increase step by step.
You could also check the scan frequency of esphome.

Also keep in mind that HA only update a sensor when there is a change in the values coming in.

Good point about the scan frequency, have to figure that out.

Edit:
image

Not sure, but I guess every minute receiving date, shouldn’t be a problem

Well that goes wrong here. As the values that should be received are different from the ones in HA at that moment.

Are these the default parameters?

Did you try this @Geeforce ?

As said I have 3 of them, all have different firmwares. Stock by Xiaomi, ATC and PVVX. And only pvvx is configured to sent an update every minute, the other ones (even stock) use 5 minutes interval. And with all 3 of them the data is received completely random. Just checked one, and now even the last update was more then 2 hours ago.

I also have 3 of the Xiaomi BLE sensors in my appartment, all with PVVX default values. (If I remember correct they actually advertise every 10 seconds by default, but maybe that changed or my memory could be faulty)
I use a Wemos D32 as a dedicated BLE tracker and while not every sensor updates every 10 seconds in HA, all of them at least update every minute. (but yeah, kinda random intervals because BLE and Wifi use the same antenna and the poor ESP32 is constantly switching between receiving on BLE and sending on Wifi).
I would try it with the sensors right next to your BLE tracker to see if range is the issue. AZ Delivery isn’t known for having good electronics, so my next test would be with another ESP board.
Also, if you’re using a Raspberry Pi for HA, it might be a good idea to use the onboard Bluetooth…

@MichielioZ
Thanks. I start to think it is the board. Which D32 do you use? V1 or pro v2? Going to buy one.

Any suggestions for replacing my AZ Delivery board?

I looked at the Wemos Lonin D32 v2 pro, seems a bit old old with ch340 usb2ser. cp210x would be better, if I should believe Internet.

Or is that wemos lolin D32 really a good choose?