Add hvac compressor PIDs
This commit is contained in:
parent
6a2e6dd765
commit
c8cbbfe5a0
|
@ -46,6 +46,40 @@ void OvmsVehicleRenaultZoePh2::IncomingHVAC(uint16_t type, uint16_t pid, const c
|
||||||
ESP_LOGD(TAG, "43D8 HVAC mt_hvac_compressor_speed: %d", CAN_UINT(0));
|
ESP_LOGD(TAG, "43D8 HVAC mt_hvac_compressor_speed: %d", CAN_UINT(0));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case 0x4402: { //Compressor state
|
||||||
|
if (CAN_NIBL(0) == 1) {
|
||||||
|
mt_hvac_compressor_mode->SetValue("AC mode");
|
||||||
|
StandardMetrics.ms_v_env_hvac->SetValue(true);
|
||||||
|
}
|
||||||
|
if (CAN_NIBL(0) == 2) {
|
||||||
|
mt_hvac_compressor_mode->SetValue("De-ICE mode");
|
||||||
|
StandardMetrics.ms_v_env_hvac->SetValue(true);
|
||||||
|
}
|
||||||
|
if (CAN_NIBL(0) == 4) {
|
||||||
|
mt_hvac_compressor_mode->SetValue("Heat pump mode");
|
||||||
|
StandardMetrics.ms_v_env_hvac->SetValue(true);
|
||||||
|
}
|
||||||
|
if (CAN_NIBL(0) == 6) {
|
||||||
|
mt_hvac_compressor_mode->SetValue("Demisting mode");
|
||||||
|
StandardMetrics.ms_v_env_hvac->SetValue(true);
|
||||||
|
}
|
||||||
|
if (CAN_NIBL(0) == 7) {
|
||||||
|
mt_hvac_compressor_mode->SetValue("idle");
|
||||||
|
StandardMetrics.ms_v_env_hvac->SetValue(false);
|
||||||
|
}
|
||||||
|
ESP_LOGD(TAG, "%d HVAC mt_hvac_compressor_mode: %d", pid, CAN_UINT(0));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 0x4369: { //Compressor pressure
|
||||||
|
mt_hvac_compressor_pressure->SetValue(float(CAN_UINT(0) * 0.1));
|
||||||
|
ESP_LOGD(TAG, "%d HVAC mt_hvac_compressor_pressure: %f", pid, CAN_UINT(0) * 0.1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 0x4436: { //Compressor power
|
||||||
|
mt_hvac_compressor_power->SetValue(float(CAN_UINT(0) * 25.0 / 100.0));
|
||||||
|
ESP_LOGD(TAG, "%d HVAC mt_hvac_compressor_power: %f", pid, CAN_UINT(0) * 25.0 / 100.0);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
default: {
|
default: {
|
||||||
char *buf = NULL;
|
char *buf = NULL;
|
||||||
|
|
|
@ -218,7 +218,10 @@ static const OvmsVehicle::poll_pid_t renault_zoe_polls[] = {
|
||||||
{ 0x744, 0x764, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x4361, { 0, 10, 10, 10 }, 0, ISOTP_STD }, // Cabin temp
|
{ 0x744, 0x764, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x4361, { 0, 10, 10, 10 }, 0, ISOTP_STD }, // Cabin temp
|
||||||
{ 0x744, 0x764, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x4360, { 0, 10, 10, 10 }, 0, ISOTP_STD }, // Cabin setpoint
|
{ 0x744, 0x764, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x4360, { 0, 10, 10, 10 }, 0, ISOTP_STD }, // Cabin setpoint
|
||||||
{ 0x744, 0x764, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x436B, { 0, 10, 10, 10 }, 0, ISOTP_STD }, // Cabin FAN speed
|
{ 0x744, 0x764, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x436B, { 0, 10, 10, 10 }, 0, ISOTP_STD }, // Cabin FAN speed
|
||||||
{ 0x744, 0x764, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x43D8, { 0, 10, 10, 5 }, 0, ISOTP_STD }, // Compressor speed
|
{ 0x744, 0x764, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x43D8, { 0, 10, 10, 5 }, 0, ISOTP_STD }, // Compressor speed
|
||||||
|
{ 0x744, 0x764, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x4402, { 0, 10, 10, 10 }, 0, ISOTP_STD }, // Compressor state
|
||||||
|
{ 0x744, 0x764, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x4369, { 0, 10, 10, 10 }, 0, ISOTP_STD }, // Compressor pressure
|
||||||
|
{ 0x744, 0x764, VEHICLE_POLL_TYPE_OBDIIEXTENDED, 0x4436, { 0, 10, 10, 10 }, 0, ISOTP_STD }, // Compressor power
|
||||||
|
|
||||||
//UCM
|
//UCM
|
||||||
//{ 0x74D, 0x76D, VEHICLE_POLL_TYPE_OBDIISESSION, SESSION_AfterSales, { 0, 60, 60, 60 }, 0, ISOTP_STD }, // OBD Extended Diagnostic Session
|
//{ 0x74D, 0x76D, VEHICLE_POLL_TYPE_OBDIISESSION, SESSION_AfterSales, { 0, 60, 60, 60 }, 0, ISOTP_STD }, // OBD Extended Diagnostic Session
|
||||||
|
|
|
@ -59,21 +59,24 @@ OvmsVehicleRenaultZoePh2::OvmsVehicleRenaultZoePh2() {
|
||||||
PollSetResponseSeparationTime(20);
|
PollSetResponseSeparationTime(20);
|
||||||
|
|
||||||
// init metrics:
|
// init metrics:
|
||||||
mt_pos_odometer_start = MyMetrics.InitFloat("zph2.v.pos.odometer.start", SM_STALE_MID, 0, Kilometers);
|
mt_pos_odometer_start = MyMetrics.InitFloat("zph2.v.pos.odometer.start", SM_STALE_MID, 0, Kilometers);
|
||||||
mt_bus_awake = MyMetrics.InitBool("zph2.v.bus.awake", SM_STALE_MIN, false);
|
mt_bus_awake = MyMetrics.InitBool("zph2.v.bus.awake", SM_STALE_MIN, false);
|
||||||
mt_available_energy = MyMetrics.InitFloat("zph2.v.avail.energy", SM_STALE_MID, 0, kWh);
|
mt_available_energy = MyMetrics.InitFloat("zph2.v.avail.energy", SM_STALE_MID, 0, kWh);
|
||||||
mt_main_power_consumed = MyMetrics.InitFloat("zph2.c.main.power.consumed", SM_STALE_MID, 0, kWh);
|
mt_main_power_consumed = MyMetrics.InitFloat("zph2.c.main.power.consumed", SM_STALE_MID, 0, kWh);
|
||||||
mt_main_phases = MyMetrics.InitString("zph2.c.main.phases", SM_STALE_MID, 0);
|
mt_main_phases = MyMetrics.InitString("zph2.c.main.phases", SM_STALE_MID, 0);
|
||||||
mt_inv_status = MyMetrics.InitString("zph2.m.inverter.status", SM_STALE_MID, 0);
|
mt_inv_status = MyMetrics.InitString("zph2.m.inverter.status", SM_STALE_MID, 0);
|
||||||
mt_mot_temp_stator1 = MyMetrics.InitFloat("zph2.m.temp.stator1", SM_STALE_MID, 0, Celcius);
|
mt_mot_temp_stator1 = MyMetrics.InitFloat("zph2.m.temp.stator1", SM_STALE_MID, 0, Celcius);
|
||||||
mt_mot_temp_stator2 = MyMetrics.InitFloat("zph2.m.temp.stator2", SM_STALE_MID, 0, Celcius);
|
mt_mot_temp_stator2 = MyMetrics.InitFloat("zph2.m.temp.stator2", SM_STALE_MID, 0, Celcius);
|
||||||
mt_aux_power_consumer = MyMetrics.InitFloat("zph2.c.aux.power.consumer", SM_STALE_MID, 0, Watts);
|
mt_aux_power_consumer = MyMetrics.InitFloat("zph2.c.aux.power.consumer", SM_STALE_MID, 0, Watts);
|
||||||
mt_aux_power_ptc = MyMetrics.InitFloat("zph2.c.aux.power.ptc", SM_STALE_MID, 0, Watts);
|
mt_aux_power_ptc = MyMetrics.InitFloat("zph2.c.aux.power.ptc", SM_STALE_MID, 0, Watts);
|
||||||
mt_inv_hv_voltage = MyMetrics.InitFloat("zph2.m.inverter.voltage", SM_STALE_MID, 0, Volts);
|
mt_inv_hv_voltage = MyMetrics.InitFloat("zph2.m.inverter.voltage", SM_STALE_MID, 0, Volts);
|
||||||
mt_inv_hv_current = MyMetrics.InitFloat("zph2.m.inverter.current", SM_STALE_MID, 0, Amps);
|
mt_inv_hv_current = MyMetrics.InitFloat("zph2.m.inverter.current", SM_STALE_MID, 0, Amps);
|
||||||
mt_bat_max_charge_power = MyMetrics.InitFloat("zph2.b.max.charge.power", SM_STALE_MID, 0, kW);
|
mt_bat_max_charge_power = MyMetrics.InitFloat("zph2.b.max.charge.power", SM_STALE_MID, 0, kW);
|
||||||
mt_hvac_compressor_speed = MyMetrics.InitFloat("zph2.h.compressor.speed", SM_STALE_MID, 0);
|
mt_hvac_compressor_speed = MyMetrics.InitFloat("zph2.h.compressor.speed", SM_STALE_MID, 0);
|
||||||
|
mt_hvac_compressor_pressure = MyMetrics.InitFloat("zph2.h.compressor.pressure", SM_STALE_MID, 0, kPa);
|
||||||
|
mt_hvac_compressor_power = MyMetrics.InitFloat("zph2.h.compressor.power", SM_STALE_MID, 0, Watts);
|
||||||
|
mt_hvac_compressor_mode = MyMetrics.InitString("zph2.h.compressor.mode", SM_STALE_MID, 0);
|
||||||
|
|
||||||
// BMS configuration:
|
// BMS configuration:
|
||||||
BmsSetCellArrangementVoltage(96, 1);
|
BmsSetCellArrangementVoltage(96, 1);
|
||||||
BmsSetCellArrangementTemperature(12, 1);
|
BmsSetCellArrangementTemperature(12, 1);
|
||||||
|
|
|
@ -99,6 +99,9 @@ class OvmsVehicleRenaultZoePh2 : public OvmsVehicle {
|
||||||
OvmsMetricFloat *mt_inv_hv_current; //Battery current sense
|
OvmsMetricFloat *mt_inv_hv_current; //Battery current sense
|
||||||
OvmsMetricFloat *mt_bat_max_charge_power; //Battery max charge power
|
OvmsMetricFloat *mt_bat_max_charge_power; //Battery max charge power
|
||||||
OvmsMetricFloat *mt_hvac_compressor_speed; //Compressor speed
|
OvmsMetricFloat *mt_hvac_compressor_speed; //Compressor speed
|
||||||
|
OvmsMetricFloat *mt_hvac_compressor_pressure;//Compressor pressure
|
||||||
|
OvmsMetricFloat *mt_hvac_compressor_power; //Compressor power
|
||||||
|
OvmsMetricString *mt_hvac_compressor_mode; //Compressor mode
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
string zoe_obd_rxbuf;
|
string zoe_obd_rxbuf;
|
||||||
|
|
Loading…
Reference in a new issue