robinostlund / homeassistant-volkswagencarnet

Volkswagen Carnet Component for home assistant
GNU General Public License v3.0
327 stars 60 forks source link

[BUG][v4.5.5] New Car type sensors breaks the integration for some vehicles #589

Closed Robindeko closed 7 months ago

Robindeko commented 7 months ago

Before you post a new issue - you must first check the following (and check the boxes with an "X" below)

Environment

Describe the bug

Steps to Reproduce

Expected behavior

Screenshots

Traceback/Error logs

Debug information - all JSON responses from logfile

Additional context

SaschaWeicht commented 7 months ago

I believe some logs would be very helpful for understanding whats (not) going on. Add the following to your configuration.yaml

logger:
    default: info
    logs:
        volkswagencarnet: debug
        dashboard: debug
        custom_components.volkswagencarnet: debug
        custom_components.volkswagencarnet.climate: debug
        custom_components.volkswagencarnet.lock: debug
        custom_components.volkswagencarnet.device_tracker: debug
        custom_components.volkswagencarnet.switch: debug
        custom_components.volkswagencarnet.binary_sensor: debug
        custom_components.volkswagencarnet.sensor: debug

Activate the debug logging for the integration, restart the integration and pull the logs from HA for the developers to have a look.

stickpin commented 7 months ago

@Robindeko, It will be helpful if you will provide the logs otherwise this issue is useless and can be closed.

stickpin commented 7 months ago

Thanks @SaschaWeicht! :))

Timer2000 commented 7 months ago

Here the same Bug

stickpin commented 7 months ago

@Timer2000 same as which bug? How did you manage to get to this conclusion without any logs? 🤨

Robindeko commented 7 months ago

Home assistant.log

Here is my logfile, after enabling debug log. Thanks for your help!

stickpin commented 7 months ago

@Robindeko thanks. i see the problem, i will fix it in the next version. Roll back to v4.5.4 for the time being...

stickpin commented 7 months ago

@Robindeko Just a bit technical details. Your car is not reporting back the fuelStatus, well technically it's reporting but with an error:

  "fuelStatus": {
    "rangeStatus": {
      "error": {
        "message": "Bad Gateway",
        "errorTimeStamp": "datetime.datetime(2024, 2, 28, 12, 0, 10, tzinfo=datetime.timezone.utc)",
        "info": "Upstream service responded with an unexpected status. If the problem persists, please contact our support.",
        "code": 4007,
        "group": 2,
        "retry": true
      }
    }
  },

So i cannot detect the vehicle type. I have around 15 different vehicles now that I am testing with and i never saw such response.

