Use ignition relay state from BCM

This commit is contained in:
Carsten Schmiemann 2022-05-18 00:18:00 +02:00
parent 34fe261ec9
commit cd537f1907
2 changed files with 15 additions and 11 deletions

View File

@ -191,10 +191,14 @@ void OvmsVehicleRenaultZoePh2::IncomingBCM(uint16_t type, uint16_t pid, const ch
break;
}*/
case 0x60C6: { //Ignition relay (switch), working but behavior on CHARING testing needed
if ((bool)CAN_UINT(0)) {
/*if ((bool)CAN_UINT(0)) {
ESP_LOGD(TAG, "60C6 Ignition relay: active");
} else {
ESP_LOGD(TAG, "60C6 Ignition relay: inactive");
}*/
if (!CarIsCharging) { //Igniton while charging
StandardMetrics.ms_v_env_on->SetValue((bool)CAN_UINT(0));
StandardMetrics.ms_v_env_awake->SetValue((bool)CAN_UINT(0));
}
break;
}

View File

@ -46,25 +46,25 @@ void OvmsVehicleRenaultZoePh2::IncomingEVC(uint16_t type, uint16_t pid, const ch
//ESP_LOGD(TAG, "21CF EVC mt_inv_status: %d", CAN_NIBL(0));
if (CAN_NIBL(0) == 1) {
mt_inv_status->SetValue("Inverter off");
StandardMetrics.ms_v_env_on->SetValue(false);
StandardMetrics.ms_v_env_awake->SetValue(false);
//StandardMetrics.ms_v_env_on->SetValue(false);
//StandardMetrics.ms_v_env_awake->SetValue(false);
} else if (CAN_NIBL(0) == 2) {
mt_inv_status->SetValue("Inverter on");
StandardMetrics.ms_v_env_on->SetValue(true);
StandardMetrics.ms_v_env_awake->SetValue(true);
//StandardMetrics.ms_v_env_on->SetValue(true);
//StandardMetrics.ms_v_env_awake->SetValue(true);
StandardMetrics.ms_v_door_chargeport->SetValue(false);
} else if (CAN_NIBL(0) == 3) {
mt_inv_status->SetValue("Inverter decharging");
StandardMetrics.ms_v_env_on->SetValue(false);
StandardMetrics.ms_v_env_awake->SetValue(false);
//StandardMetrics.ms_v_env_on->SetValue(false);
//StandardMetrics.ms_v_env_awake->SetValue(false);
} else if (CAN_NIBL(0) == 4) {
mt_inv_status->SetValue("Inverter alternator mode");
StandardMetrics.ms_v_env_on->SetValue(false);
StandardMetrics.ms_v_env_awake->SetValue(false);
//StandardMetrics.ms_v_env_on->SetValue(false);
//StandardMetrics.ms_v_env_awake->SetValue(false);
} else if (CAN_NIBL(0) == 5) {
mt_inv_status->SetValue("Inverter ready to sleep");
StandardMetrics.ms_v_env_on->SetValue(false);
StandardMetrics.ms_v_env_awake->SetValue(false);
//StandardMetrics.ms_v_env_on->SetValue(false);
//StandardMetrics.ms_v_env_awake->SetValue(false);
} else {
mt_inv_status->SetValue("Inverter state unknown");
}