robinostlund / homeassistant-volkswagencarnet

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

connection error #493

Closed kwithus closed 10 months ago

kwithus commented 10 months 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'
mrandt commented 10 months ago

I can confirm that v4.4.65-beta1 fixed the issue for me.

In debug logs I see many, many retries - but eventually the requests do succeed.

danielszilagyi commented 10 months 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 🤔

Awesome, thank you for the fix! Confirmed the beta can log in, first endpoint returned 200 on the 14th try.

gezuka77 commented 10 months ago

Fellas, how to install the beta?

saikimecky commented 10 months ago

Fellas, how to install the beta?

Look at https://github.com/robinostlund/homeassistant-volkswagencarnet/issues/493#issuecomment-1695823709

gezuka77 commented 10 months ago

Fellas, how to install the beta?

Look at #493 (comment)

Cheers!

Seems did the trick

shiraz-b commented 10 months ago

Confirm workaround working on my setup... Nice one! Thanks @milkboy

P356c commented 10 months ago

Also for me it is working again, many thanks @milkboy!

janrothkegel commented 10 months ago

But it seems to be just a temporary workaround. Once the servers are gone, then there will be no endpoint anymore at all.

Johan-de-Bruin commented 10 months ago

But it seems to be just a temporary workaround. Once the servers are gone, then there will be no endpoint anymore at all.

Are the servers going away? I mean: We've had CAR-NET, We Connect / We Connect ID and now Volkswagen seems to be steering towards this new ( but not so complete ) Volkswagen App. My car (with the current still payed subscription) will keep sending the data towards the VW servers, and atleast one of the App's will stay working, I guess.... so there will be an endpoint,.. until they fully kill the online function.

As my car (an e-up! MJ2017) is a full electric car, I really really benefit from the online data availabillity: when is it fully charged, and pre heating in winter. Adjusting the AC charging speed etc etc. My car doesn't have a onboard screen, I have to use a dreadfull app to put on my smartphone (haven't used or installed it for years now), or use the CAR-NET / WeConnect.

I do hope atleast an official app will still be available for the years to come!

robinproof commented 10 months ago

@Johan-de-Bruin I'm also quite stunned this remark, it would be nice to know, if this is really happening and when the timeline would be. I still have a subscription for more than a year.

I'm hoping on using this for a while more until I get more time to install the openvehicles kit: https://docs.openvehicles.com/en/stable/components/vehicle_vweup/docs/index_t26.html

mine is a e-up! 2014 (with the shitty outdated garmin gps )

shiraz-b commented 10 months ago

Well - this is annoying.. I did a HA restart due to something entirely different and the integation failed to load .. again!

Checked I'm on the beta code, delete/reinstalled the integration and now get a straight 403!

