Optimize flap detection

This commit is contained in:
Carsten Schmiemann 2022-04-23 13:42:08 +02:00
parent 8696f7f0ce
commit e96741f60e
2 changed files with 6 additions and 1 deletions

View file

@ -47,18 +47,24 @@ void OvmsVehicleRenaultZoePh2::IncomingEVC(uint16_t type, uint16_t pid, const ch
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);
} 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_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);
} 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);
} 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);
} else {
mt_inv_status->SetValue("Inverter state unknown");
}

View file

@ -128,7 +128,6 @@ void OvmsVehicleRenaultZoePh2::ConfigChanged(OvmsConfigParam* param) {
void OvmsVehicleRenaultZoePh2::ZoeWakeUp() {
ESP_LOGI(TAG,"Zoe woke up (CAN Bus activity detected)");
mt_bus_awake->SetValue(true);;
StandardMetrics.ms_v_env_awake->SetValue(true);
StandardMetrics.ms_v_env_charging12v->SetValue(true);
POLLSTATE_ON;
ESP_LOGI(TAG, "Pollstate switched to ON");