keshavdv / victron-ble

A Python API to parse Victron Instant Readout BLE advertisements
The Unlicense
103 stars 34 forks source link

New SmartBatterySense is seen as Battery Monitor (SmartShunt) #13

Closed ctschach closed 1 year ago

ctschach commented 1 year ago

Describe the bug I just installed a second SmartBatterySense in my Camper. The new SmartBatterySense is seen as Battery Monitor (incl. things like SOC).

An older one is decoded correctly. Both rund the same firmware.

To Reproduce

The one that is decoded fine: INFO:victron_ble.scanner:Dumping advertisements from C5:B6:54:71:42:49 INFO:victron_ble.scanner:1672580713.727444 : 1000a4a3023eb9b03f9dc847dde429d96e7170aeddf50a INFO:victron_ble.scanner:1672580738.8386762 : 1000a4a30257b9b08e1491d173a8e9f92145d244732dfb INFO:victron_ble.scanner:1672580771.7147145 : 1000a4a30278b9b0b13c36e1ee2fda4f2858dcf31ead45 INFO:victron_ble.scanner:1672580792.1006138 : 1000a4a3028cb9b0e41cb3d6f6d2f27f6f62a8b9e08580

The one that is decoded incorrectly INFO:victron_ble.scanner:Dumping advertisements from E3:D4:C5:88:04:C2 INFO:victron_ble.scanner:1672581118.1702673 : 1000a5a3025a0dfec57db3d1493c0b132132210f70475b INFO:victron_ble.scanner:1672581125.662443 : 1000a5a302610dfe7bf4a195165f9d03d7ae4be6e2fa36 INFO:victron_ble.scanner:1672581129.0687375 : 1000a5a302650dfe43f651d31ed5884c08a0c76ce1bb63

Looks like Victron has introduced a new ID for the SmartBatterySense.

We will need to add

MODEL_PARSER_OVERRIDE: Dict[int, Type[Device]] = {
    0xA3A4: BatterySense,  # Smart Battery Sense
    0xA3A5: BatterySense,
}
ctschach commented 1 year ago

Changed and added a pull request