Closed orymate closed 1 month ago
Hi, just bought some of these too. And yeah, I agree the data doesn't seem to match the spec. I asked for help from Victron.
With Victron's help, figured it out. The issue is that integers are packed in little-endian order across the bytes. So I reversed the entire struct to make it tranctable: https://github.com/orymate/victron-ble/compare/add-smart-lithium...stefanor:victron-ble:add-smart-lithium
@stefanor Great, thanks a lot! I've tested it with my batteries and all the values look good.
{
"name": "B4",
"address": "F6:86:A7:02:89:5B",
"rssi": -53,
"payload": {
"balancer_status": 3,
"battery_temperature": 15,
"battery_voltage": 13.36,
"bms_flags": 6,
"cell_voltages": [
3.34,
3.34,
3.34,
3.34,
null,
null,
null,
null
],
"error_flags": 0,
"model_name": "<Unknown device: 41196>"
}
}
"model_name": "<Unknown device: 41196>"
I guess you should add that model to the database too
Ah, you did.
Thanks @rajlaud, it works nice:
{
"name": "B3",
"address": "D6:F3:AA:C2:82:6D",
"rssi": -67,
"payload": {
"balancer_status": "balanced",
"battery_temperature": 16,
"battery_voltage": 13.36,
"bms_flags": 6,
"cell_voltages": [
3.34,
3.34,
3.34,
3.34,
null,
null,
null,
null
],
"error_flags": 0,
"model_name": "SmartLithium Battery 12V/160Ah"
}
}
@keshavdv is there anything I can do to get this merged?
Summary :memo:
Add initial support for smart lithium batteries
Details
I've implemented the parsing based on the pdf and tested on a bunch of 160Ah batteries. @stefanor worked together with Victron to fix the byte order, and the data gathered with this code seems to match what the VictronConnect app says.
Checks