Cupra Born EV integration

Hi all,

I’m very pleased to announce a new, standalone Cupra Born integration , available today! This is available from here and can now be installed using HACS (see the readme). This is a continuation of the work already done over the last year, so it’s already pretty stable and well used.

Repo, for use in HACS: https://github.com/daernsinstantfortress/cupra_we_connect

This integration is now in the default list in HACS, so you can just search for “Cupra” there without needing to add the repo specifically :slight_smile:

For those already running the previous WeConnect branch version, you will want to delete the integration from HA (Settings → Devices & Services), delete the files from custom_components, reboot and then install with HACS using the custom repository above. If you do this, all of your entity names will be preserved and your automations / UI should be unaffected.

Going forward, this will be where future features and updates will go, so it’s worth switching across when you have a few minutes as you’ll then get updates when they are released. More details on the background in the original development thread if you wish to read them.

Any problems, please post here, or create an issue report against the project.

This integration is the product of the work of several people (definitely not just me!) over the last year and has been running from a branch of another project for several months now, but it deserves to be its own component, so here it is!

6 Likes

Fantastic. Will be trying this later! :+1:

1 Like

This is awesome, thanks for this!

Interested to see everyone’s HA dashboards.

Here’s my dashboard for now, still improving it.

2 Likes

@_Mitch07 Looks great - much smarter than my abomination! Definitely need to spend more time making mine look more awesome. It works great, but it doesn’t look quite so smart…

Wonder if there’s more we can do with the images? e.g. open doors, windows etc.

I’m working on this one but unfortunately don’t have enough time to finish it. Project still in progress

2 Likes

Thanks for building this! I’ve been using the previous version for quite some time and it worked flawlessly. Now that I’ve merged to this one, I have one question/missing thing from the official app; when charging the car, the official app allows me to slow the charge rate. I can see the values of the change coming back in HA, but no way to trigger the change itself. Is this something I’m overlooking, or is this not possible yet?

Have a search for button.cupra_born_toggle_ac_charge_speed in developer states. This exposes a push button that toggles the speed between reduced and maximum. Be aware that it may take a few minutes from triggering it before sensor.cupra_born_max_charge_current_ac updates to reflect it.

I don’t use this, but upon reflection it might be nice to have an interface that lets you explicitly set it rather than just toggle it, which is a bit easier to manage in automations!

Good luck!

1 Like

image

I get this error when trying to setup the integration, did I miss a step?

I’m trying to set it up for a cupra formentor, anyone already got that working?

Ah, no. Never tried a Formentor and it probably doesn’t work at the moment. Have you logged in successfully with the official app?

Just deleted the old version and installed through HACS without any drama. All existing info retained perfectly. Thanks for your continued efforts with this!

Excellent, glad to hear it! Onwards and upwards!

It seems the VW Identity service is experiencing issues. Any other people getting this when configuring the integration?

Shows up as ‘Unexpected error’, logs showing a 503 service unavailable:
image

Manual (web) logon to My Cupra gets me something like a 503 as well:
image

Logger: custom_components.cupra_we_connect.config_flow
Source: custom_components/cupra_we_connect/config_flow.py:50
Integration: Cupra WeConnect (documentation)
First occurred: 15:37:30 (1 occurrences)
Last logged: 15:37:30

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.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/weconnect_cupra/weconnect_cupra.py", line 166, in login
    self.__session.login()
  File "/usr/local/lib/python3.11/site-packages/weconnect_cupra/api/cupra/auth/my_cupra_session.py", line 47, in login
    response = self.doWebAuth(authorizationUrl)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/weconnect_cupra/api/cupra/auth/my_cupra_session.py", line 82, in doWebAuth
    raise APICompatibilityError('Retrieving credentials page was not successfull,'
weconnect_cupra.errors.APICompatibilityError: Retrieving credentials page was not successfull, status code: 503

Im getting the same too - I think their site is down as the app wont log in either - I came here looking for help, but I think time is the answer here.

Just tested it myself and it looks to be all working again as of now. Checking my logs, it seems that whatever issue there was was resolved at around 15:35 GMT.

This would not be the first time this API has chucked 500 errors for a few hours, so I wouldn’t worry too much. The integration does seem to handle it ok and will back-off appropriately to avoid bashing the hell out of it when it does fail and to give it plenty of time to start working again.

Yes, working for me now too. I’m very happy with this integration! Thanks guys!

1 Like

Yes I’m able to login with the official app
I still have the unexpected error

Which official app are you using?

I’m using cupra connect

Yeah, it’s a different app to the My Cupra one used by Cupra Born owners (and this integration).

I don’t mind taking a look to see how different it is and whether it could be integrated, but I’d need someone to “lend” me some credentials so I could check it out. Or, alternatively, they could do a bit of reverse engineering of the app and share the output - basically, I need the API call sequence and responses.