Another try to read TPMS temps properly

This commit is contained in:
Carsten Schmiemann 2022-05-11 17:46:41 +02:00
parent 3ea43525b2
commit 34fe261ec9
1 changed files with 8 additions and 8 deletions

View File

@ -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