Logger: volkswagencarnet.vw_connection
Source: custom_components/volkswagencarnet/config_flow.py:93
Integration: Volkswagen We Connect ([documentation](https://github.com/robinostlund/homeassistant-volkswagencarnet), [issues](https://github.com/robinostlund/homeassistant-volkswagencarnet/issues))
First occurred: 4:59:31 PM (1 occurrences)
Last logged: 4:59:31 PM
Failed to fetch VW-Group API tokens, API token request returned with status code 403

Immediately logged onto the VW web site and all ok - any thoughts anybody?

Thomk-63 commented 10 months ago

For me the same. Yesterday the Beta release worked, today it is not working any more. Tried to reinstall the Beta version as done yesterday, but again immediate error, even not trying to initialize. 2023-08-29 18:57:41.458 ERROR (MainThread) [volkswagencarnet.vw_connection] Failed to fetch VW-Group API tokens, API token request returned with status code 403.

danielszilagyi commented 10 months ago

To me this seems like an intentional blocking on some endpoint by the service operator.

weconnect-mqtt still works without any trouble. I am not a developer but happy to provide any input to compare what endpoints does weconnect-mqtt call to further understand this issue.

shiraz-b commented 10 months ago

@danielszilagyi : I agree. A quick debug seesion on the vw web login shows the following URL giving my session token:

GET https://www.volkswagen.co.uk/app/authproxy/vw-uk/tokens

Is this what we expect.. I note a referer header.. I wonder whether it's using that?

`Referer https://www.volkswagen.co.uk/en/myvolkswagen.html/__app/detail/.app`
FedeL16 commented 10 months ago

Yesterday with beta release worked! Now the integration is down again after HA restart!! It’s incredible sigh!

janchlebek commented 10 months ago

Even if you do not restart it simply does not fetch any data (in my case nothing came through for over 10 hours).

Sn00kiT commented 10 months ago

Guys, i startet complaining and demanding through support in the playstore and over the connect-support@volkswagen.de. We have 2023 and it´s time now that VW and all over the other cars from Skoda/Cupra/Seat that use almost the same framework to give as official API to our data to use in the way we want. We pay for a service that should be free from the beginning for cars that cost this much! So please do it in the same manner as me. The more will follow, the more likely we get some hearing! Optional you can ask for your data and give here feedback as well for the API: https://www.datenanfragen.de/blog/musterbrief-dsgvo-anfrage-auskunft/ it´s in german, but i think you may have a similiar petition in your country!

Johan-de-Bruin commented 10 months ago

Rather drastic measures, for what could just as good be an technical failure.

danielszilagyi commented 10 months ago

@danielszilagyi : I agree. A quick debug seesion on the vw web login shows the following URL giving my session token:

GET https://www.volkswagen.co.uk/app/authproxy/vw-uk/tokens

Is this what we expect.. I note a referer header.. I wonder whether it's using that?

Referer https://www.volkswagen.co.uk/en/myvolkswagen.html/__app/detail/<YOUR CAR ID>.app

As I understood later from the docs of weconnect-mqtt, it uses the ID API which explains why it works when this one does not. I cannot comment on other cars, but I have e-up and all the information that was exposed over the volkswagencarnet integration is available in the mqtt topics, the writable topics are also working/similar - not sure about other brands and models. Seems that the WeConnect ID integration can be of help for some, it seems to use the same libraries based on the log messages.

It started working for me on some level (some entities unavailable or even the device_tracker domain could not be set up) after I added my car model to the list here.

nmsoares commented 10 months ago

Stopped working for me using Beta1 without any restart. I get:

This error originated from a custom integration.

Logger: volkswagencarnet.vw_connection Source: custom_components/volkswagencarnet/init.py:527 Integration: Volkswagen We Connect (documentation, issues) First occurred: 9:44:50 PM (7 occurrences) Last logged: 9:54:46 PM

Failed to fetch VW-Group API tokens, API token request returned with status code

Restart does not work anymore. :(

triumfas commented 10 months ago

@danielszilagyi if you have MQTT sensors/switches defined in your HA configuration - could you please share it? Even though I got some progress, but it might take some time to get it properly done. Might be a temporary solution for some users (I've set mosquitto-mqtt and and weconnect-mqtt dockers).

danielszilagyi commented 10 months ago

@danielszilagyi if you have MQTT sensors/switches defined in your HA configuration - could you please share it? Even though I got some progress, but it might take some time to get it properly done. Might be a temporary solution for some users (I've set mosquitto-mqtt and and weconnect-mqtt dockers).

I made a doc PR to the weconnect-mqtt repo, check the fork on my profile.

https://github.com/danielszilagyi/WeConnect-mqtt/tree/patch-1

But I would encourage you to try the ID integration I mentioned above today.

I made a fork of it too and you can see what I had to change to make the integration work with non-ID family car. I also had to make a change to number.py which I will PR later if even, because the charge level endpoint doesn’t exist and it made HA drop python errors during the device tracker setup.my minimal python skills were enough to keep the integration working without errors, but a nicer (more than providing a working but unrelated numeric endpoint) fix would be appreciated.

milkboy commented 10 months ago

Alright. So, need to start looking at alternatives for getting the data. Sigh

FedeL16 commented 10 months ago

@danielszilagyi if you have MQTT sensors/switches defined in your HA configuration - could you please share it? Even though I got some progress, but it might take some time to get it properly done. Might be a temporary solution for some users (I've set mosquitto-mqtt and and weconnect-mqtt dockers).

I made a doc PR to the weconnect-mqtt repo, check the fork on my profile.

https://github.com/danielszilagyi/WeConnect-mqtt/tree/patch-1

But I would encourage you to try the ID integration I mentioned above today.

I made a fork of it too and you can see what I had to change to make the integration work with non-ID family car. I also had to make a change to number.py which I will PR later if even, because the charge level endpoint doesn’t exist and it made HA drop python errors during the device tracker setup.my minimal python skills were enough to keep the integration working without errors, but a nicer (more than providing a working but unrelated numeric endpoint) fix would be appreciated.

I've installed Ha supervisor... can I use your repository on my system?

regnerusbauke commented 10 months ago

Hello guys,

I get the following code:

Logger: volkswagencarnet.vw_connection Source: custom_components/volkswagencarnet/config_flow.py:93 Integration: Volkswagen WeConnect (documentation, issues) First occurred: 09:13:30 (1 occurrences) Last logged: 09:13:30

Failed to fetch VW-Group API tokens, API token request returned with status code 403

2023-08-30 09:39:28.146 DEBUG (MainThread) [volkswagencarnet.vw_connection] Login successful, received authorization code. 2023-08-30 09:39:28.146 DEBUG (MainThread) [volkswagencarnet.vw_connection] Trying to fetch user identity tokens. 2023-08-30 09:39:28.429 DEBUG (MainThread) [volkswagencarnet.vw_connection] Got token access_token 2023-08-30 09:39:28.429 DEBUG (MainThread) [volkswagencarnet.vw_connection] Got token expires_in 2023-08-30 09:39:28.429 DEBUG (MainThread) [volkswagencarnet.vw_connection] Got token id_token 2023-08-30 09:39:28.430 DEBUG (MainThread) [volkswagencarnet.vw_connection] Got token refresh_token 2023-08-30 09:39:28.430 DEBUG (MainThread) [volkswagencarnet.vw_connection] Got token token_type 2023-08-30 09:39:28.477 DEBUG (MainThread) [volkswagencarnet.vw_connection] User identity token verified OK. 2023-08-30 09:39:28.477 INFO (MainThread) [volkswagencarnet.vw_connection] Successfully logged in 2023-08-30 09:39:28.477 DEBUG (MainThread) [volkswagencarnet.vw_connection] Trying to fetch api tokens. 2023-08-30 09:39:28.625 DEBUG (MainThread) [volkswagencarnet.vw_connection] Got API tokens in 1 tries 2023-08-30 09:39:28.625 DEBUG (MainThread) [volkswagencarnet.vw_connection] API token request returned error. 2023-08-30 09:39:28.625 ERROR (MainThread) [volkswagencarnet.vw_connection] Failed to fetch VW-Group API tokens, API token request returned with status code 403

i checked the boxes with an "X".

Greets!

skallberg commented 10 months ago

I have the same issue running the beta release. Getting "Failed to fetch VW-Group API tokens, API token request returned with status code 403" Both portal and the VW app works fine.

Hans-Arno commented 10 months ago

Same with my Golf: 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: 09:23:29 (24 occurrences) Last logged: 10:20:19

Could not query update from volkswagen WeConnect

triumfas commented 10 months ago

I think it's clear that it does not work for everyone. Let's just wait for developers to find time to work on it. Probably actual findings that might help should be shared or if dev needs additional info and asks something additionally.

Busak007 commented 10 months ago

it no longer wants to allow me or sign in to the We Connect integration during setup. writes: Could not login to Volkswagen We Connect, please check your credentials and verify that the service is working

I have the correct credentials...

CZ

Rotil66 commented 10 months ago

Unfortunately I have the same issue after the last HA Upgrade. In previous updates (2 or 3 ago) this issue was starting to appear but I could manage to get it running by copying the latest Weconnected file into HA again. But now this is not working anymore. Yesterday, It breefly worked after copying the latest beta files. But everytime after a day the login screen was back or the data was not downloaded. At this moment nothing is solving the isue anymore. (copying files again restarting etc,etc) For me it's now permanently broken. I hope there is a solution, since I put a lot of work into the card in my HA. (And of course for the delvelopers who have put 1000 times more work into this) p.s. All other app's and login's work fine (only the HA intergration is not working)

danielszilagyi commented 10 months ago

I think it’s clear that VW decomissioned something that is needed for this integration., as I mentioned here earlier the integration created for the ID cars works with e-up after minor changes, so worth trying to add your (e-)car model. Not sure if combustion engine models are worth a try. I can not fix the issues in the code I detailed earlier but I hope the repo can help those who relied on this integration. charge control and device_tracker works, most sensors that are in the API work. IMG_1057 IMG_1058

You can check on this link what I did to make the integration work with e-up.

Jaspils commented 10 months ago

Running 4.4.65-beta1 now on Home Assistant 2022.8.4. Have has issues on previous version 4.4.64 I believe on Home Assistant 2022.6.? I've updated everything to see if things worked again. Unfortunately not. Below the error is stops on, I've seen it come by in this thread before, but maybe someone has some use to this info.

2023-08-30 16:25:14.382 INFO (MainThread) [volkswagencarnet.vw_connection] Successfully logged in
2023-08-30 16:25:14.382 DEBUG (MainThread) [volkswagencarnet.vw_connection] Trying to fetch api tokens.
2023-08-30 16:25:14.535 DEBUG (MainThread) [volkswagencarnet.vw_connection] Got API tokens in 1 tries
2023-08-30 16:25:14.535 DEBUG (MainThread) [volkswagencarnet.vw_connection] API token request returned error.
2023-08-30 16:25:14.535 ERROR (MainThread) [volkswagencarnet.vw_connection] Failed to fetch VW-Group API tokens, API token request returned with status code 403
2023-08-30 16:25:14.545 ERROR (MainThread) [custom_components.volkswagencarnet.config_flow] Failed to login due to error: 'vwg'
regnerusbauke commented 10 months ago

I think we must have patient! Give the developers time to work on it.

virtualdj commented 10 months ago

Seems that the WeConnect ID integration can be of help for some

Doesn't support Golf 8 plug-in (GTE/eHybrid), unfortunately. I can log in without errors, but then HA doesn't display any sensor.

GroundAttack commented 10 months ago

Seems that the WeConnect ID integration can be of help for some

Doesn't support Golf 8 plug-in (GTE/eHybrid), unfortunately. I can log in without errors, but then HA doesn't display any sensor.

It seems to be for ID models only. It does not work for my e-Up. Same symptoms..

triumfas commented 10 months ago

@virtualdj @GroundAttack Check this. e-UP reported working - post. I have added "Polo" for Taigo and "Tiguan" for Tiguan eHybrid. It partially works as sensors code needs modification due to differences with ID. Used weconnect-mqtt and MQTT explorer to find "model".

At least some things work out of the box, some I played around and made work for myself. I believe this integration will be fixed one way or another.

Busak007 commented 10 months ago

@danielszilagyi : I agree. A quick debug seesion on the vw web login shows the following URL giving my session token: GET https://www.volkswagen.co.uk/app/authproxy/vw-uk/tokens Is this what we expect.. I note a referer header.. I wonder whether it's using that? Referer https://www.volkswagen.co.uk/en/myvolkswagen.html/__app/detail/<YOUR CAR ID>.app

As I understood later from the docs of weconnect-mqtt, it uses the ID API which explains why it works when this one does not. I cannot comment on other cars, but I have e-up and all the information that was exposed over the volkswagencarnet integration is available in the mqtt topics, the writable topics are also working/similar - not sure about other brands and models. Seems that the WeConnect ID integration can be of help for some, it seems to use the same libraries based on the log messages.

It started working for me on some level (some entities unavailable or even the device_tracker domain could not be set up) after I added my car model to the list here.

THNX it work!

virtualdj commented 10 months ago

@triumfas Thanks, adding: SUPPORTED_VEHICLES = ["ID.3", "ID.4", "ID.5", "ID. Buzz", "Golf"] worked.

I believe this integration will be fixed one way or another.

I hope so, because unfortunately https://github.com/mitch-dc/volkswagen_we_connect_id/ is not even comparable to this one... The sensors are more or less similar (but it's missing the last trip data, which is very useful to calculate costs), but the commands are not (such as the ability to set to lower charging rate, for example, or unlock the vehicle).

kwithus commented 10 months ago

well, I can use the new Volkswagen App for our e_Golf, however, I cannot add it to the we connect id integration. First of all, the configuration page doesn't show any name to the three lines. So I filled in the email in the first line, the password in the second and the VIN in the last line. However, I cannot see any sensor.

`Logger: homeassistant.helpers.integration_platform Source: loader.py:850 First occurred: 20:12:07 (8 occurrences) Last logged: 20:31:54

Unexpected error importing vwid/system_health.py Unexpected error importing vwid/logbook.py Unexpected error importing vwid/group.py Unexpected error importing vwid/silabs_multiprotocol.py Unexpected error importing vwid/hardware.py Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/integration_platform.py", line 50, in _async_process_single_integration_platform_component platform = integration.get_platform(platform_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/loader.py", line 833, in get_platform cache[full_name] = self._import_platform(platform_name) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/loader.py", line 850, in _import_platform return importlib.import_module(f"{self.pkg_path}.{platform_name}") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1204, in _gcd_import File "", line 1176, in _find_and_load File "", line 1140, in _find_and_load_unlocked ModuleNotFoundError: No module named 'custom_components.Vwid.diagnostics' `

triumfas commented 10 months ago

Please read earlier posts prior posting. If that does not help - wait till the fix or any other information is posted. To be honest - if you get weconnect-id working it will still be half baked and you will need to dive into the code. And if there are more question - just wait. I've played around for learning purpose and it's time consuming. If you don't have ID, then you will have lots of sensors not relevant, some which you would like to have - missing and you will need to modify code. Then you will need to survive updates.

So read posts above twice, buy coffee for developer (fixing things like these takes a lot of time), use Volkswagen app for now and wait.

pietsab commented 10 months ago

"Passat GTE" work

Busak007 commented 10 months ago

@triumfas Thanks, adding: SUPPORTED_VEHICLES = ["ID.3", "ID.4", "ID.5", "ID. Buzz", "Golf"] worked.

I believe this integration will be fixed one way or another.

I hope so, because unfortunately https://github.com/mitch-dc/volkswagen_we_connect_id/ is not even comparable to this one... The sensors are more or less similar (but it's missing the last trip data, which is very useful to calculate costs), but the commands are not (such as the ability to set to lower charging rate, for example, or unlock the vehicle).

need to make some simple changes for eup but it works. the only thing I'm missing is the data on the last ride, but I can live without that

https://github.com/mitch-dc/volkswagen_we_connect_id/compare/main...danielszilagyi:volkswagen_we_connect_id:main#diff-31afb15cb0fb003e221a5d2bc6f981b22949d1fdfa6dc037b064b767802c7a0d

triumfas commented 10 months ago

Data is there. But not sure how it should be defined in sensor.py as it takes data from "domains". I'd expect it to be similar to yours. This is what I see from weconnect-mqtt. "domains" is on the same level as "trips".

image

brechtvhb commented 10 months ago

"Passat GTE" work

Not for me. What did you do?

pietsab commented 10 months ago

"Passat GTE" work

Not for me. What did you do?

i explained it in another post https://github.com/mitch-dc/volkswagen_we_connect_id/issues/201#issuecomment-1699843851 but please understand that i'm not a programmer or anything like that. I am a user.

skallberg commented 10 months ago

I have a Passat GTE 2018 and the "we connect id" integration doesn't work for me.

GroundAttack commented 10 months ago

I switched from https://github.com/mitch-dc/volkswagen_we_connect_id to Daniels fork : https://github.com/danielszilagyi/volkswagen_we_connect_id and can confirm that my e_up! works and has live data.

nmsoares commented 10 months ago

anybody has the weconnect-mqtt MQTT sensors created that can share with the group will a solution is being developed?

triumfas commented 10 months ago

anybody has the weconnect-mqtt MQTT sensors created that can share with the group will a solution is being developed?

I have these added in configuration.yaml. Did not investigate how to make unlock/lock button.

`mqtt:

andlo commented 10 months ago

anybody has the weconnect-mqtt MQTT sensors created that can share with the group will a solution is being developed?

@triumfas shows sensors, but for control you can make swiches like this:

`mqtt:

Use a mqtt explorer to find all the posible topics and writable topics