robinostlund / homeassistant-volkswagencarnet

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

connection error #493

Closed kwithus closed 1 year ago

kwithus commented 1 year ago

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

Environment

HA core 2023.8.4 latest version of integration

Describe the bug

Integration reports need of re-configuration, which is then done and successful, however short after connection is lost again and integration asks for re-configuration. I deleted the integration and reinstalled everything, initial configuration was again successful, but again short after it was lost

I can log in with same credentials via App or Web

Steps to Reproduce

Expected behavior

Screenshots

Traceback/Error logs

Dieser Fehler wurde von einer benutzerdefinierten Integration verursacht

Logger: custom_components.volkswagencarnet Source: helpers/update_coordinator.py:229 Integration: Volkswagen WeConnect (documentation, issues) First occurred: 14:11:16 (2 occurrences) Last logged: 15:03:50

Error fetching volkswagencarnet data: Failed to update WeConnect. Need to accept EULA? Try logging in to the portal: https://www.portal.volkswagen-we.com/

Dieser Fehler wurde von einer benutzerdefinierten Integration verursacht

Logger: custom_components.volkswagencarnet Source: custom_components/volkswagencarnet/init.py:489 Integration: Volkswagen WeConnect (documentation, issues) First occurred: 14:11:16 (2 occurrences) Last logged: 15:03:50

Could not query update from volkswagen WeConnect

Dieser Fehler wurde von einer benutzerdefinierten Integration verursacht

Logger: volkswagencarnet.vw_connection Source: custom_components/volkswagencarnet/init.py:541 Integration: Volkswagen WeConnect (documentation, issues) First occurred: 14:11:16 (2 occurrences) Last logged: 15:03:50

Could not update information: 'serviceInfo'-->

Additional context

Logger: volkswagencarnet.vw_connection Source: runner.py:179 First occurred: 14:05:52 (109 occurrences) Last logged: 15:03:50 Got unhandled error from server: 429 Could not fetch pre-heating, HTTP status code: 429 Could not fetch climatisation, HTTP status code: 429 Could not fetch carportData, error: 'WVWZZZAUZL8916704' Could not fetch operation list, error: 'WVWZZZAUZL8916704'
jurrianv commented 1 year ago

@jurrianv ok it works for you under 8.4. Which location did you use for WE Connect? I'm starting to think this is a location problem with WeConnect. Because for some it still works under 8.4 and for others (like me) it doesn't.

It did work on 8.4. But not anymore. The location is The Netherlands.

mrandt commented 1 year ago

Ok, I retried - still fails with HTTP 429 - but not on authentication but when "Fetching vehicles". Below is a more verbose log from trying to re-add the integration.

As you can see, my location is also Germany.

I don't think it is caused by "common rate limiting", as I can connect to the API with same user ID and from same network (public IP) using App and using EVCC as clients.

I am happy to provide additional logs or network traces if that helps diagnose the issue.

