home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.63k stars 30.78k forks source link

Miflora integration using Bluetooth xiaomi_ble does not support battery #77843

Closed otmezger closed 2 years ago

otmezger commented 2 years ago

The problem

Hi, after the migration to the new Bluetooth integration, my xiaomi miflora Bluetooth device does not support battery readings anymore. It was working before the integration, so I guess there is some limitation with the current code.

any idea how I can debug it myself? help develop it? pls point me to the right parts, and maybe I can help.

What version of Home Assistant Core has the issue?

2022.08.5

What was the last working version of Home Assistant Core?

2022.07

What type of installation are you running?

Home Assistant Supervised

Integration causing the issue

xiaomi_ble

Link to integration documentation on our website

https://www.home-assistant.io/integrations/xiaomi_ble

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

probot-home-assistant[bot] commented 2 years ago

xiaomi_ble documentation xiaomi_ble source (message by IssueLinks)

probot-home-assistant[bot] commented 2 years ago

Hey there @jc2k, @ernst79, mind taking a look at this issue as it has been labeled with an integration (xiaomi_ble) you are listed as a code owner for? Thanks! (message by CodeOwnersMention)

Ernst79 commented 2 years ago

Battery support will be added in 2022.9 release, see https://github.com/home-assistant/core/pull/76342

Battery requires active polling, so will be done once a day only, to save battery.

Jc2k commented 2 years ago

Lol, 4 seconds off posting at the same time.

Screenshot 2022-09-05 at 15 51 06

Closing this.

otmezger commented 2 years ago

Amazing. Thanks! Can’t wait for it. Once per day is more than enough.

fgonza2 commented 2 years ago

i installed 2022.9 and don't see the battery showing up. New device paired form scratch with native 2022.9.0, is this supposed to work with that build?

otmezger commented 2 years ago

For me it worked immediately with the new version 2022.9.0 See screenshot. I love it.

BA57A00D-5BDB-48C8-985D-0366D603AA1D

robertalexa commented 2 years ago

I am having the same difficulty? Been running on latest HA since release with no change to battery (0%), today I have removed it from Xiaomi BLE integration, re-added the MiFlora to the native app just to double check everything, I am unable to see battery value there either (but only been connected for a few minutes). Current firmware is 3.2.4 (same as latest firmware - despite finding records on the internet of 3.3.x version?), re-added it to Xiaomi BLE and still get 0% battery?

I will be leaving this for a few days since the active polling happens daily, but we shall see

image

This is my only device so unfortunately I can't pinpoint if this is a device issues or not?

@Jc2k can you share your knowledge about the most recent firmware? My device is the white version (should be international). Also, do you know if the green version (china) is meant to work too? I am finding mixed information.

Thanks