lolouk44 / hassio-addons

Xiaomi Mi Scale Add On for Home Assistant
MIT License
125 stars 42 forks source link

Bluetooth proxy partially working #91

Open Jpsy opened 6 months ago

Jpsy commented 6 months ago

Select Add-On (place a lowercase x for the relevant add-on)

Describe the bug In #85 you answered that this component is probably not compatible with ESPhome bluetooth proxies. I found that it in fact works. At least partially. The entities for the last scale measurement are correctly received using a BT proxy (Mass, Mass non stabilized, Impedance, Signal Strength). The only part that does not work is the following MQTT transmission. This only works when the scale is used without a proxy. Using the proxy the MQTT transmittion is never triggered. So all person specific entities are never updated when the proxy is in the chain. Is it possible that you are using two different ways to get the BT information here?

To Reproduce Steps to reproduce the behaviour, including error message if any.

Expected behaviour A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Scale (please complete the following information):

Device running Home Assistant (please complete the following information):

Home Assistant Version: 2024.04.3

Additional context HA log of a typical measurement using the BT proxy:

2024-04-21 10:38:41.451 DEBUG (MainThread) [homeassistant.components.bluetooth.manager] mcu-ble-bridge-01 (7C:9E:BD:78:37:DC) [connectable]: D8:E7:2F:A2:B2:17 AdvertisementData(local_name='MIBFS', manufacturer_data={343: b'\xd8\xe7/\xa2\xb2\x17'}, service_data={'0000181b-0000-1000-8000-00805f9b34fb': b'\x02&\xe8\x07\x04\x15\x08&#\xd4\x01vH'}, service_uuids=['0000181b-0000-1000-8000-00805f9b34fb'], tx_power=-127, rssi=-96) match: set()
2024-04-21 10:38:48.491 DEBUG (MainThread) [homeassistant.components.bluetooth.manager] mcu-ble-bridge-01 (7C:9E:BD:78:37:DC) [connectable]: D8:E7:2F:A2:B2:17 AdvertisementData(local_name='MIBFS', manufacturer_data={343: b'\xd8\xe7/\xa2\xb2\x17'}, service_data={'0000181b-0000-1000-8000-00805f9b34fb': b'\x02\xa6\xe8\x07\x04\x15\x08&/\xd4\x01vH'}, service_uuids=['0000181b-0000-1000-8000-00805f9b34fb'], tx_power=-127, rssi=-95) match: set()

As said this measurement IS received by your component and its entities but it does not send out an MQTT transmission to update the data of the person specific entities.