2023-08-27 13:20:47.556 DEBUG (MainThread) [custom_components.volkswagencarnet.config_flow] Creating connection to volkswagen weconnect
2023-08-27 13:20:47.556 DEBUG (MainThread) [volkswagencarnet.vw_connection] Using service https://msg.volkswagen.de
2023-08-27 13:20:47.558 DEBUG (MainThread) [volkswagencarnet.vw_connection] Initiating new login
2023-08-27 13:20:47.558 DEBUG (MainThread) [volkswagencarnet.vw_connection] Requesting openid config
2023-08-27 13:20:47.721 DEBUG (MainThread) [volkswagencarnet.vw_connection] Get authorization page from "https://identity.vwgroup.io/oidc/v1/authorize"
2023-08-27 13:20:47.721 DEBUG (MainThread) [volkswagencarnet.vw_connection] Request headers: "{'Connection': 'keep-alive', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9', 'Accept-Encoding': 'gzip, deflate', 'Content-Type': 'application/x-www-form-urlencoded', 'x-requested-with': 'We Connect', 'User-Agent': 'okhttp/3.14.7', 'X-App-Name': 'We Connect'}"
2023-08-27 13:20:47.769 DEBUG (MainThread) [volkswagencarnet.vw_connection] Got redirect to "https://identity.vwgroup.io/signin-service/v1/signin/<truncated>@apps_vw-dilab_com?relayState=<truncated>"
2023-08-27 13:20:47.879 DEBUG (MainThread) [volkswagencarnet.vw_connection] Got authorization endpoint
2023-08-27 13:20:48.091 DEBUG (MainThread) [volkswagencarnet.vw_connection] Authenticating with email and password.
2023-08-27 13:20:48.091 DEBUG (MainThread) [volkswagencarnet.vw_connection] Using login action url: "https://identity.vwgroup.io/signin-service/v1/<truncated>@apps_vw-dilab_com/login/authenticate"
2023-08-27 13:20:48.386 DEBUG (MainThread) [volkswagencarnet.vw_connection] Parsing login response.
2023-08-27 13:20:48.387 DEBUG (MainThread) [volkswagencarnet.vw_connection] Following redirect to "https://identity.vwgroup.io/oidc/v1/oauth/sso?clientId=<truncated>@apps_vw-dilab_com&relayState=<truncated>&userId=<truncated>&HMAC=<truncated>"
2023-08-27 13:20:48.455 DEBUG (MainThread) [volkswagencarnet.vw_connection] Following redirect to "https://identity.vwgroup.io/signin-service/v1/consent/users/<truncated>@apps_vw-dilab_com?scopes=openid%20mbb%20profile%20cars%20address%20email%20birthdate%20nickname%20phone&relayState=<truncated>&callback=https://identity.vwgroup.io/oidc/v1/oauth/client/callback&hmac=<truncated>"
2023-08-27 13:20:48.583 DEBUG (MainThread) [volkswagencarnet.vw_connection] Following redirect to "https://identity.vwgroup.io/oidc/v1/oauth/client/callback/success?user_id=<truncated>&client_id=<truncated>@apps_vw-dilab_com&scopes=openid%20mbb%20profile%20cars%20address%20email%20birthdate%20nickname%20phone&consentedScopes=openid%20mbb%20profile%20cars%20address%20email%20birthdate%20nickname%20phone&relayState=<truncated>"
2023-08-27 13:20:48.692 DEBUG (MainThread) [volkswagencarnet.vw_connection] Login successful, received authorization code.
2023-08-27 13:20:48.692 DEBUG (MainThread) [volkswagencarnet.vw_connection] Trying to fetch user identity tokens.
2023-08-27 13:20:49.085 DEBUG (MainThread) [volkswagencarnet.vw_connection] Got token access_token
2023-08-27 13:20:49.085 DEBUG (MainThread) [volkswagencarnet.vw_connection] Got token expires_in
2023-08-27 13:20:49.085 DEBUG (MainThread) [volkswagencarnet.vw_connection] Got token id_token
2023-08-27 13:20:49.085 DEBUG (MainThread) [volkswagencarnet.vw_connection] Got token refresh_token
2023-08-27 13:20:49.085 DEBUG (MainThread) [volkswagencarnet.vw_connection] Got token token_type
2023-08-27 13:20:49.140 DEBUG (MainThread) [volkswagencarnet.vw_connection] User identity token verified OK.
2023-08-27 13:20:49.140 INFO (MainThread) [volkswagencarnet.vw_connection] Successfully logged in
2023-08-27 13:20:49.140 DEBUG (MainThread) [volkswagencarnet.vw_connection] Trying to fetch api tokens.
2023-08-27 13:20:49.294 DEBUG (MainThread) [volkswagencarnet.vw_connection] Got token access_token
2023-08-27 13:20:49.294 DEBUG (MainThread) [volkswagencarnet.vw_connection] Got token token_type
2023-08-27 13:20:49.294 DEBUG (MainThread) [volkswagencarnet.vw_connection] Got token refresh_token
2023-08-27 13:20:49.294 DEBUG (MainThread) [volkswagencarnet.vw_connection] Got token expires_in
2023-08-27 13:20:49.295 DEBUG (MainThread) [volkswagencarnet.vw_connection] Got token scope
2023-08-27 13:20:49.323 DEBUG (MainThread) [volkswagencarnet.vw_connection] VW-Group API token verified OK.
2023-08-27 13:20:49.324 DEBUG (MainThread) [volkswagencarnet.vw_connection] Fetching vehicles associated with account
2023-08-27 13:20:49.324 DEBUG (MainThread) [volkswagencarnet.vw_connection] HTTP GET "https://msg.volkswagen.de/fs-car/usermanagement/users/v1/VW/DE/vehicles"
2023-08-27 13:20:49.969 DEBUG (MainThread) [volkswagencarnet.vw_connection] Server side throttled. Waiting 3, try 1
2023-08-27 13:20:52.973 DEBUG (MainThread) [volkswagencarnet.vw_connection] HTTP GET "https://msg.volkswagen.de/fs-car/usermanagement/users/v1/VW/DE/vehicles"
2023-08-27 13:20:53.736 DEBUG (MainThread) [volkswagencarnet.vw_connection] Server side throttled. Waiting 1, try 2
2023-08-27 13:20:54.737 DEBUG (MainThread) [volkswagencarnet.vw_connection] HTTP GET "https://msg.volkswagen.de/fs-car/usermanagement/users/v1/VW/DE/vehicles"
2023-08-27 13:20:55.227 DEBUG (MainThread) [volkswagencarnet.vw_connection] Server side throttled. Waiting 3, try 3
2023-08-27 13:20:58.229 DEBUG (MainThread) [volkswagencarnet.vw_connection] HTTP GET "https://msg.volkswagen.de/fs-car/usermanagement/users/v1/VW/DE/vehicles"
2023-08-27 13:20:58.784 ERROR (MainThread) [volkswagencarnet.vw_connection] Got unhandled error from server: 429
2023-08-27 13:20:58.787 WARNING (MainThread) [volkswagencarnet.vw_connection] Failed to login to We Connect API.
raresv commented 1 year ago

[trimmed my original comment as it was likely not helpful] TLDR: I'm trying to use the the volkswagencarnet core lib and also the command line helper volkswagencarnet-client, to see if those work outside of Home Assistant. not much luck there either, but I can't yet figure out where the issue is.

ediazrod commented 1 year ago

I am on the same situation..

janchlebek commented 1 year ago

Interesting situation: I have two HA instances, one stopped working again and the other one is still OK (both are on exactly the same version). So again: this definitely looks like something on VW side, either they are experiencing some outage or doing some changes (hopefully not breaking).

jurrienk commented 1 year ago

Similar issue right after upgrading from HA core 2023.8.1 to HA core 2023.8.4

Have updated data from VW app in HA till 27/8 14:03 . Seems around similar time that i initiated the HA update.

janchlebek commented 1 year ago

