robinostlund / homeassistant-volkswagencarnet

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

3 errors - Token cannot be verified, could not fetch data for VIN and wrong sensor configuration[BUG] #570

Closed StefanoGiu closed 4 months ago

StefanoGiu commented 4 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

3 errors - Token cannot be verified, could not fetch data for VIN and wrong sensor configuration[BUG]

Steps to Reproduce

At the restart of HA I got the following 3 errors

Expected behavior

Fix the 3 issues above

Screenshots

Traceback/Error logs

2024-02-13 07:52:00.932 WARNING (MainThread) [volkswagencarnet.vw_connection] User identity token could not be verified!
2024-02-13 07:52:47.985 ERROR (SyncWorker_3) [weconnect] Failed to retrieve data for VIN XXXXXXXXXXXXXXX: Could not fetch data. Status Code was: 429
2024-02-13 07:52:48.016 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.golf_last_trip_average_electric_consumption (<class 'custom_components.volkswagen_we_connect_id.sensor.VolkswagenIDVehicleSensor'>) is using state class 'measurement' which is impossible considering device class ('energy') it is using; expected None or one of 'total_increasing', 'total'; Please update your configuration if your entity is manually configured, otherwise report it to the author of the 'volkswagen_we_connect_id' custom integration

Debug information - all JSON responses from logfile

Additional context

stickpin commented 4 months ago

2024-02-13 07:52:47.985 ERROR (SyncWorker_3) [weconnect] Failed to retrieve data for VIN XXXXXXXXXXXXXXX: Could not fetch data. Status Code was: 429

429 is a rate limit. you've managed to exhaust your API limit. Are you sure your pulling time is set to 5 minutes or have you changed it to 1 minute? You should be able to see this in the Diagnostic section as well: Screenshot 2024-02-13 at 18 45 52

StefanoGiu commented 4 months ago

Refresh is set every 5 mins... what about the other 2 errors?

stickpin commented 4 months ago

it's a warning not an error

StefanoGiu commented 4 months ago

I know... but it's annoying and should not be there...

Moreover... this is an error... ERROR (SyncWorker_3) [weconnect] Failed to retrieve data for VIN XXXXXXXXXXXX

stickpin commented 4 months ago

and I've replied to you why you have this error. https://github.com/robinostlund/homeassistant-volkswagencarnet/issues/570#issuecomment-1942095945

StefanoGiu commented 4 months ago

And I also have replied you that the refresh rate is every 5 mins... so?? Can someone look at the code? What about the other 2 warnings???

stickpin commented 4 months ago

regarding the rate limit, nothing I can do about at the code. You need to check on your side, how you've managed to exhaust the API limit. Regarding warnings currently we have more important issues to resolve first. If it's annoying you and you have a solution, feel free to submit a PR.

stickpin commented 4 months ago

Just noticed it now. These error and warning messages aren't originating from our integration. You are running two integrations in parallel, that is how you've managed to exhaust the rate limit.

2024-02-13 07:52:47.985 ERROR (SyncWorker_3) [weconnect] Failed to retrieve data for VIN XXXXXXXXXXXXXXX: Could not fetch data. Status Code was: 429
2024-02-13 07:52:48.016 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.golf_last_trip_average_electric_consumption (<class 'custom_components.volkswagen_we_connect_id.sensor.VolkswagenIDVehicleSensor'>) is using state class 'measurement' which is impossible considering device class ('energy') it is using; expected None or one of 'total_increasing', 'total'; Please update your configuration if your entity is manually configured, otherwise report it to the author of the 'volkswagen_we_connect_id' custom integration