Mi Flora BLE integration does not show battery status

I just added a couple Mi Flora plant sensors to Home Assistant - was VERY easy with the native bluetooth support added in the latest release! Well done, team! :smiley:

The sensors do not include battery status though - I need to add the sensors to the Mi Flora app to se battery levelā€¦

Any clue why that is? I have updated the firmware in the sensors.

I believe your issue was the firmware update. After I made an update quite some time ago I lost the Battery Status as well.

Thanks - it didnt work on the firmware they shipped with either (it was quite new as well), but you are probably right anyway.

Some specs / message formats must need updating by the devs :blush:

ā€¦.and with the 2022.09 update it was fixed - so cool :grinning:

  • MiFlora now supports polling of the Battery sensor. Thanks @bdraco

@jaybe and @TinyDoT

Iā€™m thinking of adding the Mi Flora to my collection of sensors now that they are natively supported in HA Bluetooth. Since you mentioned firmware updates, are you able to do that without a Xiaomi hub?

Thanks

I used to use the bluetooth on the Pi the My HomeAssistant was running on, but have since moved my HomeAssistant to a more powerful machine, and moved my Bluetooth to an ESPHome Tracker, no Xiaomi Hub : ) Iā€™m looking to explore the new Native Bluetooth in HomeAssitant.

Yes, I can do that from the supporting iOS app. And the sensors can be accessed from home assistant and the app at the same time (no need to remove/add them).

Itā€™s really easy, actually: remove the plastic strip at the battery, wait a couple seconds, and the sensor shows up in home assistant automatically, and you just follow the UI. Then add the sensor to the app using the instructions provided, go to hardware, and search for firmware updatesā€¦

I have manually added ā€œplantā€ sensors in configuration.yaml based on the mi sensors and the data in the app, e.g. (the sensors referenced in the definition are the mi flora sensors, this one is a palm in our living room):

# Plants
plant:
    stue_palme:
        sensors:
            moisture: sensor.plante_palme_moisture
            battery: sensor.plante_palme_battery
            temperature: sensor.plante_palme_temperature
            conductivity: sensor.plante_palme_conductivity
            brightness: sensor.plante_palme_illuminance
        min_moisture: 15
        max_moisture: 60
        min_temperature: 10
        max_temperature: 30
        min_conductivity: 350
        max_conductivity: 2000
        min_brightness: 800
        max_brightness: 22000

This is very helpful

Thanks

@jaybe

I got my sensor today, powered it up and it showed up in HA but with only two entities, illuminance and signal_strength. Do the others have to be manually added or do I need to wait a while for the BLE advertisements?

Added: Firmware was v3.2.4 and I updated it to 3.3.5 and now the other entities show up. Not sure if it was the elapsed time or the firmware update that did it!

I believe itā€™s just the elapsed time - congrats on the new sensors @unmesh59 :+1:t2:

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)

I just got my first MiFlora and noticed it isnā€™t showing battery status. Looks like this is potentially a current/new issue with the HA integration? Just wanting to confirm that I donā€™t need to update firmware on the device. I explicitly DIDNā€™T do so as I didnā€™t want a new firmware to cause any unexpected issues with the HA integration.

After a few hours, I noticed the battery showed up. I guess it only broadcasts that value/checks it very rarely?

Ok good to know. However it has been 12h after my latest restart of HA and still no battery data. However there is 1 single sensor that does broadcast the battery. I have no clue why that one works and the other ones donā€™t. Same firmware on all of them.

Very weird. I ordered several more from the same seller, so I guess weā€™ll see if I have similar issues.

Actually I think I know now what the difference could be between the one sensor that shows battery info and all the others that donā€™t:

The one that shows the info is lying right next to my HA Yellow, so I assume it connects directly to its BT.

The others are connected via BT Proxies. I have 2 Shellys Plus 1PMs and I have enabled Bluetooth scanner mode as active on both of them.

My guess is that somehow the battery information is not transmitted thru BT proxy. Anyone made the same experiences?

Thanks!

Do you have ā€œactiveā€ set to ā€œtrueā€ in the bluetooth_proxy section of your config (as well as in the scan_parameters section) ? I use an esp32 proxy and have consistent battery readings from a dozen mi floras with the config below:

esp32_ble_tracker:
  scan_parameters:
    interval: 1100ms
    window: 1100ms
    active: true

bluetooth_proxy:
  active: true

My new/additional sensors arrived and they all had the battery show up immediately after putting in the battery.

Iā€™ve got a number of BT Proxies in addition to a BT dongle on my HA server. Admittedly, it just happens that all of my Mi Floras are directly above my HA server, so I assume theyā€™re being picked up by it and not proxies.

So do you have ESPHome on them or are you still running the Shelly firmware?

I am running the standard Shelly firmware.

I really think now it is the Shellys. I moved one of my sensors directly next to my HA yellow and now battery shows.

I also have 2 M5stacks lying around. I think I will try with these instead and see what happens.

Kinda sucks that Shelly has that issue.

Does anyone else have an issue with Shelly and BT?