Fix car states

This commit is contained in:
Carsten Schmiemann 2022-04-16 16:39:31 +02:00
parent 7418f08f6f
commit 3fbcb7015f
2 changed files with 3 additions and 2 deletions

View file

@ -120,13 +120,13 @@ void OvmsVehicleRenaultZoePh2::IncomingFrameCan1(CAN_frame_t* p_frame) {
StandardMetrics.ms_v_env_charging12v->SetValue(true); StandardMetrics.ms_v_env_charging12v->SetValue(true);
POLLSTATE_ON; 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"); ESP_LOGI(TAG,"Zoe stared charging");
StandardMetrics.ms_v_env_on->SetValue(false); StandardMetrics.ms_v_env_on->SetValue(false);
StandardMetrics.ms_v_charge_state->SetValue("charging"); StandardMetrics.ms_v_charge_state->SetValue("charging");
POLLSTATE_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"); ESP_LOGI(TAG,"Zoe stopped charging");
StandardMetrics.ms_v_charge_state->SetValue("stopped"); StandardMetrics.ms_v_charge_state->SetValue("stopped");
POLLSTATE_ON; POLLSTATE_ON;

View file

@ -70,6 +70,7 @@ class OvmsVehicleRenaultZoePh2 : public OvmsVehicle {
void WebInit(); void WebInit();
void WebDeInit(); void WebDeInit();
bool CarIsDriving = false; bool CarIsDriving = false;
bool CarIsCharging = false;
protected: protected:
void IncomingINV(uint16_t type, uint16_t pid, const char* data, uint16_t len); void IncomingINV(uint16_t type, uint16_t pid, const char* data, uint16_t len);