Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected error when logging in #80

Open
terminajet opened this issue Aug 20, 2024 · 28 comments
Open

Unexpected error when logging in #80

terminajet opened this issue Aug 20, 2024 · 28 comments

Comments

@terminajet
Copy link

Hi there,
I'm new on HA but i'm trying to add my vehicle (Cupra leon sportstourer PHEV) to HA.
My account on MyCupra is working well.
I have followed the instructions to install Cupra Weconnect and everything worked fine until the login window.
I write my username and password and i have an error message saying "Unexpected error".

HA is running on a raspberry Pi 4 with HA OS.

Could someone help me?

Regards

@novisys
Copy link

novisys commented Aug 20, 2024

Have the same problem and tried some ideas (like changing password/ disconnect app/ reset all apps authorisation/ reinstall integration from scratch...) but nothing's done.

@ECOS-GmbH
Copy link

We have the same problem.
The following error is logged:

This error originated from a custom integration.

Logger: custom_components.cupra_we_connect.config_flow
Source: custom_components/cupra_we_connect/config_flow.py:75
integration: Cupra WeConnect (documentation, issues)
First occurred: 13:20:11 (2 occurrences)
Last logged: 13:21:01

Unexpected exception during setup
Traceback (most recent call last):
  File "/config/custom_components/cupra_we_connect/config_flow.py", line 75, in async_step_user
    info = await validate_input(self.hass, user_input)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/cupra_we_connect/config_flow.py", line 50, in validate_input
    await hass.async_add_executor_job(we_connect.login)
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/weconnect_cupra/weconnect_cupra.py", line 166, in login
    self.__session.login()
  File "/usr/local/lib/python3.12/site-packages/weconnect_cupra/api/cupra/auth/my_cupra_session.py", line 47, in login
    response = self.doWebAuth(authorizationUrl)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/weconnect_cupra/api/cupra/auth/my_cupra_session.py", line 191, in doWebAuth
    raise APICompatibilityError('No user id provided')
weconnect_cupra.errors.APICompatibilityError: No user id provided

@haydnw
Copy link

haydnw commented Aug 21, 2024

I'm getting the same error as @ECOS-GmbH. Running latest release of the integration, and recently upgraded to HA 2024.8.2. I think the error started at that point, but can't swear to it.

Core 2024.8.2
Supervisor 2024.08.0
Operating System 13.0
Frontend 20240809.0

Cupra app is still working fine on my phone.

@haydnw
Copy link

haydnw commented Aug 21, 2024

Just checked some logs; integration definitely stopped working when I did the HA 2024.8.2 upgrade.

@terminajet
Copy link
Author

Hi everybody,
Thanks for your support.
I have an old computer with Proxmox and HA on it. Maybe i can try to downgrade HA to try logging in cupra weconnect. But i will need a little help because i'm new at HA.
Is it possible to downgrade HA to an older version?

@haydnw
Copy link

haydnw commented Aug 25, 2024

After four days I have just been prompted to agree to new T&Cs in the Cupra app, and this integration now works again. I have no idea how that timing ties up with the HA upgrade. 🤷‍♂️

@terminajet
Copy link
Author

Hi all,
Unfortunately I tried again today to log in the integration and I keep getting the same 'unexpected error' message.
@haydnw : Do you have an EV Cupra borne or a PHEV vehicle?
@ECOS-GmbH : How did you get this log? I wanna see what mine says.

Regards

@terminajet
Copy link
Author

Hey,
I just managed to log. I tried to log on the website and it looks like I didn't accept some consent. After that I managed to log in the integration.

Hope it helps

@daernsinstantfortress
Copy link
Owner

I have no idea how that timing ties up with the HA upgrade.

It doesn't I'm afraid. No change in behaviour on this HA release so just a coincidence, I'm afraid. Plenty of other people have also had issues related to the new consents too and I suspect that the reload of the integration from the restart meant that the re-authentication (which only happens on startup) failed after the upgrade. At this time, the root cause (and fix) is to accept the consents in the official app.

@haydnw
Copy link

haydnw commented Aug 25, 2024

Thanks as always. I'd desperately tried to not jump to conclusions, and had been using the app in the intervening four days without having to accept the new T&Cs. I'd even logged out and back in again in case that was the issue, having been stung before. Oh well, the hidden world of Cupra's back-end infrastructure strikes again!

@12retord
Copy link

Hello, same Problem here, but i‘m not able to find the T&C to accept them.
I have a Seat Tarraco, a Cupra Born and had a VW Golf, do my VW ID works fine with all cars. But in which app/ which website are the T&C?
My CUPRA, my Seat, Seat Connect, Volkswagen, We Connect Go. Or somewhere else?
The Seat Integration works fine in HA, but it is not possible to integrate the Cupra born.

