bimmerconnected / bimmer_connected

🚘 Library to query the status of your BMW or Mini from the ConnectedDrive portal
Apache License 2.0
372 stars 81 forks source link

combustionRange contains a wrong value - at least for hybrid cars #352

Closed HeikoXT closed 2 years ago

HeikoXT commented 2 years ago

Describe the issue

In the vehicle status output of bimmerconnected for my car (G21, PLUGIN_HYBRID) I get these values:

Expected behavior

Same output as in the car and in the My BMW App:

Which Home Assistant version are you using?

core-2021.11.4 / bimmerconnected 0.8.0

What was the last working version of Home Assistant Core?

No response

What is your region?

Rest of world

ConnectedDrive website

Number of cars

Output of bimmer_connected fingerprint

[
  {
    "a4aType": "NOT_SUPPORTED",
    "bodyType": "G21",
    "brand": "BMW",
    "capabilities": {
      "canRemoteHistoryBeDeleted": false,
      "climateNow": {
        "executionMessage": "Do you want to ventilate now? Remote functions may take a few seconds.",
        "executionPopup": {
          "executionMessage": "Turn pre-conditioning on now? Remote functions may take a few seconds.",
          "iconId": 59733,
          "popupType": "DIALOG",
          "primaryButtonText": "Start",
          "secondaryButtonText": "Cancel",
          "title": "Start Climatization"
        },
        "executionStopPopup": {
          "executionMessage": "Stop climate control in your vehicle now? Remote functions may take a few seconds.",
          "title": "Climate control is running"
        },
        "isEnabled": true,
        "isPinAuthenticationRequired": false
      },
      "horn": {
        "executionMessage": "Using your horn is only allowed in certain situations in many countries. Responsibility for the use and adherence to the respective regulations lies solely with you as the user. \n\nDo you want to use the horn now? Remote functions may take a few seconds.",
        "isEnabled": true,
        "isPinAuthenticationRequired": false
      },
      "isBmwChargingSupported": true,
      "isCarSharingSupported": false,
      "isChargeNowForBusinessSupported": true,
      "isChargingHistorySupported": true,
      "isChargingHospitalityEnabled": false,
      "isChargingLoudnessEnable": false,
      "isChargingPlanSupported": true,
      "isChargingPowerLimitEnable": false,
      "isChargingSettingsEnabled": false,
      "isChargingTargetSocEnable": false,
      "isCustomerEsimSupported": false,
      "isDCSContractManagementSupported": true,
      "isDataPrivacyEnabled": false,
      "isEasyChargeSupported": false,
      "isEvGoChargingSupported": false,
      "isFindChargingEnabled": true,
      "isMiniChargingSupported": false,
      "isRemoteHistorySupported": true,
      "isRemoteServicesActivationRequired": false,
      "isRemoteServicesBookingRequired": false,
      "isScanAndChargeSupported": true,
      "lastStateCall": {
        "isNonLscFeatureEnabled": false,
        "lscState": "ACTIVATED"
      },
      "lights": {
        "executionMessage": "Flash headlights now? Remote functions may take a few seconds.",
        "isEnabled": true,
        "isPinAuthenticationRequired": false
      },
      "lock": {
        "executionMessage": "Lock your vehicle now? Remote functions may take a few seconds.",
        "isEnabled": true,
        "isPinAuthenticationRequired": false
      },
      "remote360": {
        "isComingSoonEnabled": false,
        "isDataPrivacyEnabled": false,
        "isEnabled": true,
        "isPinAuthenticationRequired": false,
        "isToggleEnabled": true
      },
      "remoteSoftwareUpgrade": {
        "isEnabled": true,
        "isPinAuthenticationRequired": false
      },
      "sendPoi": {
        "executionMessage": "Send POI now? Remote functions may take a few seconds.",
        "isEnabled": true,
        "isPinAuthenticationRequired": false
      },
      "speechThirdPartyAlexa": {
        "executionMessage": "Activate Alexa now? Remote functions may take a few seconds.",
        "isEnabled": true,
        "isPinAuthenticationRequired": false
      },
      "unlock": {
        "executionMessage": "Unlock your vehicle now? Remote functions may take a few seconds.",
        "isEnabled": true,
        "isPinAuthenticationRequired": true
      },
      "vehicleFinder": {
        "executionMessage": "Find your vehicle now? Remote functions may take a few seconds.",
        "isEnabled": true,
        "isPinAuthenticationRequired": false
      }
    },
    "connectedDriveServices": [
      "WIFI_HOTSPOT_SERVICE"
    ],
    "driveTrain": "PLUGIN_HYBRID",
    "driverGuideInfo": {
      "androidAppScheme": "com.bmwgroup.driversguide.row",
      "androidStoreUrl": "https://play.google.com/store/apps/details?id=com.bmwgroup.driversguide.row",
      "iosAppScheme": "bmwdriversguide:///open",
      "iosStoreUrl": "https://apps.apple.com/de/app/id714042749?mt=8",
      "title": "BMW\nDriver's Guide"
    },
    "exFactoryILevel": "S18A-20-11-530",
    "exFactoryPUStep": "1120",
    "headUnit": "MGU",
    "hmiVersion": "id7",
    "iStep": "S18A-21-07-550",
    "isLscSupported": true,
    "isMappingPending": false,
    "isMappingUnconfirmed": false,
    "model": "330e xDrive",
    "properties": {
      "areDoorsClosed": true,
      "areDoorsLocked": true,
      "areDoorsOpen": false,
      "areWindowsClosed": true,
      "chargingState": {
        "chargePercentage": 53,
        "isChargerConnected": true,
        "state": "CHARGING",
        "type": "NOT_AVAILABLE"
      },
      "checkControlMessages": [],
      "climateControl": {
        "activity": "INACTIVE"
      },
      "combinedRange": {
        "distance": {
          "units": "KILOMETERS",
          "value": 87
        }
      },
      "combustionRange": {
        "distance": {
          "units": "KILOMETERS",
          "value": 87
        }
      },
      "doorsAndWindows": {
        "doors": {
          "driverFront": "CLOSED",
          "driverRear": "CLOSED",
          "passengerFront": "CLOSED",
          "passengerRear": "CLOSED"
        },
        "hood": "CLOSED",
        "trunk": "CLOSED",
        "windows": {
          "driverFront": "CLOSED",
          "driverRear": "CLOSED",
          "passengerFront": "CLOSED",
          "passengerRear": "CLOSED"
        }
      },
      "electricRange": {
        "distance": {
          "units": "KILOMETERS",
          "value": 17
        }
      },
      "electricRangeAndStatus": {
        "chargePercentage": 53,
        "distance": {
          "units": "KILOMETERS",
          "value": 17
        }
      },
      "fuelLevel": {
        "units": "LITERS",
        "value": 6
      },
      "fuelPercentage": {
        "value": 17
      },
      "inMotion": false,
      "isServiceRequired": false,
      "lastUpdatedAt": "2021-11-18T20:13:18Z",
      "originCountryISO": "DE",
      "serviceRequired": [
        {
          "dateTime": "2022-11-01T00:00:00.000Z",
          "distance": {
            "units": "KILOMETERS",
            "value": 12000
          },
          "status": "OK",
          "type": "OIL"
        },
        {
          "dateTime": "2024-11-01T00:00:00.000Z",
          "distance": {
            "units": "KILOMETERS",
            "value": 45000
          },
          "status": "OK",
          "type": "VEHICLE_CHECK"
        },
        {
          "status": "OK",
          "type": "TIRE_WEAR_FRONT"
        },
        {
          "status": "OK",
          "type": "TIRE_WEAR_REAR"
        },
        {
          "dateTime": "2023-11-01T00:00:00.000Z",
          "status": "OK",
          "type": "BRAKE_FLUID"
        },
        {
          "dateTime": "2024-01-01T00:00:00.000Z",
          "status": "OK",
          "type": "VEHICLE_TUV"
        },
        {
          "dateTime": "2024-01-01T00:00:00.000Z",
          "status": "OK",
          "type": "EMISSION_CHECK"
        }
      ],
      "tires": {
        "frontLeft": {
          "details": {
            "dimension": "0/0 R0 0",
            "mountingDate": "11/16/2021",
            "optimizedForOemBmw": "No"
          },
          "status": {
            "currentPressure": 230,
            "localizedCurrentPressure": "2.3 bar",
            "localizedTargetPressure": "2.2 bar",
            "targetPressure": 220,
            "wear": 0
          }
        },
        "frontRight": {
          "details": {
            "dimension": "0/0 R0 0",
            "mountingDate": "11/16/2021",
            "optimizedForOemBmw": "No"
          },
          "status": {
            "currentPressure": 230,
            "localizedCurrentPressure": "2.3 bar",
            "localizedTargetPressure": "2.2 bar",
            "targetPressure": 220,
            "wear": 0
          }
        },
        "rearLeft": {
          "details": {
            "dimension": "0/0 R0 0",
            "mountingDate": "11/16/2021",
            "optimizedForOemBmw": "No"
          },
          "status": {
            "currentPressure": 240,
            "localizedCurrentPressure": "2.4 bar",
            "localizedTargetPressure": "2.8 bar",
            "targetPressure": 280,
            "wear": 0
          }
        },
        "rearRight": {
          "details": {
            "dimension": "0/0 R0 0",
            "mountingDate": "11/16/2021",
            "optimizedForOemBmw": "No"
          },
          "status": {
            "currentPressure": 230,
            "localizedCurrentPressure": "2.3 bar",
            "localizedTargetPressure": "2.8 bar",
            "targetPressure": 280,
            "wear": 0
          }
        }
      },
      "vehicleLocation": {
        "address": {
          "formatted": "some_formatted_address"
        },
        "coordinates": {
          "latitude": 90,
          "longitude": 90
        },
        "heading": 123
      }
    },
    "puStep": "0721",
    "status": {
      "chargingProfile": {
        "chargingControlType": "weeklyPlanner",
        "chargingMode": "immediateCharging",
        "chargingPreference": "noPreSelection",
        "chargingSettings": {
          "hospitality": "NO_ACTION",
          "idcc": "NO_ACTION",
          "isAcCurrentLimitActive": false,
          "targetSoc": 100
        },
        "climatisationOn": true,
        "departureTimes": [
          {
            "action": "activate",
            "id": 1,
            "timeStamp": {
              "hour": 7,
              "minute": 50
            },
            "timerWeekDays": [
              "monday",
              "wednesday",
              "thursday",
              "friday"
            ]
          },
          {
            "action": "deactivate",
            "id": 2,
            "timeStamp": {
              "hour": 8,
              "minute": 5
            },
            "timerWeekDays": [
              "tuesday"
            ]
          },
          {
            "action": "deactivate",
            "id": 3,
            "timeStamp": {
              "hour": 7,
              "minute": 30
            },
            "timerWeekDays": []
          },
          {
            "action": "deactivate",
            "id": 4,
            "timeStamp": {
              "hour": 7,
              "minute": 50
            },
            "timerWeekDays": [
              "friday"
            ]
          }
        ],
        "reductionOfChargeCurrent": {
          "end": {
            "hour": 7,
            "minute": 0
          },
          "start": {
            "hour": 23,
            "minute": 0
          }
        }
      },
      "checkControlMessages": [
        {
          "criticalness": "nonCritical",
          "iconId": 60117,
          "state": "OK",
          "title": "Tires"
        },
        {
          "criticalness": "nonCritical",
          "iconId": 60197,
          "state": "OK",
          "title": "Engine Oil"
        }
      ],
      "checkControlMessagesGeneralState": "No Issues",
      "currentMileage": {
        "formattedMileage": "21148",
        "mileage": 21148,
        "units": "km"
      },
      "doorsAndWindows": [
        {
          "criticalness": "nonCritical",
          "iconId": 59757,
          "state": "Locked",
          "title": "Lock status"
        },
        {
          "criticalness": "nonCritical",
          "iconId": 59722,
          "state": "Closed",
          "title": "All doors"
        },
        {
          "criticalness": "nonCritical",
          "iconId": 59725,
          "state": "Closed",
          "title": "All windows"
        },
        {
          "criticalness": "nonCritical",
          "iconId": 59706,
          "state": "Closed",
          "title": "Hood"
        },
        {
          "criticalness": "nonCritical",
          "iconId": 59704,
          "state": "Closed",
          "title": "Trunk"
        }
      ],
      "doorsGeneralState": "Locked",
      "fuelIndicators": [
        {
          "chargingType": null,
          "iconOpacity": "high",
          "infoIconId": 59691,
          "infoLabel": "Combined Range",
          "isCircleIcon": false,
          "isInaccurate": false,
          "levelIconId": null,
          "levelUnits": null,
          "levelValue": null,
          "mainBarValue": 0,
          "rangeIconId": 59691,
          "rangeUnits": "km",
          "rangeValue": "87",
          "secondaryBarValue": 0,
          "showsBar": false
        },
        {
          "barType": null,
          "chargingStatusIndicatorType": "CHARGING",
          "chargingStatusType": "CHARGING",
          "chargingType": "charging",
          "iconOpacity": "high",
          "infoIconId": 59689,
          "infoLabel": "100% at ~03:21 AM",
          "isCircleIcon": true,
          "isInaccurate": true,
          "levelIconId": 59689,
          "levelUnits": "%",
          "levelValue": "53",
          "mainBarValue": 53,
          "rangeIconId": 59683,
          "rangeUnits": "km",
          "rangeValue": "17",
          "secondaryBarValue": 0,
          "showBarGoal": false,
          "showsBar": true
        },
        {
          "chargingType": null,
          "iconOpacity": "high",
          "infoIconId": 59930,
          "infoLabel": "Fuel Level",
          "isCircleIcon": false,
          "isInaccurate": false,
          "levelIconId": 59682,
          "levelUnits": "%",
          "levelValue": "17",
          "mainBarValue": 17,
          "rangeIconId": 59681,
          "rangeUnits": "km",
          "rangeValue": "70",
          "secondaryBarValue": 0,
          "showsBar": true
        }
      ],
      "issues": {},
      "lastUpdatedAt": "2021-11-18T20:13:18Z",
      "recallExternalUrl": null,
      "recallMessages": [],
      "requiredServices": [
        {
          "criticalness": "nonCritical",
          "iconId": 60197,
          "id": "Oil",
          "longDescription": "Next service due after the specified distance or date.",
          "subtitle": "some_road \u2022 duration \u2022 -- EUR",
          "title": "Engine oil"
        },
        {
          "criticalness": "nonCritical",
          "iconId": 60215,
          "id": "VehicleCheck",
          "longDescription": "Next vehicle check due after the specified distance or date.",
          "subtitle": "some_road \u2022 duration \u2022 -- EUR",
          "title": "Vehicle check"
        },
        {
          "criticalness": "nonCritical",
          "iconId": 60447,
          "id": "TireWearFront",
          "subtitle": "some_road \u2022 duration \u2022 -- EUR",
          "title": "Tire service, front tires"
        },
        {
          "criticalness": "nonCritical",
          "iconId": 60447,
          "id": "TireWearRear",
          "subtitle": "some_road \u2022 duration \u2022 -- EUR",
          "title": "Tire service, rear tires"
        },
        {
          "criticalness": "nonCritical",
          "iconId": 60223,
          "id": "BrakeFluid",
          "longDescription": "Next service due by the specified date.",
          "subtitle": "some_road \u2022 duration \u2022 -- EUR",
          "title": "Brake fluid"
        },
        {
          "criticalness": "nonCritical",
          "iconId": 60111,
          "id": "VehicleAdmissionTest",
          "longDescription": "Next state inspection due by the specified date.",
          "subtitle": "some_road \u2022 duration \u2022 -- EUR",
          "title": "Vehicle Inspection"
        },
        {
          "criticalness": "nonCritical",
          "iconId": 60200,
          "id": "EmissionCheck",
          "longDescription": "Next state emission inspection due by the specified date.",
          "subtitle": "some_road \u2022 duration \u2022 -- EUR",
          "title": "Emission inspection"
        }
      ],
      "timestampMessage": "Updated from vehicle 11/18/2021 09:13 PM"
    },
    "telematicsUnit": "ATM02",
    "themeSpecs": {
      "vehicleStatusBackgroundColor": {
        "blue": 92,
        "green": 89,
        "red": 85
      }
    },
    "vin": "some_vin",
    "year": 2020
  }
]

