Add contactor state to more battery info

This commit is contained in:
Daniel Öster 2025-09-11 23:27:15 +03:00
parent 29e6f52c4c
commit 0aad11d9bc
3 changed files with 13 additions and 2 deletions

View file

@ -193,6 +193,7 @@ void EcmpBattery::update_values() {
datalayer_extended.stellantisECMP.pid_SOH_cell_1 = pid_SOH_cell_1; datalayer_extended.stellantisECMP.pid_SOH_cell_1 = pid_SOH_cell_1;
// Update extended datalayer for MysteryVan // Update extended datalayer for MysteryVan
datalayer_extended.stellantisECMP.MysteryVan = MysteryVan; datalayer_extended.stellantisECMP.MysteryVan = MysteryVan;
datalayer_extended.stellantisECMP.CONTACTORS_STATE = CONTACTORS_STATE;
datalayer_extended.stellantisECMP.CrashMemorized = HV_BATT_CRASH_MEMORIZED; datalayer_extended.stellantisECMP.CrashMemorized = HV_BATT_CRASH_MEMORIZED;
datalayer_extended.stellantisECMP.CONTACTOR_OPENING_REASON = CONTACTOR_OPENING_REASON; datalayer_extended.stellantisECMP.CONTACTOR_OPENING_REASON = CONTACTOR_OPENING_REASON;
datalayer_extended.stellantisECMP.TBMU_FAULT_TYPE = TBMU_FAULT_TYPE; datalayer_extended.stellantisECMP.TBMU_FAULT_TYPE = TBMU_FAULT_TYPE;
@ -268,7 +269,7 @@ void EcmpBattery::handle_incoming_can_frame(CAN_frame rx_frame) {
//TBMU_EVSE_DC_MES_CURRENT = (rx_frame.data.u8[3] << 4) | ((rx_frame.data.u8[4] & 0xF0) >> 4); //A -2000 - 2000 //Fastcharger info, not needed for BE //TBMU_EVSE_DC_MES_CURRENT = (rx_frame.data.u8[3] << 4) | ((rx_frame.data.u8[4] & 0xF0) >> 4); //A -2000 - 2000 //Fastcharger info, not needed for BE
//TBMU_EVSE_CHRG_REQ = (rx_frame.data.u8[4] & 0x0C) >> 2; //00 No request, 01 Stop request //Fastcharger info, not needed for BE //TBMU_EVSE_CHRG_REQ = (rx_frame.data.u8[4] & 0x0C) >> 2; //00 No request, 01 Stop request //Fastcharger info, not needed for BE
//HV_STORAGE_MAX_I = ((rx_frame.data.u8[4] & 0x03) << 12) | (rx_frame.data.u8[5] << 2) | //Fastcharger info, not needed for BE //HV_STORAGE_MAX_I = ((rx_frame.data.u8[4] & 0x03) << 12) | (rx_frame.data.u8[5] << 2) | //Fastcharger info, not needed for BE
((rx_frame.data.u8[6] & 0xC0) >> 6); //A -2000 - 2000 //((rx_frame.data.u8[6] & 0xC0) >> 6); //A -2000 - 2000
//TBMU_EVSE_DC_MAX_POWER = ((rx_frame.data.u8[6] & 0x3F) << 8) | rx_frame.data.u8[7]; //W -1000000 - 0 //Fastcharger info, not needed for BE //TBMU_EVSE_DC_MAX_POWER = ((rx_frame.data.u8[6] & 0x3F) << 8) | rx_frame.data.u8[7]; //W -1000000 - 0 //Fastcharger info, not needed for BE
break; break;
case 0x3F4: //MysteryVan 50/75kWh platform (Temperature sensors) case 0x3F4: //MysteryVan 50/75kWh platform (Temperature sensors)

View file

@ -384,7 +384,16 @@ class EcmpHtmlRenderer : public BatteryHtmlRenderer {
"</h4>"; "</h4>";
if (datalayer_extended.stellantisECMP.MysteryVan) { if (datalayer_extended.stellantisECMP.MysteryVan) {
content += "<h4>MysteryVan platform detected!</h4>"; content += "<h3>MysteryVan platform detected!</h3>";
content += "<h4>Contactor State: ";
if (datalayer_extended.stellantisECMP.CONTACTORS_STATE == 0) {
content += "Open";
} else if (datalayer_extended.stellantisECMP.CONTACTORS_STATE == 1) {
content += "Precharge";
} else if (datalayer_extended.stellantisECMP.CONTACTORS_STATE == 2) {
content += "Closed";
}
content += "</h4>";
content += "<h4>Crash Memorized: "; content += "<h4>Crash Memorized: ";
if (datalayer_extended.stellantisECMP.CrashMemorized) { if (datalayer_extended.stellantisECMP.CrashMemorized) {
content += "Yes</h4>"; content += "Yes</h4>";

View file

@ -240,6 +240,7 @@ struct DATALAYER_INFO_ECMP {
bool CrashMemorized = false; bool CrashMemorized = false;
uint8_t CONTACTOR_OPENING_REASON = 0; uint8_t CONTACTOR_OPENING_REASON = 0;
uint8_t TBMU_FAULT_TYPE = 0; uint8_t TBMU_FAULT_TYPE = 0;
uint8_t CONTACTORS_STATE = 0;
uint16_t HV_BATT_FC_INSU_MINUS_RES, HV_BATT_FC_INSU_PLUS_RES, HV_BATT_FC_VHL_INSU_PLUS_RES, uint16_t HV_BATT_FC_INSU_MINUS_RES, HV_BATT_FC_INSU_PLUS_RES, HV_BATT_FC_VHL_INSU_PLUS_RES,
HV_BATT_ONLY_INSU_MINUS_RES = 0; HV_BATT_ONLY_INSU_MINUS_RES = 0;
bool ALERT_CELL_POOR_CONSIST, ALERT_OVERCHARGE, ALERT_BATT, ALERT_LOW_SOC, ALERT_HIGH_SOC, ALERT_SOC_JUMP, bool ALERT_CELL_POOR_CONSIST, ALERT_OVERCHARGE, ALERT_BATT, ALERT_LOW_SOC, ALERT_HIGH_SOC, ALERT_SOC_JUMP,