From 34fe261ec902f0a25d32a04cf15b03a4fa59991d Mon Sep 17 00:00:00 2001 From: Carsten Schmiemann Date: Wed, 11 May 2022 17:46:41 +0200 Subject: [PATCH] Another try to read TPMS temps properly --- .../vehicle_renaultzoe_ph2/src/BCM_pids.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/OVMS.V3/components/vehicle_renaultzoe_ph2/src/BCM_pids.cpp b/OVMS.V3/components/vehicle_renaultzoe_ph2/src/BCM_pids.cpp index 9c27c3d..946aacc 100644 --- a/OVMS.V3/components/vehicle_renaultzoe_ph2/src/BCM_pids.cpp +++ b/OVMS.V3/components/vehicle_renaultzoe_ph2/src/BCM_pids.cpp @@ -57,30 +57,30 @@ void OvmsVehicleRenaultZoePh2::IncomingBCM(uint16_t type, uint16_t pid, const ch } case 0x6310: { // TPMS temp - front left if (CAN_UINT(0) < 32512) { - StandardMetrics.ms_v_tpms_temp->SetElemValue(MS_V_TPMS_IDX_FL, (30.0f - (CAN_UINT(0) * 0.001)), Celcius); + StandardMetrics.ms_v_tpms_temp->SetElemValue(MS_V_TPMS_IDX_FL, ((CAN_NIB(0) * 0.001) - 30.0f), Celcius); } - ESP_LOGD(TAG, "6310 BCM tpms temp FL: %f", fabs((CAN_NIB(0) * 0.001) - 30.0f)); + ESP_LOGD(TAG, "6310 BCM tpms temp FL: %f", ((CAN_NIB(0) * 0.001) - 30.0f)); break; } case 0x6311: { // TPMS temp - front right if (CAN_UINT(0) < 32512) { - StandardMetrics.ms_v_tpms_temp->SetElemValue(MS_V_TPMS_IDX_FR, (30.0f - (CAN_UINT(0) * 0.001)), Celcius); + StandardMetrics.ms_v_tpms_temp->SetElemValue(MS_V_TPMS_IDX_FR, ((CAN_NIB(0) * 0.001) - 30.0f), Celcius); } - ESP_LOGD(TAG, "6311 BCM tpms temp FR: %f", fabs((CAN_NIBL(0) * 0.001) - 30.0f)); + ESP_LOGD(TAG, "6311 BCM tpms temp FR: %f", ((CAN_NIB(0) * 0.001) - 30.0f)); break; } case 0x6312: { // TPMS temp - rear left if (CAN_UINT(0) < 32512) { - StandardMetrics.ms_v_tpms_temp->SetElemValue(MS_V_TPMS_IDX_RL, (30.0f - (CAN_UINT(0) * 0.001)), Celcius); + StandardMetrics.ms_v_tpms_temp->SetElemValue(MS_V_TPMS_IDX_RL, ((CAN_NIB(0) * 0.001) - 30.0f), Celcius); } - ESP_LOGD(TAG, "6312 BCM tpms temp RL: %f", fabs((CAN_NIBH(0) * 0.001) - 30.0f)); + ESP_LOGD(TAG, "6312 BCM tpms temp RL: %f", ((CAN_NIB(0) * 0.001) - 30.0f)); break; } case 0x6313: { // TPMS temp - rear right if (CAN_UINT(0) < 32512) { - StandardMetrics.ms_v_tpms_temp->SetElemValue(MS_V_TPMS_IDX_RR, (30.0f - (CAN_UINT(0) * 0.001)), Celcius); + StandardMetrics.ms_v_tpms_temp->SetElemValue(MS_V_TPMS_IDX_RR, ((CAN_NIB(0) * 0.001) - 30.0f), Celcius); } - ESP_LOGD(TAG, "6313 BCM tpms temp RR: %f", fabs((CAN_BYTE(0) * 0.001) - 30.0f)); + ESP_LOGD(TAG, "6313 BCM tpms temp RR: %f", ((CAN_NIB(0) * 0.001) - 30.0f)); break; } case 0x4109: { // TPMS alert - front left