Add JBD BMS cell voltage telemetry
modified: firmware/esp32/xterra-controller/bms.cpp modified: firmware/esp32/xterra-controller/bms.h modified: firmware/esp32/xterra-controller/xterra-controller.ino
This commit is contained in:
@@ -45,6 +45,17 @@ void buildStatusDocument(JsonDocument& doc) {
|
||||
battery["cycle_count"] = bmsData.cycleCount;
|
||||
battery["cell_count"] = bmsData.cellCount;
|
||||
battery["ntc_count"] = bmsData.ntcCount;
|
||||
|
||||
JsonArray cells = battery.createNestedArray("cell_voltages");
|
||||
if (bmsData.cellsValid) {
|
||||
for (int i = 0; i < bmsData.cellCount; i++) {
|
||||
cells.add(bmsData.cellVoltages[i]);
|
||||
}
|
||||
}
|
||||
|
||||
battery["cell_min_voltage"] = bmsData.cellMinVoltage;
|
||||
battery["cell_max_voltage"] = bmsData.cellMaxVoltage;
|
||||
battery["cell_delta_mv"] = bmsData.cellDeltaMv;
|
||||
} else {
|
||||
battery["source"] = "placeholder";
|
||||
battery["connected"] = false;
|
||||
|
||||
Reference in New Issue
Block a user