The issue is not the HA version, it simply stops working after HA restart regardless of version. Also I was able to reauthenticate on my instance (I was just lucky I guess).

saikimecky commented 1 year ago

Im able to reauth, too. But doesn't work nonetheless.

Johan-de-Bruin commented 1 year ago

Came here to check if more have this issue.

Problem just went away with another try off reauth. This time it did manage initialize! Problem seems on the VW side.

Had the problem on 2023.8.3. Updated to 2023.8.4. Didn't help.

Now, magically went away. Maybe due to the end of the F1 race today at Zandvoort?

Anyway: I also use it to control charging during sunshine. So very happy it's restored.

Smarf1 commented 1 year ago

Removed the WeConnect integration. Created a new one and got the error message "Could not login to Volkswagen We Connect, please check your credentials and verify that the service is working" No problems logging into the app and the web.

raresv commented 1 year ago

It's unlikely to be from VW. I found another Python library which is also quite old (in terms of implementation) and which works perfectly fine. weconnect.

janchlebek commented 1 year ago

It's unlikely to be from VW. I found another Python library which is also quite old (in terms of implementation) and which works perfectly fine. weconnect.

How do you explain then it stops working without any kind of changes to HA from one day to the other on multiple instances?

kwithus commented 1 year ago

I still cannot log in, has robinostlund as owner if this custom integration already reacted somehow?

raresv commented 1 year ago

It's unlikely to be from VW. I found another Python library which is also quite old (in terms of implementation) and which works perfectly fine. weconnect.

How do you explain then it stops working without any kind of changes to HA from one day to the other on multiple instances?

I can't explain. The other library works every time, the mobile app works without issues. I have the same issue with my HAs. In one it stopped working and in another is still trotting along fine. Minor version differences but I found them irrelevant.

shiraz-b commented 1 year ago

