Show battery status for Xiaomi BLE plant sensors

Hello,
using the HA with the Xiaomi BLE plant sensor quite new … was running a ESP32 MQTT request integration so far but wanted to switch to a ESP32 BL proxy - two questions ar raising:

Is the BLE proxy / Xiaomi BLE plant sensor Integration only listening to the sensors - and they are sending the values all the time? Or is the Xiaomi BLE requesting the data constantly? Asking because of the battery consumption …

Some plant sensors are not recognized on the Xiaomi BLE integration. They are using the firmware 3.2.2 / 3.3.5 or 3.2.5 Till now I could not find out why some sensors the same brand are recognizes and some are not. Is this known and is there a workaround available?

Thanks for support and a happy new year

Xiaomi BLE integration is polling the battery status once a day, so should not have a big effect on the battery life. All other data is collected with active or passive scanning. To save battery of your sensors, you can change the Bluetooth integration to use passive scanning. This only works if your Bluetooth adapter firmware is up to date and supporting passive scanning. Also note that some (non-Xiaomi) sensors, like Govee, need active scanning, otherwise they don’t send data. Active or passive scanning is a system setting, so one setting per adapter (in the Bluetooth integration), which is used by all BLE integrations like Xiaomi BLE.

Polling = asking a specific sensor for a specific measurement
Active scanning = shouting around to all sensors that can hear it, give me all the data you have
Passive scanning = just listening to data of all sensors, without asking to send the data.

1 Like

many thanks for the reply and explanation.
As now I moved back to my ESP32 → MQTT polling mechanism as this worked on io-broker quite fine. Just struggeling onhow to integrate the sensors in HA. mqtt.yaml is filled but no data receiving. Will need to figure this out.

Hi,

I have trouble to get the battery info

I think that I’m using active Bluetooth

image

any suggestions?

How long have you left it? I believe battery info is only transmitted once per day, or so.

The battery are under diagnostic, and normally disabled by default.

it is running for 2 days now

I don’t see it

Check to and see if they are hidden or try to find them in the Developer Tools.

Nope, I see the same entities

I’m using shelly to scan the ble devices

I have active scanning, maybe it make a difference.

esp32_ble_tracker:

  scan_parameters:

    active: True

battery level does require an active connection to the device.

Hi,

I switched the shelly Bluetooth to active, but I don’t see any difference

what version of HA core are you running?

in case this can help

I recently added my Miflora sensors via the (new) Xiaomi BLE integration. It used for work totally fine and I could see all data including the Battery status. But since recently the battery status on all my mifloras shows as unavailable. However all the other data is transmitted just fine.

I get this message in the battery entity
This entity is no longer being provided by the xiaomi_ble integration. If the entity is no longer in use, delete it in settings.

Not sure if this issue came with the 2023.5 update but it used to work before that.
There has been no update on any of the Sensors (most of them are on 3.3.5)

Also the scanning of the BT integration in HA is on active and I have 2 Shellys which are also on active.

Also what I read is that it only transmitts once per day. What happens when I restart HA (which I have been doing a lot the past days as I installed updates daily). Will this affect it i.e. that after the restart it shows unavailable for some time until the daily battery poll is done? Or would the battery status be polled after a restart automatically?

what is the MiFlora SW version?

I’m my experience, it goes unavailable again. It’s annoying and unfortunate. It’s been commented on by one of the contributes a few times as being “as expected” behaviour.

in my case only 1 out of 4 Flower Sensors has shown the battery status. Now it also stopped to provide it.