diff --git a/OVMS.V3/components/vehicle_renaultzoe_ph2/src/vehicle_renaultzoe_ph2.cpp b/OVMS.V3/components/vehicle_renaultzoe_ph2/src/vehicle_renaultzoe_ph2.cpp index d3c34e7..b8d2568 100644 --- a/OVMS.V3/components/vehicle_renaultzoe_ph2/src/vehicle_renaultzoe_ph2.cpp +++ b/OVMS.V3/components/vehicle_renaultzoe_ph2/src/vehicle_renaultzoe_ph2.cpp @@ -120,13 +120,13 @@ void OvmsVehicleRenaultZoePh2::IncomingFrameCan1(CAN_frame_t* p_frame) { StandardMetrics.ms_v_env_charging12v->SetValue(true); POLLSTATE_ON; } - if (mt_bus_awake && data[data[2] == 0x92 && data[3] == 0x10]) { //received 0x9210 from LBC, only sent freely on starting charge so far + if (mt_bus_awake && !CarIsCharging && data[2] == 0x92 && data[3] == 0x10) { //received 0x9210 from LBC, only sent freely on starting charge so far ESP_LOGI(TAG,"Zoe stared charging"); StandardMetrics.ms_v_env_on->SetValue(false); StandardMetrics.ms_v_charge_state->SetValue("charging"); POLLSTATE_CHARGING; } - if (mt_bus_awake && data[data[2] == 0x92 && data[3] == 0x43]) { //received 0x9243 from LBC, only sent freely on stopping charge so far + if (mt_bus_awake && CarIsCharging && data[2] == 0x92 && data[3] == 0x43) { //received 0x9243 from LBC, only sent freely on stopping charge so far ESP_LOGI(TAG,"Zoe stopped charging"); StandardMetrics.ms_v_charge_state->SetValue("stopped"); POLLSTATE_ON; diff --git a/OVMS.V3/components/vehicle_renaultzoe_ph2/src/vehicle_renaultzoe_ph2.h b/OVMS.V3/components/vehicle_renaultzoe_ph2/src/vehicle_renaultzoe_ph2.h index bbaf1ba..66b913a 100644 --- a/OVMS.V3/components/vehicle_renaultzoe_ph2/src/vehicle_renaultzoe_ph2.h +++ b/OVMS.V3/components/vehicle_renaultzoe_ph2/src/vehicle_renaultzoe_ph2.h @@ -70,6 +70,7 @@ class OvmsVehicleRenaultZoePh2 : public OvmsVehicle { void WebInit(); void WebDeInit(); bool CarIsDriving = false; + bool CarIsCharging = false; protected: void IncomingINV(uint16_t type, uint16_t pid, const char* data, uint16_t len);