Anything in the logs that might be useful for us?

fuelIndicators show the correct ranges.
properties.combustionRange is wrong

Additional information

No response

rikroe commented 2 years ago

The when using 0.8.0, fuelIndicators should be used. Please double check if it is installed. Otherwise, please also provide the output of bimmerconnected status -j ... as this should contain both the parsed & original values.

HeikoXT commented 2 years ago

I want to clarify: I have installed Home Assistant core-2021.11.5 with the included version of bimmerconnected. It is the unusable broken version, which should be fixed in version 0.8.0.

I installed bimmer_connected version 0.8.0 in my WSL and executed it there via CLI. The raw values in the output from bimmerconnected fingerprint/status still show a wrong value for combustionRange. But if it isn't used, I don't care. And if you say the Home Assistant integration will use the values from fuelIndicator, I'm fine. As I said fuelIndicators show the correct ranges. And as I see now in the status output, the values remaining_range_fuel, remaining_range_totaland (as before) remaining_range_electrichave the correct values. I guess these are the values used in Home Assistant.

So I'm looking forward to the integration of the fixed version 0.8.0 into Home Assistant.

rikroe commented 2 years ago

Perfect - then you will see the correct values once the data is merged into Home Assistant. combustionRange is the value that is reported from the BMW API (and which is sometimes wrong). Don't now why it doesn't get fixed.

HeikoXT commented 2 years ago

Thanks!

github-actions[bot] commented 2 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.