diff --git a/ESPController/src/main.cpp b/ESPController/src/main.cpp index dc438ce..a7106bb 100644 --- a/ESPController/src/main.cpp +++ b/ESPController/src/main.cpp @@ -3201,7 +3201,7 @@ void send_ext_canbus_message(const uint32_t identifier, const uint8_t *buffer, c void CalculateStateOfHealth(diybms_eeprom_settings *settings) { // Value indicating what a typical discharge cycle looks like in amp-hours (normally 80% of cell for LFP) - float depth = 1000.0F * ((float)settings->currentMonitoring_batterycapacity/100.0F * (float)settings->soh_discharge_depth); + float depth = 1000.0F * ((float)settings->nominalbatcap/100.0F * (float)settings->soh_discharge_depth); float in = (float)settings->soh_total_milliamphour_in / depth; float out = (float)settings->soh_total_milliamphour_out / depth; //Take worst case diff --git a/ESPController/src/webserver_json_requests.cpp b/ESPController/src/webserver_json_requests.cpp index e922680..351e3ba 100644 --- a/ESPController/src/webserver_json_requests.cpp +++ b/ESPController/src/webserver_json_requests.cpp @@ -604,6 +604,14 @@ esp_err_t content_handler_chargeconfig(httpd_req_t *req) settings["canbusbaud"] = mysettings.canbusbaud; settings["equip_addr"] = mysettings.canbus_equipment_addr; settings["nominalbatcap"] = mysettings.nominalbatcap; + + settings["depthofdischarge"] = mysettings.soh_discharge_depth; + settings["expectedlifetime_cycles"] = mysettings.soh_lifetime_battery_cycles; + settings["total_mah_charge"] = mysettings.soh_total_milliamphour_in; + settings["total_mah_discharge"] = mysettings.soh_total_milliamphour_out; + settings["estimatebatterycycle"] = mysettings.soh_estimated_battery_cycles; + settings["stateofhealth"] = mysettings.soh_percent; + settings["chargevolt"] = mysettings.chargevolt; settings["chargecurrent"] = mysettings.chargecurrent; settings["dischargecurrent"] = mysettings.dischargecurrent; diff --git a/ESPController/web_src/default.htm b/ESPController/web_src/default.htm index 9bbb122..eb772b4 100644 --- a/ESPController/web_src/default.htm +++ b/ESPController/web_src/default.htm @@ -654,7 +654,7 @@
Charging