Ok - I'm on 2023.5.2 - So I'll up to latest and report back... thanks... (FYI - I'm in the UK, so I use GB for my WeConnect Location)

I've moved on... Don't get the authentication error, but get the http status 429 .. a holdoff?

Logger: volkswagencarnet.vw_connection Source: runner.py:179 First occurred: 10:36:32 PM (3 occurrences) Last logged: 10:36:33 PM

Got unhandled error from server: 429 Could not fetch carportData, error: 'WV....' Could not fetch operation list, error: 'WV...'

robinproof commented 1 year ago

I'm also getting the 429 error. After I authenticate, it says successfull. But after the verification fase it fails again with 429 code. HA 2023.8.4 and v4.4.64

robinostlund commented 1 year ago

Hi, As some maby is aware i dont own a car that supports this integration. But i have seen that volkswagen is mowing the old weconnect/carner to the new weconnect or the Volkswagen app. And this integration doesnt work with the new service. But if someone here with a car that supports this integration and have some time over to help out to fix this, it would be very appreciated.

mrbostad commented 1 year ago

Hi, As some maby is aware i dont own a car that supports this integration. But i have seen that volkswagen is mowing the old weconnect/carner to the new weconnect or the Volkswagen app. And this integration doesnt work with the new service. But if someone here with a car that supports this integration and have some time over to help out to fix this, it would be very appreciated.

I have a VW e-Golf 2019 modell (exclusive with MIB2.5 and digital cluster (the new type) if thats of any relevance), i am able to login on both we connect app and volkswagen app. How can i help? I can add you as a user on the car, i can add you as user on my HA, give you shell access to the HA server. FYI: I`m a Norwegian user, so i can reply in Norwegian. I am available on several chat services, discord, teams, facebook etc.

shiraz-b commented 1 year ago

Tried again this morning with the same http status code of 429 when initialising post authentication. I wonder whether vw have changed the host holdoff algorithm and the variable initialisation is now making "too many" calls too quickly at this stage in the process?

milkboy commented 1 year ago

Getting loads of 429:s. trying to see if it's possible to just keep retying more times (btw, the We Connect app is also insanely slow now.. even more than usually, maybe it also suffers from the throttling?)

Oh, and just retrying more and more with longer delays makes other logic in HA timeout, so can't make the waits too long

lemorak commented 1 year ago

I mainly use the weconnect app. Today I installed the volkswagen app an it says that I don't have an active mobile service contract. After deleting an reinstalling the addon I get the error: "Could not login to Volkswagen We Connect, please check your credentials and verify that the service is working". Maybe this is somehow connected?

Ziepoeskenetnie commented 1 year ago

By me it's working again now

lemorak commented 1 year ago

By me it's working again now

I bet if you restart your system i won't work anymore :-( Maybe you can try it?

Ziepoeskenetnie commented 1 year ago

By me it's working again now

I bet if you restart your system i won't work anymore :-( Maybe you can try it?

Yes, you are right. It's broken again.

GroundAttack commented 1 year ago

I mainly use the weconnect app. Today I installed the volkswagen app an it says that I don't have an active mobile service contract. After deleting an reinstalling the addon I get the error: "Could not login to Volkswagen We Connect, please check your credentials and verify that the service is working". Maybe this is somehow connected?

Interesting. When I installed the Volkswagen app on my android, It connected successfully after some time. The I got an email in German thanking me for my purchase! One wonders if VW are restricting authentication. Here is an extract from the email:

Details of your order |   -- | --     | Order date: 08/26/2023 Article name: e-Remote Beginning of the validity period: 08/06/2020* End of validity period: 08/06/2025 Price (VAT included): 0,- €
lemorak commented 1 year ago

I mainly use the weconnect app. Today I installed the volkswagen app an it says that I don't have an active mobile service contract. After deleting an reinstalling the addon I get the error: "Could not login to Volkswagen We Connect, please check your credentials and verify that the service is working". Maybe this is somehow connected?

Interesting. When I installed the Volkswagen app on my android, It connected successfully after some time. The I got an email in German thanking me for my purchase! One wonders if VW are restricting authentication. Here is an extract from the email:

Details of your order       Order date: 08/26/2023 Article name: e-Remote
Beginning of the validity period: 08/06/2020* End of validity period: 08/06/2025
Price (VAT included): 0,- €

I can login to the volkswagen app an I see my car but there is a button that says that there is no active contract. On the website I can see that it is active till late 2025 ^^

Maybe it is because it's an old e-Golf from 2018!?

FedeL16 commented 1 year ago

Removed the WeConnect integration. Created a new one and got the error message "Could not login to Volkswagen We Connect, please check your credentials and verify that the service is working" No problems logging into the app and the web.

Yes me too… have you news? Im trying without success…

magicbenny commented 1 year ago

Over all the same Problem here with the integration. While reading all the comments I saw that there is a new "Volkswagen" App. The description says that this will be the new WeConnect App. Installed it, logged in and everything in the app worked fine including all the Subscriptions. However maybe this is the reading why the WeConnect App is not working. Maybe different API etc..

However the new Volkswagen App is way faster than the WeConnect App before. :)

Sn00kiT commented 1 year ago

same here, stopped working for me yesterday. no eula to accept and weconnect app and weblogin is succesful. Seems they changed something to API. i hate VW and especially their often changing EULA :-)

Johan-de-Bruin commented 1 year ago

"However the new Volkswagen App is way faster than the WeConnect App before. :)"

I cannot find the AC charging speeds for my e-up! that are in the WeConnect app: 5A, 10A, 13A and MAX (16A).

I use the We Connect integration in Home Assistant to start changing during overproduction of solar energy, and adjust the current with the amount of over production. Normally, in summer, 10 Amp is enough to top off all production, but during initial start and later on the day, I would like to be able to throttle to 5 or speed up to 13 or even 16Amps.

So hopefully this will stay available, please keep maintaining the WeConnect integration as long as possible.

Sn00kiT commented 1 year ago

Over all the same Problem here with the integration. While reading all the comments I saw that there is a new "Volkswagen" App. The description says that this will be the new WeConnect App. Installed it, logged in and everything in the app worked fine including all the Subscriptions. However maybe this is the reading why the WeConnect App is not working. Maybe different API etc..

However the new Volkswagen App is way faster than the WeConnect App before. :)

thx for the hint to the new volkswagen app. i just installed it and accepted the eula there. now the integration can be set up again but during discovery of the entities it fails to connect, now i have to entries to reconfigure the weconnect intergration. very strange behaviour. maybe they try to didge the old weconnect app and the API for that in favour of the new volkswagen app and there maybe a new api system.

Ziepoeskenetnie commented 1 year ago

"However the new Volkswagen App is way faster than the WeConnect App before. :)"

I cannot find the AC charging speeds for my e-up! that are in the WeConnect app: 5A, 10A, 13A and MAX (16A).

For me either with auxiliary heater

menloperk commented 1 year ago

I was running into the same issues as described above, Then it seemed to be working fine again the last weekend. However, I just rebooted HA and now it is again not working!!!

danielszilagyi commented 1 year ago

Hi, As some maby is aware i dont own a car that supports this integration. But i have seen that volkswagen is mowing the old weconnect/carner to the new weconnect or the Volkswagen app. And this integration doesnt work with the new service. But if someone here with a car that supports this integration and have some time over to help out to fix this, it would be very appreciated.

Hi @robinostlund I do have a car which is scope of the integration and happy to provide any more input either here or on other channels.

mrandt commented 1 year ago

I have both an e-Golf (2020) and Passat GTE (2020) in DE. e-Golf still has MIB 2.0 while the Passat is on 2.5. So online-services have always differed slightly.

Up until about two months ago, I could only use the "traditional" WeConnect app for the Golf while the Passat was also supported within the so called "WeConnect for ID" app.

The latter has been replaced by / rebranded to generic "Volkswagen" app. I can confirm what @robinostlund mentioned above, the e-Golf is now also supported in the "Volkswagen" app. Though I was not forced to move, the WeConnect app still worked.

I just uninstalled all Volkswagen apps on my smartphone and reinstalled and reconfigured them.

Result: I could authenticate in both the "old" WeConnect app as well as the new Volkswagen app and see and control both cars without issues.

Also, my evcc (charge controller for photovoltaic surplus charging) instance still connects to VW API just fine - though I am unsure which endpoints it is talking to.

I have tried to add the integration to Homeasssistant again today and this time a different problem occured.

Just as yesterday, the authentication worked fine and I apparently got all the tokens.

Contrary to yesterday, obtaining a list of vehicles worked again. While yesterday it failed with HTTP 429, it succeeded with 200 today and the algorithm continued.

However, I got an "unauthorized" error, when trying to obtain homeRegion for Passat, however it seems this may have been recovered by the integration.

Still, the operation list could not be fetched for Passat.

For the Golf, the homeRegion was determined just fine - but loading the operationlist also failed, again with a HTTP 429 in this case.

I am certain that VW is changing (or messing up?) their API as we discuss here.

Maybe we wait a couple days to see if it returns to normal - or to have it settle to a somewhat stable state.

Home-Assistant logs of todays attempt below (only personal info truncated):

2023-08-28 13:47:20.401 DEBUG (MainThread) [custom_components.volkswagencarnet.config_flow] Creating connection to volkswagen weconnect
2023-08-28 13:47:20.401 DEBUG (MainThread) [volkswagencarnet.vw_connection] Using service https://msg.volkswagen.de
2023-08-28 13:47:20.406 DEBUG (MainThread) [volkswagencarnet.vw_connection] Initiating new login
2023-08-28 13:47:20.406 DEBUG (MainThread) [volkswagencarnet.vw_connection] Requesting openid config
2023-08-28 13:47:20.527 DEBUG (MainThread) [volkswagencarnet.vw_connection] Get authorization page from "https://identity.vwgroup.io/oidc/v1/authorize"
2023-08-28 13:47:20.527 DEBUG (MainThread) [volkswagencarnet.vw_connection] Request headers: "{'Connection': 'keep-alive', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9', 'Accept-Encoding': 'gzip, deflate', 'Content-Type': 'application/x-www-form-urlencoded', 'x-requested-with': 'We Connect', 'User-Agent': 'okhttp/3.14.7', 'X-App-Name': 'We Connect'}"
2023-08-28 13:47:20.570 DEBUG (MainThread) [volkswagencarnet.vw_connection] Got redirect to "https://identity.vwgroup.io/signin-service/v1/signin/<truncated>@apps_vw-dilab_com?relayState=<truncated>"
2023-08-28 13:47:20.641 DEBUG (MainThread) [volkswagencarnet.vw_connection] Got authorization endpoint
2023-08-28 13:47:20.824 DEBUG (MainThread) [volkswagencarnet.vw_connection] Authenticating with email and password.
2023-08-28 13:47:20.825 DEBUG (MainThread) [volkswagencarnet.vw_connection] Using login action url: "https://identity.vwgroup.io/signin-service/v1/<truncated>@apps_vw-dilab_com/login/authenticate"
2023-08-28 13:47:21.107 DEBUG (MainThread) [volkswagencarnet.vw_connection] Parsing login response.
2023-08-28 13:47:21.108 DEBUG (MainThread) [volkswagencarnet.vw_connection] Following redirect to "https://identity.vwgroup.io/oidc/v1/oauth/sso?clientId=<truncated>@apps_vw-dilab_com&relayState=<truncated>&userId=<truncated>&HMAC=30aa442b8ded355aeb4ca3e5545ac6cd2ac0131ebbd6777c18bf0a424c4fc1f2"
2023-08-28 13:47:21.178 DEBUG (MainThread) [volkswagencarnet.vw_connection] Following redirect to "https://identity.vwgroup.io/signin-service/v1/consent/users/<truncated>/<truncated>@apps_vw-dilab_com?scopes=openid%20mbb%20profile%20cars%20address%20email%20birthdate%20nickname%20phone&relayState=<truncated>&callback=https://identity.vwgroup.io/oidc/v1/oauth/client/callback&hmac=<truncated>"
2023-08-28 13:47:21.276 DEBUG (MainThread) [volkswagencarnet.vw_connection] Following redirect to "https://identity.vwgroup.io/oidc/v1/oauth/client/callback/success?user_id=<truncated>&client_id=<truncated>@apps_vw-dilab_com&scopes=openid%20mbb%20profile%20cars%20address%20email%20birthdate%20nickname%20phone&consentedScopes=openid%20mbb%20profile%20cars%20address%20email%20birthdate%20nickname%20phone&relayState=<truncated>&hmac=<truncated>"
2023-08-28 13:47:21.393 DEBUG (MainThread) [volkswagencarnet.vw_connection] Login successful, received authorization code.
2023-08-28 13:47:21.394 DEBUG (MainThread) [volkswagencarnet.vw_connection] Trying to fetch user identity tokens.
2023-08-28 13:47:21.700 DEBUG (MainThread) [volkswagencarnet.vw_connection] Got token access_token
2023-08-28 13:47:21.701 DEBUG (MainThread) [volkswagencarnet.vw_connection] Got token expires_in
2023-08-28 13:47:21.701 DEBUG (MainThread) [volkswagencarnet.vw_connection] Got token id_token
2023-08-28 13:47:21.701 DEBUG (MainThread) [volkswagencarnet.vw_connection] Got token refresh_token
2023-08-28 13:47:21.701 DEBUG (MainThread) [volkswagencarnet.vw_connection] Got token token_type
2023-08-28 13:47:21.744 DEBUG (MainThread) [volkswagencarnet.vw_connection] User identity token verified OK.
2023-08-28 13:47:21.744 INFO (MainThread) [volkswagencarnet.vw_connection] Successfully logged in
2023-08-28 13:47:21.745 DEBUG (MainThread) [volkswagencarnet.vw_connection] Trying to fetch api tokens.
2023-08-28 13:47:21.907 DEBUG (MainThread) [volkswagencarnet.vw_connection] Got token access_token
2023-08-28 13:47:21.907 DEBUG (MainThread) [volkswagencarnet.vw_connection] Got token token_type
2023-08-28 13:47:21.907 DEBUG (MainThread) [volkswagencarnet.vw_connection] Got token refresh_token
2023-08-28 13:47:21.907 DEBUG (MainThread) [volkswagencarnet.vw_connection] Got token expires_in
2023-08-28 13:47:21.907 DEBUG (MainThread) [volkswagencarnet.vw_connection] Got token scope
2023-08-28 13:47:21.941 DEBUG (MainThread) [volkswagencarnet.vw_connection] VW-Group API token verified OK.
2023-08-28 13:47:21.941 DEBUG (MainThread) [volkswagencarnet.vw_connection] Fetching vehicles associated with account
2023-08-28 13:47:21.941 DEBUG (MainThread) [volkswagencarnet.vw_connection] HTTP GET "https://msg.volkswagen.de/fs-car/usermanagement/users/v1/VW/DE/vehicles"
2023-08-28 13:47:22.765 DEBUG (MainThread) [volkswagencarnet.vw_connection] Request for "https://msg.volkswagen.de/fs-car/usermanagement/users/v1/VW/DE/vehicles" returned with status code [200], response: {'userVehicles': {'vehicle': ['WVWZZZAUZL<truncated for e-Golf>', 'WVWZZZ3C<truncated for Passat>']}}
2023-08-28 13:47:22.766 DEBUG (MainThread) [volkswagencarnet.vw_connection] Found vehicle(s) associated with account.
2023-08-28 13:47:22.767 DEBUG (MainThread) [volkswagencarnet.vw_connection] Going to call vehicle updates
2023-08-28 13:47:22.768 DEBUG (MainThread) [volkswagencarnet.vw_connection] HTTP GET "https://mal-1a.prd.ece.vwg-connect.com/api/cs/vds/v1/vehicles/WVWZZZAUZL<truncated for e-Golf>/homeRegion"
2023-08-28 13:47:22.771 DEBUG (MainThread) [volkswagencarnet.vw_connection] HTTP GET "https://mal-1a.prd.ece.vwg-connect.com/api/cs/vds/v1/vehicles/WVWZZZ3C<truncated for Passat>/homeRegion"
2023-08-28 13:47:23.012 DEBUG (MainThread) [volkswagencarnet.vw_connection] Server side throttled. Waiting 3, try 1
2023-08-28 13:47:23.367 DEBUG (MainThread) [volkswagencarnet.vw_connection] Request for "https://mal-1a.prd.ece.vwg-connect.com/api/cs/vds/v1/vehicles/WVWZZZAUZL<truncated for e-Golf>/homeRegion" returned with status code [200], response: {'homeRegion': {'baseUri': {'systemId': 'ICTO-10487', 'content': 'https://mal-1a.prd.ece.vwg-connect.com/api'}}}
2023-08-28 13:47:23.367 DEBUG (MainThread) [volkswagencarnet.vw_vehicle] Get homeregion for VIN WVWZZZAUZL<truncated for e-Golf>
2023-08-28 13:47:23.369 DEBUG (MainThread) [volkswagencarnet.vw_connection] HTTP GET "https://msg.volkswagen.de/fs-car/vehicleMgmt/vehicledata/v2/VW/DE/vehicles/WVWZZZAUZL<truncated for e-Golf>"
2023-08-28 13:47:23.373 DEBUG (MainThread) [volkswagencarnet.vw_connection] Attempting extraction of subject from identity token.
2023-08-28 13:47:23.374 DEBUG (MainThread) [volkswagencarnet.vw_connection] HTTP GET "https://customer-profile.apps.emea.vwapps.io/v1/customers/<truncated>/realCarData"
2023-08-28 13:47:23.495 DEBUG (MainThread) [volkswagencarnet.vw_connection] Request for "https://customer-profile.apps.emea.vwapps.io/v1/customers/<truncated>/realCarData" returned with status code [200], response: {'realCars': [{'nickname': 'Passat GTE', 'licensePlateNumber': '<truncated>', 'allocatedDealerCountry': 'COUNTRY:DE', 'allocatedDealerId': '<truncated>', 'allocatedDealerBrandCode': 'VOLKSWAGEN_BRAND:V', 'carnetAllocationTimestamp': '<truncated>', 'carnetAllocationType': 'CARNET_ENROLLMENT_APPLICATION:CARNETAPP', 'carNetIndicator': False, 'vehicleIdentificationNumber': 'WVWZZZ3C<truncated for Passat>', 'deactivated': False, 'deactivationReason': '', 'modelCode': ''}, {'nickname': 'e-GOLF', 'licensePlateNumber': '<truncated>', 'allocatedDealerCountry': 'COUNTRY:DE', 'allocatedDealerId': '<truncated>', 'allocatedDealerBrandCode': 'VOLKSWAGEN_BRAND:V', 'carNetIndicator': False, 'vehicleIdentificationNumber': 'WVWZZZAUZL<truncated for e-Golf>', 'deactivated': False, 'deactivationReason': '', 'modelCode': ''}]}
2023-08-28 13:47:24.086 DEBUG (MainThread) [volkswagencarnet.vw_connection] Server side throttled. Waiting 3, try 1
2023-08-28 13:47:26.014 DEBUG (MainThread) [volkswagencarnet.vw_connection] HTTP GET "https://mal-1a.prd.ece.vwg-connect.com/api/cs/vds/v1/vehicles/WVWZZZ3C<truncated for Passat>/homeRegion"
2023-08-28 13:47:26.064 WARNING (MainThread) [volkswagencarnet.vw_connection] Received "unauthorized" error while fetching data: 401, message='', url=URL('https://mal-1a.prd.ece.vwg-connect.com/api/cs/vds/v1/vehicles/WVWZZZ3C<truncated for Passat>/homeRegion')
2023-08-28 13:47:26.070 DEBUG (MainThread) [volkswagencarnet.vw_connection] Could not get homeregion, error 'homeRegion'
2023-08-28 13:47:26.071 DEBUG (MainThread) [volkswagencarnet.vw_vehicle] Get homeregion for VIN WVWZZZ3C<truncated for Passat>
2023-08-28 13:47:26.072 WARNING (MainThread) [volkswagencarnet.vw_connection] Could not fetch carportData, error: 'WVWZZZ3C<truncated for Passat>'
2023-08-28 13:47:26.077 DEBUG (MainThread) [volkswagencarnet.vw_connection] Attempting extraction of subject from identity token.
2023-08-28 13:47:26.078 DEBUG (MainThread) [volkswagencarnet.vw_connection] HTTP GET "https://customer-profile.apps.emea.vwapps.io/v1/customers/<truncated>/realCarData"
2023-08-28 13:47:26.124 DEBUG (MainThread) [volkswagencarnet.vw_connection] Request for "https://customer-profile.apps.emea.vwapps.io/v1/customers/<truncated>/realCarData" returned with status code [200], response: {'realCars': [{'nickname': 'Passat GTE', 'licensePlateNumber': '<truncated>', 'allocatedDealerCountry': 'COUNTRY:DE', 'allocatedDealerId': '<truncated>', 'allocatedDealerBrandCode': 'VOLKSWAGEN_BRAND:V', 'carnetAllocationTimestamp': '<truncated>', 'carnetAllocationType': 'CARNET_ENROLLMENT_APPLICATION:CARNETAPP', 'carNetIndicator': False, 'vehicleIdentificationNumber': 'WVWZZZ3C<truncated for Passat>', 'deactivated': False, 'deactivationReason': '', 'modelCode': ''}, {'nickname': 'e-GOLF', 'licensePlateNumber': '<truncated>', 'allocatedDealerCountry': 'COUNTRY:DE', 'allocatedDealerId': '<truncated>', 'allocatedDealerBrandCode': 'VOLKSWAGEN_BRAND:V', 'carNetIndicator': False, 'vehicleIdentificationNumber': 'WVWZZZAUZL<truncated for e-Golf>', 'deactivated': False, 'deactivationReason': '', 'modelCode': ''}]}
2023-08-28 13:47:26.126 INFO (MainThread) [volkswagencarnet.vw_vehicle] Vehicle WVWZZZ3C<truncated for Passat> added. Homeregion is "https://msg.volkswagen.de"
2023-08-28 13:47:26.126 DEBUG (MainThread) [volkswagencarnet.vw_vehicle] Attempting discovery of supported API endpoints for vehicle.
2023-08-28 13:47:26.127 WARNING (MainThread) [volkswagencarnet.vw_connection] Could not fetch operation list, error: 'WVWZZZ3C<truncated for Passat>'
2023-08-28 13:47:26.132 WARNING (MainThread) [volkswagencarnet.vw_connection] Could not update information: 'serviceInfo'
2023-08-28 13:47:27.088 DEBUG (MainThread) [volkswagencarnet.vw_connection] HTTP GET "https://msg.volkswagen.de/fs-car/vehicleMgmt/vehicledata/v2/VW/DE/vehicles/WVWZZZAUZL<truncated for e-Golf>"
2023-08-28 13:47:28.096 DEBUG (MainThread) [volkswagencarnet.vw_connection] Server side throttled. Waiting 4, try 2
2023-08-28 13:47:32.098 DEBUG (MainThread) [volkswagencarnet.vw_connection] HTTP GET "https://msg.volkswagen.de/fs-car/vehicleMgmt/vehicledata/v2/VW/DE/vehicles/WVWZZZAUZL<truncated for e-Golf>"
2023-08-28 13:47:32.462 DEBUG (MainThread) [volkswagencarnet.vw_connection] Server side throttled. Waiting 1, try 3
2023-08-28 13:47:33.463 DEBUG (MainThread) [volkswagencarnet.vw_connection] HTTP GET "https://msg.volkswagen.de/fs-car/vehicleMgmt/vehicledata/v2/VW/DE/vehicles/WVWZZZAUZL<truncated for e-Golf>"
2023-08-28 13:47:33.685 ERROR (MainThread) [volkswagencarnet.vw_connection] Got unhandled error from server: 429
2023-08-28 13:47:33.688 WARNING (MainThread) [volkswagencarnet.vw_connection] Could not fetch carportdata, HTTP status code: 429
2023-08-28 13:47:33.690 INFO (MainThread) [volkswagencarnet.vw_vehicle] Vehicle WVWZZZAUZL<truncated for e-Golf> added. Homeregion is "https://mal-1a.prd.ece.vwg-connect.com/api"
2023-08-28 13:47:33.690 DEBUG (MainThread) [volkswagencarnet.vw_vehicle] Attempting discovery of supported API endpoints for vehicle.
2023-08-28 13:47:33.691 DEBUG (MainThread) [volkswagencarnet.vw_connection] HTTP GET "https://mal-1a.prd.ece.vwg-connect.com/api/rolesrights/operationlist/v3/vehicles/WVWZZZAUZL<truncated for e-Golf>"
2023-08-28 13:47:34.393 DEBUG (MainThread) [volkswagencarnet.vw_connection] Server side throttled. Waiting 1, try 1
2023-08-28 13:47:35.394 DEBUG (MainThread) [volkswagencarnet.vw_connection] HTTP GET "https://mal-1a.prd.ece.vwg-connect.com/api/rolesrights/operationlist/v3/vehicles/WVWZZZAUZL<truncated for e-Golf>"
2023-08-28 13:47:36.781 DEBUG (MainThread) [volkswagencarnet.vw_connection] Server side throttled. Waiting 5, try 2
2023-08-28 13:47:41.782 DEBUG (MainThread) [volkswagencarnet.vw_connection] HTTP GET "https://mal-1a.prd.ece.vwg-connect.com/api/rolesrights/operationlist/v3/vehicles/WVWZZZAUZL<truncated for e-Golf>"
2023-08-28 13:47:42.667 DEBUG (MainThread) [volkswagencarnet.vw_connection] Server side throttled. Waiting 1, try 3
2023-08-28 13:47:43.668 DEBUG (MainThread) [volkswagencarnet.vw_connection] HTTP GET "https://mal-1a.prd.ece.vwg-connect.com/api/rolesrights/operationlist/v3/vehicles/WVWZZZAUZL<truncated for e-Golf>"
2023-08-28 13:47:45.180 ERROR (MainThread) [volkswagencarnet.vw_connection] Got unhandled error from server: 429
2023-08-28 13:47:45.184 WARNING (MainThread) [volkswagencarnet.vw_connection] Could not fetch operation list, HTTP status code: 429
milkboy commented 1 year ago

I just published a beta release with a lot more retries on all requests. Seems like the backend is returning 429 on way too many requests, and it might be a sign that the service is dying (or getting intentionally killed) :grimacing:

Anyhow, after 10-20 requests usually, it's possible to get a response, so this version now tries up to 40 times instead of the previous 3, and also reduces the retry interval, as it seemed there is absolutely no difference in how long the wait between requests is.... Also, with "normal" backoff between requests, Home Assistant would give up on the integration as it was way too slow to respond (like 5-10 minutes to fetch the data that previously was available in <10 seconds)

Caibuk commented 1 year ago

Hi @milkboy, Thank you for your quick fix! For me it works again. Set up of the integration took indeed some time.

Thanks much again!

Ziepoeskenetnie commented 1 year ago

Indeed in bèta it's working again.

Only auxiliary heating is not available.

Screenshot_20230828_163158_Home Assistant.jpg

milkboy commented 1 year ago

yea. setup takes quite a long time, as there are many API calls, and most of them need 10-20 retries, with a few seconds in between. Not a very pretty solution, but don't know what else could be done :thinking:

janchlebek commented 1 year ago

I can confirm the beta is a valid workaround. Feels like ages to start the integration but once it starts all data is there.

chrisandsally commented 1 year ago

Thank you. Works for me to.

FedeL16 commented 1 year ago

I just published a beta release with a lot more retries on all requests. Seems like the backend is returning 429 on way too many requests, and it might be a sign that the service is dying (or getting intentionally killed) 😬

Anyhow, after 10-20 requests usually, it's possible to get a response, so this version now tries up to 40 times instead of the previous 3, and also reduces the retry interval, as it seemed there is absolutely no difference in how long the wait between requests is.... Also, with "normal" backoff between requests, Home Assistant would give up on the integration as it was way too slow to respond (like 5-10 minutes to fetch the data that previously was available in <10 seconds)

I have an unknow error

IMG_2767

Johan-de-Bruin commented 1 year ago

Stupid question: how do I bump the version to the current beta? Via HACS?

Ziepoeskenetnie commented 1 year ago

Stupid question: how do I bump the version to the current beta? Via HACS?

Yes, click 3 dots and click redownload

Screenshot_20230828_164007_Home Assistant.jpg

Then activate show bèta versions.

Screenshot_20230828_163955_Home Assistant.jpg

janchlebek commented 1 year ago

GO to HACS - integrations, click on the integration and in top right there are three dots. Click there and select redownload (don't forget to turn on the switch "show beta versions")


From: Johan-de-Bruin @.> Sent: Monday, August 28, 2023 4:38 PM To: robinostlund/homeassistant-volkswagencarnet @.> Cc: janchlebek @.>; Manual @.> Subject: Re: [robinostlund/homeassistant-volkswagencarnet] connection error (Issue #493)

Stupid question: how do I bump the version to the current beta? Via HACS?

— Reply to this email directly, view it on GitHubhttps://github.com/robinostlund/homeassistant-volkswagencarnet/issues/493#issuecomment-1695819218, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AUGK3ML7Q7VV6FJY53FEW73XXSUPLANCNFSM6AAAAAA36PUHG4. You are receiving this because you are subscribed to this thread.Message ID: @.***>

pietsab commented 1 year ago

The beta is actually the solution. What are the differences between beta and the official 4.4.65 version? forget my post I read the release note from the beta, sorry

janchlebek commented 1 year ago

The beta is actually the solution. What are the differences between beta and the official 4.4.65 version?

Just read above before asking https://github.com/robinostlund/homeassistant-volkswagencarnet/issues/493#issuecomment-1695743489

kwithus commented 1 year ago

thanks from me too. the beta does solve it for now. However, as it is more or less a workaround, let’s hope the deeper reason can be found out and been solved too

janrothkegel commented 1 year ago

Awesome! Is there a way to send a small gift via Paypal? (Coffee is only possible using credit card....)

m-art-in-hof commented 1 year ago

Beta works for me. Thanks so much @milkboy !! Would like to support you. How?