So in your case carType is coming as part of the measurements:

  "measurements": {
    "fuelLevelStatus": {
      "value": {
        "carCapturedTimestamp": "datetime.datetime(2024, 2, 28, 11, 25, 7, tzinfo=datetime.timezone.utc)",
        "currentFuelLevel_pct": 100,
        "primaryEngineType": "gasoline",
        "secondaryEngineType": "electric",
        "carType": "hybrid"
      }
    }

I will cover such use case in the next version.

Timer2000 commented 7 months ago

@Timer2000 same as which bug? How did you manage to get to this conclusion without any logs? 🤨

I have start yesterday with the issue, But it was closed without any Feedback. Im a User an not a Developer, so i can help when i have help.

Robindeko commented 7 months ago

@Robindeko Just a bit technical details. Your car is not reporting back the fuelStatus, well technically it's reporting but with an error:

  "fuelStatus": {
    "rangeStatus": {
      "error": {
        "message": "Bad Gateway",
        "errorTimeStamp": "datetime.datetime(2024, 2, 28, 12, 0, 10, tzinfo=datetime.timezone.utc)",
        "info": "Upstream service responded with an unexpected status. If the problem persists, please contact our support.",
        "code": 4007,
        "group": 2,
        "retry": true
      }
    }
  },

So i cannot detect the vehicle type. I have around 15 different vehicles now that I am testing with and i never saw such response.

So in your case carType is coming as part of the measurements:

  "measurements": {
    "fuelLevelStatus": {
      "value": {
        "carCapturedTimestamp": "datetime.datetime(2024, 2, 28, 11, 25, 7, tzinfo=datetime.timezone.utc)",
        "currentFuelLevel_pct": 100,
        "primaryEngineType": "gasoline",
        "secondaryEngineType": "electric",
        "carType": "hybrid"
      }
    }

I will cover such use case in the next version.

Thanks for investigating! What I find strange though, is that it used to report the fuelstatus back correctly in HA. Did the response from VW change then?

stickpin commented 7 months ago

OFFTOPIC @Timer2000 Sorry mate, you've got the feedback: https://github.com/robinostlund/homeassistant-volkswagencarnet/issues/588 but I guess you are not willing to accept the answer. The rate limit might be hit due to misuse of the integration or multiple integrations. If you have debugging logs to share, you can share them in the thread you've opened (https://github.com/robinostlund/homeassistant-volkswagencarnet/issues/588). Your issue is not related to this issue.

stickpin commented 7 months ago

@Robindeko Just a bit technical details. Your car is not reporting back the fuelStatus, well technically it's reporting but with an error:

  "fuelStatus": {
    "rangeStatus": {
      "error": {
        "message": "Bad Gateway",
        "errorTimeStamp": "datetime.datetime(2024, 2, 28, 12, 0, 10, tzinfo=datetime.timezone.utc)",
        "info": "Upstream service responded with an unexpected status. If the problem persists, please contact our support.",
        "code": 4007,
        "group": 2,
        "retry": true
      }
    }
  },

So i cannot detect the vehicle type. I have around 15 different vehicles now that I am testing with and i never saw such response. So in your case carType is coming as part of the measurements:

  "measurements": {
    "fuelLevelStatus": {
      "value": {
        "carCapturedTimestamp": "datetime.datetime(2024, 2, 28, 11, 25, 7, tzinfo=datetime.timezone.utc)",
        "currentFuelLevel_pct": 100,
        "primaryEngineType": "gasoline",
        "secondaryEngineType": "electric",
        "carType": "hybrid"
      }
    }

I will cover such use case in the next version.

Thanks for investigating! What I find strange though, is that it used to report the fuelstatus back correctly in HA. Did the response from VW change then?

Thats correct. I covered this issue with the fuelstatus sensor as well a few versions ago. I don't have an explanation yet, why VW replies differently even for the same model of the vehicle. I have one Passat GTE but 2018 in my cars pool and it's working fine.

megabyte0469 commented 7 months ago

@stickpin: I have a Passat GTE 2021 here and unfortunately it is currently Climatisation (AuxiliaryClimatisation:auxiliary_climatisation) is not supported. Apparently there are also differences within the model years

stickpin commented 7 months ago

@megabyte0469 Yes, I am aware of it. Unfortunately, VW doesn't have universal APIs for all types of vehicles. Currently, Auxiliary Heater will work only with combustion (diesel/petrol) vehicles, because that's the only vehicle that I had access to during the development.

For hybrids, it works differently, and now I've got access to one hybrid vehicle with an Auxiliary Heater as well. My current roadmap is to enable climatisation, climatisation settings, and battery settings on ID models, and then I will come back to Auxiliary Heater for hybrids.

All this research and development process is very time-consuming because obviously, we don't have any documentation from the VW side.

megabyte0469 commented 7 months ago

@stickpin Thanks for the information. And many thanks for your great work. I know it is unfortunately very time-consuming if there is no proper description of an interface. I am not surprised that the whole thing is so chaotic at VW. The changeover from the old to the new app alone was absolute chaos on the part of VW.

stickpin commented 7 months ago

The v4.5.6 is released https://github.com/robinostlund/homeassistant-volkswagencarnet/releases/tag/v4.5.6. The issue should be resolved.