@ECOS-GmbH
Copy link

Hello,
we solved the Problem by login to the Web-Portal and acknowledged some of the data-privacy questions.
This got the integration to work.

@haydnw
Copy link

haydnw commented Aug 28, 2024

But in which app/ which website are the T&C? My CUPRA, my Seat, Seat Connect, Volkswagen, We Connect Go.
I have always acknowledged T&Cs through the My CUPRA app.

=======================

I got an error after restarting from the latest HACS update, but as @daernsinstantfortress pointed out this is likely due to the HA restart rather than the HACS update. My workflow now whenever I need to restart HA is:

Sign out of My CUPRA app > Remove device from this integration > Restart HA > Sign in to My CUPRA app > Add device/integration again

@Yorkie71
Copy link

Sign out of My CUPRA app > Remove device from this integration > Restart HA > Sign in to My CUPRA app > Add device/integration again

That's interesting because I have never had to go through that and have also updated HACS the other day.

@haydnw
Copy link

haydnw commented Aug 28, 2024

Sounds like a me problem then. I'll avoid clogging this issue up any more. :)

@daernsinstantfortress
Copy link
Owner

Yeah, definitely don't need to do any of that. I restart HA all of the time for various changes and can't remember when I last removed and re-added my car!

@12retord
Copy link

No way for me to get it activated. Same error again and again. I‘ve tried to log-out in all Apps, Websites, deleate the Seat and the Cupra Addon, reinstalled it, the Seat App (which has the same log-in information) works fine.
Has someone else also an additional user activated for the car (maybe that could be a reason).
I‘m thankfull for any hints you can give to me…

@Boran
Copy link

Boran commented Sep 1, 2024

At this time, the root cause (and fix) is to accept the consents in the official app

I logged out and back in to the MyCupra app, there was no consent questions.

my HA integration is still broken (about 3 weeks now), with the "Could not fetch data. Status Code was: 400".
Logger: weconnect_cupra
Source: /usr/local/lib/python3.12/site-packages/weconnect_cupra/api/cupra/api.py:74

I also see a status 429 , so, looking at #81 increased the timeout to 60 seconds.

A website is also mentioned above, that one should login to also, what is the website address, is it https://seatid.vwgroup.io/account
There I see just a few marketing options:
image

I also de-installed the integration and readded via HACS. File are in custom_components/cupra_we_connect as expected.
image

Have I missed something?

@12retord
Copy link

12retord commented Sep 2, 2024

@daernsinstantfortress
Is it possible, that the reason for this error in my case is, that I‘ve got a Hybrid (Tarraco) in the mycupra app?
daernsinstantfortress/WeConnect-Cupra-python#13

@sijmenvos
Copy link

I logged into https://seatid.vwgroup.io/account and afterwards I was able to login with the integration again.

@ivoargirov
Copy link

Do all of you guys solved this problem? I also get Unexpected error. I tried to log/unlog/relog, deleted consents, give consents and everything suggested above but I still cannot log into the integration. Any help here?

@Boran
Copy link

Boran commented Dec 23, 2024

Nope, I am blocked too, since August.

@daernsinstantfortress
Copy link
Owner

daernsinstantfortress commented Dec 23, 2024

All I can offer is if someone is willing to share some credentials with me, I can try to have a look to see what's going on. My own account on my own car is working just fine, I'm afraid :/

@haydnw
Copy link

haydnw commented Dec 23, 2024

I've had this message a few times since originally posting, but every time I have logged out of the MyCupra app, then logged in again and had to accept some new T&Cs. I think once I had to remove the app from my phone and reinstall it to prompt the new T&Cs to appear. But it's always been that which is the root of the issue.

@ivoargirov
Copy link

I've had this message a few times since originally posting, but every time I have logged out of the MyCupra app, then logged in again and had to accept some new T&Cs. I think once I had to remove the app from my phone and reinstall it to prompt the new T&Cs to appear. But it's always been that which is the root of the issue.

Unfortunately I have read that beforehand and already tried these "tricks" but didn't helped. The error by login comes again and again :(

@12retord
Copy link

Do you own another seat or cupra car?

@ivoargirov
Copy link

No

@Janosch2
Copy link

Hi there, I'm new on HA but i'm trying to add my vehicle (Cupra leon sportstourer PHEV) to HA. My account on MyCupra is working well. I have followed the instructions to install Cupra Weconnect and everything worked fine until the login window. I write my username and password and i have an error message saying "Unexpected error".

HA is running on a raspberry Pi 4 with HA OS.

Could someone help me?

Regards

Hello, I have exactly the same Problem. same car.
Is it generally possible with Cupra Leon Sportstourer PHEV ?

I have tried everything in the comments ....

Any Ideas ?

Best regards Jan

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests