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 f3eb6c2..5dd69fe 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 @@ -268,18 +268,18 @@ void OvmsVehicleRenaultZoePh2::IncomingEVC(uint16_t type, uint16_t pid, const ch break; } case 0x29FD: { - StandardMetrics.ms_v_charge_12v_current->SetValue((float) (CAN_UINT(0) * 0.01 - 327.675)); + StandardMetrics.ms_v_charge_12v_current->SetValue((float) (CAN_UINT(0) * 0.01 - 327.675), Amps); ESP_LOGD(TAG, "29FD EVC ms_v_charge_12v_current: %d", CAN_UINT(0)); ESP_LOGD(TAG, "29FD EVC ms_v_charge_12v_current: %f", CAN_UINT(0) * 0.01 - 327.675); break; } case 0x2005: { - StandardMetrics.ms_v_charge_12v_voltage->SetValue((float) (CAN_UINT(0) * 0.01)); + StandardMetrics.ms_v_charge_12v_voltage->SetValue((float) (CAN_UINT(0) * 0.01), Volts); ESP_LOGD(TAG, "2005 EVC ms_v_charge_12v_voltage: %f", CAN_UINT(0) * 0.01); break; } case 0x21D0: { - StandardMetrics.ms_v_charge_12v_temp->SetValue((float) (CAN_UINT(0) - 40)); + StandardMetrics.ms_v_charge_12v_temp->SetValue((float) (CAN_UINT(0) - 40), Celcius); ESP_LOGD(TAG, "21D0 EVC ms_v_charge_12v_temp: %d", CAN_UINT(0) - 40); break; } @@ -369,43 +369,43 @@ void OvmsVehicleRenaultZoePh2::IncomingBCB(uint16_t type, uint16_t pid, const ch void OvmsVehicleRenaultZoePh2::IncomingLBC(uint16_t type, uint16_t pid, const char* data, uint16_t len) { switch (pid) { case 0x9005: { //Battery voltage - StandardMetrics.ms_v_bat_voltage->SetValue((float) (CAN_UINT(0) * 0.1)); + StandardMetrics.ms_v_bat_voltage->SetValue((float) (CAN_UINT(0) * 0.1), Volts); ESP_LOGD(TAG, "9005 LBC ms_v_bat_voltage: %f", CAN_UINT(0) * 0.1); break; } case 0x925D: { //Battery current - StandardMetrics.ms_v_bat_current->SetValue((float) ((CAN_UINT(0) - 1020) * 0.03125)); + StandardMetrics.ms_v_bat_current->SetValue((float) ((CAN_UINT(0) - 1020) * 0.03125), Amps); ESP_LOGD(TAG, "925D LBC ms_v_bat_current: %d", CAN_UINT(0)); ESP_LOGD(TAG, "925D LBC ms_v_bat_current: %f", ((CAN_UINT(0) - 1020) * 0.03125)); break; } case 0x9012: { //Battery average temperature - StandardMetrics.ms_v_bat_temp->SetValue((float) (CAN_UINT(0) - 40)); - ESP_LOGD(TAG, "9012 LBC ms_v_bat_temp: %f", ((CAN_UINT(0) - 40)); + StandardMetrics.ms_v_bat_temp->SetValue((float) (CAN_UINT(0) - 40), Celcius); + ESP_LOGD(TAG, "9012 LBC ms_v_bat_temp: %d", (CAN_UINT(0) - 40)); break; } case 0x9002: { //Battery SOC - StandardMetrics.ms_v_bat_soc->SetValue((float) (CAN_UINT(0)) * 0.01); + StandardMetrics.ms_v_bat_soc->SetValue((float) (CAN_UINT(0)) * 0.01, Percentage); ESP_LOGD(TAG, "9002 LBC ms_v_bat_soc: %f", CAN_UINT(0) * 0.01); break; } case 0x9003: { //Battery SOH - StandardMetrics.ms_v_bat_soh->SetValue((float) (CAN_UINT(0) * 0.01)); + StandardMetrics.ms_v_bat_soh->SetValue((float) (CAN_UINT(0) * 0.01), Percentage); ESP_LOGD(TAG, "9003 LBC ms_v_bat_soh: %f", CAN_UINT(0) * 0.01); break; } case 0x9243: { //Battery energy charged kWh - StandardMetrics.ms_v_charge_kwh_grid_total->SetValue((float) (CAN_UINT32(0) * 0.001)); + StandardMetrics.ms_v_charge_kwh_grid_total->SetValue((float) (CAN_UINT32(0) * 0.001), kWh); ESP_LOGD(TAG, "9243 LBC ms_v_charge_kwh_grid_total: %f", CAN_UINT32(0) * 0.001); break; } case 0x9244: { //Battery energy discharged kWh - StandardMetrics.ms_v_bat_energy_used->SetValue((float) (CAN_UINT32(0) * 0.001)); + StandardMetrics.ms_v_bat_energy_used->SetValue((float) (CAN_UINT32(0) * 0.001), kWh); ESP_LOGD(TAG, "9244 LBC ms_v_bat_energy_used: %f", CAN_UINT32(0) * 0.001); break; } case 0x9246: { //Battery energy regenerated kWh - StandardMetrics.ms_v_bat_energy_recd->SetValue((float) (CAN_UINT32(0) * 0.001)); + StandardMetrics.ms_v_bat_energy_recd->SetValue((float) (CAN_UINT32(0) * 0.001), kWh); ESP_LOGD(TAG, "9246 LBC ms_v_bat_energy_recd: %f", CAN_UINT32(0) * 0.001); break; } @@ -416,9 +416,9 @@ void OvmsVehicleRenaultZoePh2::IncomingLBC(uint16_t type, uint16_t pid, const ch } break; } - case 0x91C8: { - StandardMetrics.ms_v_charge_kwh->SetValue(float(CAN_UINT(0))); - ESP_LOGD(TAG, "91C8 LBC ms_v_charge_kwh: %d", CAN_UINT(0)); + case 0x91C8: { //Available charge in kWh + StandardMetrics.ms_v_charge_kwh->SetValue(float(CAN_UINT24(0)), kWh); + ESP_LOGD(TAG, "91C8 LBC ms_v_charge_kwh: %d", CAN_UINT24(0)); break; } case 0x9021: {