custom-components / ble_monitor

BLE monitor for passive BLE sensors
https://community.home-assistant.io/t/passive-ble-monitor-integration/
MIT License
1.92k stars 248 forks source link

[Bug]: Incorrect unit_of_measurement for Xiaomi Mi Scale V2 #1382

Open Juriga1 opened 4 months ago

Juriga1 commented 4 months ago

What happened?

The unit_of_measurement for the Xiaomi Mi Scale V2 is incorrectly set to "Ohm" instead of "ohm". This causes issues when integrating with other functionalities in Home Assistant that expect the unit to be in lowercase. I suspect that the issue with the unit_of_measurement being set to "Ohm" is causing problems when creating a helper to calculate the average value. When the unit is "Ohm", the helper does not return a value. If I manually change the unit to "ohm", it starts working, but after a short period, the unit of measurement reverts back to "Ohm". I have modified the const.py file to change UNIT_OF_MEASUREMENT_OHM to "ohm" and restarted Home Assistant, but the issue persists. Deleting and recreating the entity did not resolve the problem.

Sensor type

Xiaomi Mi Scale V2

Relevant log output

**System Details:**
- Home Assistant version: [e.g., 2023.7.1]
- Passive BLE Monitor version: [e.g., 1.0.5]
- Xiaomi Mi Scale V2 firmware version: [e.g., 2.0.0]
Ernst79 commented 3 months ago

Ohm or ohm is not an "official" unit of measurement in Home Assistant, as far as I can see. Which component is expecting ohm to be lowercase?