patman15 / BMS_BLE-HA

This integration allows to monitor Bluetooth Low Energy (BLE) battery management systems (BMS) from within Home Assistant.
GNU Lesser General Public License v2.1
6 stars 2 forks source link

Unique sensor ID is based on device name not MAC address #30

Closed patman15 closed 2 weeks ago

patman15 commented 2 weeks ago

Checklist

Describe the issue

The unique_id of a BMS sensor is generated with the name of the device and not a MAC address. This can lead to

Issue is here: https://github.com/patman15/BMS_BLE-HA/blob/ac58f05d38af91759201202113bd4eedec3a7a99/custom_components/bms_ble/sensor.py#L144

Reproduction steps

  1. run the integration with a device
  2. check /config/.storage/core.entity_registry

Debug logs

{"config_entry_id":null,"entity_id":"sensor.myjbd_test_current","id":"f19b49849ba7118843b294e854d3338d","orphaned_timestamp":-----------.8892846,"platform":"bms_ble","unique_id":"myJBD-test-current"}