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

I have a Cupra Born, and I'd love to help make this. #26

Open
initdebugs opened this issue Dec 15, 2021 · 271 comments
Open

I have a Cupra Born, and I'd love to help make this. #26

initdebugs opened this issue Dec 15, 2021 · 271 comments
Assignees
Labels
enhancement New feature or request

Comments

@initdebugs
Copy link

Hi there! I recently picked up my Cupra Born and I'd love to make this work with my car as well. Could you tell me what I can do to help?

@initdebugs initdebugs added the enhancement New feature or request label Dec 15, 2021
@tillsteinbach
Copy link
Owner

Good new, and congratulations to your new car. I hope you love it :)
First question: Is the mycupra app already working for you?
If it is working the complicated part starts. I would prepare a test version for you to try out.

@initdebugs
Copy link
Author

Yes it is working! I can send you screenshots or whatever you need if you want. Would it be easier to discuss this via Discord or would you like to keep everything in Github?

@initdebugs
Copy link
Author

Just let me know what information you need :)

@tillsteinbach
Copy link
Owner

I would prefer if we could keep the discussion here at GitHub to allow potentially others to also try it out. Also it helps a bit my working style as I can answer asynchronously :) If we have confidential parts let's use an email.

Are you a bit experienced in SW development and using python? I have a first version in a separate branch that we could use for initial testing.

@initdebugs
Copy link
Author

I have some experience in python, but I have no idea what steps I should take when trying this out. Could you explain what I should do?

@tillsteinbach
Copy link
Owner

sure,
you need to clone the project: git clone https://github.com/tillsteinbach/WeConnect-python.git
and cd WeConnect-python
install all requirements: pip3 install -r requirements.txt
then you switch to the seat branch: git checkout feature/seat
then go to the examples folder: cd examples
and try out python allVehicles.py -b seat -u yourmyseatusername -p yourpassword

I guess it won't work out of the box, but we can try continuing from there with the error messages we get.

@initdebugs
Copy link
Author

Traceback (most recent call last): File "allVehicles.py", line 32, in <module> main() File "allVehicles.py", line 13, in main parser.add_argument('-b', '--brand', help='Brand if other (e.g. seat)', required=False, type=weconnect.WeConnect.Brand, AttributeError: type object 'WeConnect' has no attribute 'Brand'

@tillsteinbach
Copy link
Owner

Can you do a python --version for me? We need at least python 3.7

@initdebugs
Copy link
Author

I'm on 3.8.8

@tillsteinbach
Copy link
Owner

hmmmm, can you try to install it like that: pip3 install -e . and then execute the command again? might have something todo with paths

@initdebugs
Copy link
Author

image

@tillsteinbach
Copy link
Owner

ah sorry you need to execute that in the WeConnect-python folder, not examples

@initdebugs
Copy link
Author

Initialize WeConnect

Login

update

print results

done

That's what it said in command prompt. What now?

@tillsteinbach
Copy link
Owner

so on the positive side: you did not get an error :) on the negative side: also no data.
I would need to see now what is coming back from the server.
Can you add weConnect.persistCacheAsJson('test.json') right after print('# done') this should write a file with the answer from the server

@initdebugs
Copy link
Author

The file is empty :(

@tillsteinbach
Copy link
Owner

hmmm, ok, new try:
Lets use the CLI it has more logging options:
git clone https://github.com/tillsteinbach/WeConnect-cli.git
cd WeConnect-cli
git checkout feature/seat
pip3 install -e .
and then:
weconnect-cli -vvv -b seat -u yourmyseatusername -p yourpassword get /
this should give you more output

@initdebugs
Copy link
Author

I assume the last line should be python weconnect-cli -vvv -b seat -u yourmyseatusername -p yourpassword get /

I get the error about WeConnect not having attribute 'Brand'. I tried doing the pip3 install -e . but that doesn't help

@tillsteinbach
Copy link
Owner

no, after the pip3 install -e . the python in front should not be necessary.

@tillsteinbach
Copy link
Owner

what does weconnect-cli --version say?

@initdebugs
Copy link
Author

Without python works, but gives the same error about the attribute 'Brand'.

weconnect-li --version gives the same error as well

@tillsteinbach
Copy link
Owner

maybe it has overwritten the library, can you do a pip3 install -e . in the WeConnect-python folder again and then try weconnect-cli?

@initdebugs
Copy link
Author

When trying pip3 install -e . in WeConnect-python:
image

@tillsteinbach
Copy link
Owner

yes, but I think it still overwrite the package. Can you now do a weconnect-cli --version ?

@initdebugs
Copy link
Author

It still gives the attribute error

@tillsteinbach
Copy link
Owner

grrr. Maybe try a pip3 install -e . --force

@initdebugs
Copy link
Author

weconnect-cli --version now gives:
weconnect-cli develop (using WeConnect-python develop

@tillsteinbach
Copy link
Owner

ok, that is better. now we can go back to: weconnect-cli -vvv -b seat -u yourmyseatusername -p yourpassword get /

@initdebugs
Copy link
Author

The Cache file is empty, the token file has, well, tokens.

@msesterhenn
Copy link

Well it turns out that my Cupra Car is actually a Seat :)
I just realized that even if you use their Cupra Connect App and have a Cupra Account, the backend in use is actually the Seat version.
Modified the endpoints and now I am able to get data +1.
Would also adding support for Seat to this project something that is worth talking about?

@daernsinstantfortress
Copy link

Could you share your updated endpoints here? What model / year car do you have?

@msesterhenn
Copy link

Sure.
I'm not at home now but I extracted the URLs from https://github.com/Farfar/homeassistant-seatconnect, you should be able to find them in there.
Right now I'm using the same module in HomeAssistant and it works fine.

@Intenos
Copy link

Intenos commented May 1, 2023

Hi together,
I found a way to integrate the Cupra Born into openHAB. It´s not a very convenient way, but it works up to now smothely and reliable.

I like to thank all the guys who have developed the different tools. Without them the integration won´t be possible.

In the following I document the way in to make it easier for successors.

  1. Home Assistant with HACS and patched We Connect ID
  • Installing Home Assistant. I installed it in Docker. This is a quite easy and safe way. The /config path needs to be linked to a local folder and the port 8123 bridged or linked.
  • Install HACS in Home Assistant. To do so, run "wget -O - https://get.hacs.xyz | bash" in the /config folder. Afterwards restart the Home Assistant docker. Now it is possible to add HACS in Home Assistant under "Einstellungen -> Geräte & Dienste -> Integrationen". (As I´m not sure about the English wording, I use the German one.). Finally, the installation of HACS needs to be finished which includes the authentification with GitHub.
  • Install "We Connect ID" by adding the user repository "mitch-dc / volkswagen_we_connect_id" under "HACS -> Integrationen -> Benutzerdefinierte Repositories" first. Afterwards it is possible to install it. For integrating the Cupra Born, the files within the path /config/cutstom_components/volkswagen_we_connect_id" must now be replaced against the latest files available from the download link further up in this forum. After restarting the Home Assistant docker, it is possible to connect to the Cupra Born.
  1. MQTT Broker
  • For communication between Home Assistant and openHAB, I use the MQTT communication protocol. MQTT requires a broker to which Home Assistant as well as openHAB can connect to.
  • An easy way to install a MQTT Broker is again using Docker. I used the "eclipse-mosquitto" image.
  • After having started the MQTT docker, the config file "mosquitto.conf" which can be found in the path "/mosquitto/config" needs to be adapted. I added "listener 1883" and "allow_anonymous true" in the config file so that broker listens to the standard port 1883 and works without authentication.
  1. Installing and setting up MQTT in Home Assistant
  • MQTT can easily be added in Home Assistant as standard integration. After adding the integration, it must be configured by means of the IP address and port of the broker.
  • That Home Assistant automatically forwards all data read out from the Cupra Born to the MQTT Broker, I installed the integration "MQTT DiscoveryStream". This integration can be found under "HACS -> Integrationen". After installation it must be configured by the file "configuration.yaml". When the below code gets added in the configuration.yaml file, Home Assistant will automatically posts all available data except of the ones defined under "exclude:".
    # MQTT Discoverystream mqtt_discoverystream: base_topic: homeassistant publish_attributes: false publish_timestamps: false publish_discovery: false exclude: entities: - sensor.hacs - zone.home - sun.sun entity_globs: - persistent_notification* - sensor.sun*000
  1. Checking the Home Assistant MQTT communication and listing the available data points
  • An easy way to monitor the MQTT communication and getting an overview about the available data is to use a MQTT Explorer. "MQTT Explorer" is also available as Windows version and allows to connect to the MQTT broker by just configuring the IP address and port.
  • In case no data available in the MQTT broker yet, an entity in Home Assistant can for example be deactivated and activated to enforce a parameter update or communication respectively.
  1. openHAB 3.X
  • In openHAB, the "MQTT Binding" must be installed first. Afterwards it is possible to configure the Bridge, Thing and Items either via the user interface or via the text files. For those I can make available the following .thing configuration file:
    Bridge mqtt:broker:mybroker [ host="192.168.178.25", secure=false ] { Thing topic homeassistant "Cupra" @ "mqtt" { Type string : kilometerstand "Kilometerstand" [ stateTopic="homeassistant/sensor/cupra_born_odometer_in_kilometers/state" ] Type string : ladestand "Ladestand" [ stateTopic="homeassistant/sensor/cupra_born_state_of_charge/state" ] Type string : reichweite "Reichweite" [ stateTopic="homeassistant/sensor/cupra_born_range_in_kilometers/state" ] Type number : laden_restzeit "Verbleibende Ladezeit" [ stateTopic="homeassistant/sensor/cupra_born_remaining_charging_time/state" ] Type number : laden_zielladestand "Zielladestand" [ stateTopic="homeassistant/sensor/cupra_born_target_state_of_charge/state", commandTopic="homeassistant/number/cupra_born_target_state_of_charge/state", min=50, max=100, step=10 ] Type number : klima_zieltemperatur "Ziel-Innenraumtemperatur" [ stateTopic="homeassistant/sensor/cupra_born_target_temperature_c/state", commandTopic="homeassistant/number/cupra_born_target_temperature_c/state", min=16, max=30, step=0.5 ] Type string : standort "Standort" [ stateTopic="homeassistant/device_tracker/cupra_born_tracker/state" ] Type string : status_motor "Status Motor" [ stateTopic="homeassistant/binary_sensor/cupra_born_engine_status/state" ] } }
  • The corresponding .items file could look as follows:
    Number Born_Kilometer_Gesamt "Kilometerstand [%.0f km]" { channel="mqtt:topic:mybroker:homeassistant:kilometerstand" } Number Born_Kilometer_Gesamt_Tageslogging "Kilometerstand [%.0f km]" { channel="mqtt:topic:mybroker:homeassistant:kilometerstand" } Number Born_Kilometer_Tag "Kilometer heute [%.0f km]" Number Born_Ladestand "Ladestand [%.0f %%]" { channel="mqtt:topic:mybroker:homeassistant:ladestand" } Number Born_Reichweite "Reichweite [%.0f km]" { channel="mqtt:topic:mybroker:homeassistant:reichweite" } Number Born_Laden_Restladezeit "Verbleibende Ladezeit [%s]" { channel="mqtt:topic:mybroker:homeassistant:laden_restzeit" } Number Born_Laden_Zielladestand "Ziel-Ladestand [%.0f %%]" { channel="mqtt:topic:mybroker:homeassistant:laden_zielladestand" } Number Born_Klima_Zieltemperatur "Ziel-Innenraumtemperatur [%.1f °C]" { channel="mqtt:topic:mybroker:homeassistant:klima_zieltemperatur" } String Born_Standort "Standort [MAP(Born_Standort.map):%s]" { channel="mqtt:topic:mybroker:homeassistant:standort" } String Born_Status_Motor "Status Motor [MAP(de.map):%s]" { channel="mqtt:topic:mybroker:homeassistant:status_motor" }
  1. Allowing to also configure parameters
  • As configuration parameters changed in openHAB and pushed to the MQTT Broker don´t automatically get accepted and used by Home Assistant, automations must be setup for those parameters. In the following I document the way I found. There might be easier ways available, I don´t know. It´s the first time I´m using Home Assistant.
  • To allow the configuration of the max. charge of the battery, an automation with the "Auslöser" of the type "When an MQTT message has been received" must be added. In this case the topic is "homeassistant/number/cupra_born_target_state_of_charge/state". For any of the settings (50, 60, 70, 80, 90 and 100), I created a seperate automation with the value specified in "Payload" as I haven´t found a way to directly transfer the value. As "Aktionen" I added the "Gerät" of the type "Volkswage CUPRA BORN ..." with the "Aktion" "Wert für CUPRA Born Target State Of Charge setzen". As above, the individual configuration values (50, 60, 70, 80, 90 and 100) must be set in "Wert". Additionally, the action "Dienst ausführen" with "Volkswagen We Connect ID: volkswagen_id_set_target_soc" must be selected.

@Spartacus68
Copy link

Hi all,

sorry for the stupid question, but is there a short instruction how to install the software for the Cupra Born? I have it since last week and I would like to install the HA component.

If I download the zip-file I see a folder "custom_components.". Is it all to move this folder to the custom_components folder in HA?

Thanks,
Spartacus

@madmic1314
Copy link

Things you'll need first:

  • HACS installed and working
  • Samba access to your Home Assistant instance
  • A recent backup of Home Assistant
  1. From HACS install Volkswagen We Connect. Once installed don't reboot and don't setup the integration in HA
  2. The files in your .zip file need to go into your Home Assistant folder -> custom_components\volkswagencarnet like this:
    image
  3. Now restart Home Assistant, then install the VW Carnet integration and follow the setup process

When prompted to update VM Carnet in HACS - do not do this!

@Spartacus68
Copy link

Hi,

I installed We Connect ID and I see this UI

image

is this wrong? Do I have to use the We Connect Integration? I used this for my Golf but red that I have to use the ID-Version.

@Spartacus68
Copy link

ok, I used the wrong We Connect version. Now it works. Thanks for support

@Spartacus68
Copy link

Hi all,

sorry for comming back again.

Is it correct, that you cannot trigger any actions (e.g. start climate). I can only see sensors except climate temperature and the target state of charge.
image

With HA-We-Connect for my Golf 7 I can control climate, doors, windows and some light-feature

@daernsinstantfortress
Copy link

daernsinstantfortress commented May 10, 2023

@madmic1314 Regarding installation, you shouldn't need to do any of that and, in fact, it will cause you problems. Just copy the contents of the latest zip into custom_components using your preferred mechanism (I use Samba, but whatever works) and restart HA. Now you can add the integration through devices & services. You need to search for "volkswagen weconnect id". Do not use HACS or anything else at this time - it's unnecessary and can certainly cause problems due to library version conflicts with the original source component. There is no need to install anything relating to the original ID integration beforehand.

This keeps coming up and I will properly fork this library when I have time as there is clearly some confusion here. Once this is done it should be installable through HACS and it will then allow coexistence with the ID.x version of the library.

@Spartacus68 There's a couple of buttons exposed through the integration - start and stop climate, start and stop charge. You can add them to the UI, but personally I prefer to wrap them in a template switch:

- platform: template
  switches:
    car_heating:
      friendly_name: "Heating"
      value_template: "{{ states('sensor.cupra_born_climatisation_state') in ['cooling', 'heating'] }}"
      turn_on:
        service: button.press
        target:
          entity_id: button.cupra_born_start_climate
      turn_off:
        service: button.press
        target:
          entity_id: button.cupra_born_stop_climate
      icon_template: >-
        {% if states('sensor.cupra_born_climatisation_state') in ['cooling', 'heating'] %}
          mdi:radiator
        {% else %}
          mdi:radiator-off
        {% endif %}

Right now, you can only control climate and charging. If anyone knows how to do more than this on the Cupra Born, feel free to share :)

@madmic1314
Copy link

@madmic1314 Regarding installation, you shouldn't need to do any of that and, in fact, it will cause you problems. Just copy the contents of the latest zip into custom_components using your preferred mechanism (I use Samba, but whatever works) and restart HA. Now you can add the integration through devices & services. You need to search for "volkswagen weconnect id". Do not use HACS or anything else at this time - it's unnecessary and can certainly cause problems due to library version conflicts with the original source component. There is no need to install anything relating to the original ID integration beforehand.

This keeps coming up and I will properly fork this library when I have time as there is clearly some confusion here. Once this is done it should be installable through HACS and it will then allow coexistence with the ID.x version of the library.

Apologies for the mislead - this was how I installed when this first came about. Agree anything that can clear things up would make life easier.

@Spartacus68
Copy link

Hey,

thanks for support. It works for me and the CUPRA Born. A pity is, that WeConnect is not working with my GOLF 7 anymore. If there is a chance to have both inparallel it would be great.

@daernsinstantfortress
Copy link

@Spartacus68 That'll come when I sort the proper fork out. I'll try to sort over the coming days...

@viking2010
Copy link

Not sure if it's just the Cupra API or this integration, but on the Cupra Born, whilst the overall door lock status is working, as are individual door locks, windows and open/closed status, the entity binary_sensor.cupra_born_door_lock_status is always showing as Locked. It never changes. Is there anything I can do to help debug this at all?

@mart-ch
Copy link

mart-ch commented May 15, 2023

Hello Cupra Born owner,
i would like to add my born to my openhab smarthome.
Is Home Assistant really needed for that?

@Intenos
Copy link

Intenos commented May 16, 2023

@mart-ch
I searched quite a lot in the internet and found no easier solution for getting the Born into openHAB. Anyhow, I´m happy that I found this solution. Especially as it works quite reliable since I have set it up and provides everything I want to have. In case you have Docker, it is fairly easy to setup the different tools required.

@Mitch73-2
Copy link

@daernsinstantfortress

After I updated HA to the latest beta (Home Assistant 2023.6.0b1) version this morning, the cupra born integration no longer works. Now I get this message in HA:

Logger: homeassistant.setup
Source: setup.py:207
First occurred: 16:02:25 (1 occurrences)
Last logged: 16:02:25

Setup failed for custom integration volkswagen_we_connect_id: Requirements for volkswagen_we_connect_id not found: ['weconnect-cupra-daern==0.49.18'].

Do you have any idea why the cupra born integration no longer works?
Thank you in advance.

@daernsinstantfortress
Copy link

Suspect it's related to a change in supported Python versions in 2023.6. Was wondering if anything would break...now I know! Bear with me and I'll check it out tonight.

Can you look to see if there's anything else in the logs. If you can, would you enable debug for the component and see if that helps.

@Boss-man
Copy link

Boss-man commented Jun 1, 2023

@daernsinstantfortress

Do you have any idea why the cupra born integration no longer works? Thank you in advance.

It say in the braking changes that they now use Python 3.11 and all integrations need to support that version.

@Mitch73-2
Copy link

I see this now also :

Logger: homeassistant.util.package
Source: util/package.py:107
First occurred: 17:57:54 (3 occurrences)
Last logged: 17:58:22

Unable to install package weconnect-cupra-daern==0.49.18: ERROR: Cannot install weconnect-cupra-daern==0.49.18 because these package versions have conflicting dependencies. ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts

@daernsinstantfortress
Copy link

Not quite sure what's going on. I've just installed it onto a test machine with Python 3.11 and it all install and ran fine without any issues. I suspect that something else is going on with the new HA version that I won't be able to diagnose until I get my hands on it when properly released in a day or two and I can see what's going on.

I suggest that you roll back to stable HA for now until I've had chance to do this.

@daernsinstantfortress
Copy link

daernsinstantfortress commented Jun 2, 2023

OK, new version which should fix this:
https://github.com/daernsinstantfortress/volkswagen_we_connect_id/archive/8ceb117c78f270095da34943d1a69c3192a4ff8e.zip

Let me know how you get on.

@Mitch73-2
Copy link

Yes
New version fixed the problem.
Great work again 👍

@daernsinstantfortress
Copy link

daernsinstantfortress commented Jun 8, 2023

Hi all,

I'm very pleased to announce a new, standalone Cupra Born integration, available today! This is available from here and, for HA users (which I think is most people using it), it can now be installed using HACS (see the readme). There is also a thread on the HA forums.

Few notes:

  • As of now, this is still fundamentally the same code and is functionally the same as the most recent version released last week. It's in effect a hard fork of the work done so far in this thread. This will probably change over time.
  • Branding should be a bit more Cupra and a bit less VW! The integration is now called "Cupra WeConnect", reflecting its origins, so makes a bit more sense in the HA UI
  • This change will allow for both VW and Cupra integrations to be installed side-by-side (for those with both cars!), something not currently possible due to the overlapping library namespace
  • Going forward, this will allow for better quality releases (versions! testing! bug reports!), for other developers to assist through PRs and obviously a better experience for users installing via HACS, including new versions being pushed to users
  • The forking of this from the VW libraries and HA component wasn't an ideal situation, but is a reflection of the amount of changes that have gone into the structure of the code and the increasing difficulty (and thus unlikeliness) of merging this back into the parent project. I'm still not precluding this in future and am happy to support if anyone wants to help
  • I will no longer continue to support the previous version released through this thread, but as they are pretty much the same today anyway, this shouldn't be a big loss to anyone😉

On a matter of practical detail, in order to switch over, you will need to completely remove the old component prior to installing this one. This involves a two-step process of deleting the integration from Devices & Services and then deleting the files from the custom_components folder. If you then reboot HA, you should be good to go ahead and install the new component from HACS. If you do this, once completed you'll have exactly the same entities with the same names so you won't break any UI or automation work you've done 😄 Check the readme for more details.

Going forward, for this new component please report defects and/or product suggestions directly against the project rather than in this thread. I'll leave it up to @tillsteinbach as to whether he wants to leave this thread to cover any future implementation within WeConnect, or close it off with a pointer across to this new component.

Huge thanks to @tillsteinbach and @alangibson who originated this project and hopefully we can keep things moving forward now.

@MastrUsr
Copy link

MastrUsr commented Jun 8, 2023

Hi all,

I'm very pleased to announce a new, standalone Cupra Born integration, available today! This is available from here and, for HA users (which I think is most people using it), it can now be installed using HACS (see the readme).

Few notes:

  • As of now, this is still fundamentally the same code and is functionally the same as the most recent version released last week. It's in effect a hard fork of the work done so far in this thread. This will probably change over time.
  • Branding should be a bit more Cupra and a bit less VW! The integration is now called "Cupra WeConnect", reflecting its origins, so makes a bit more sense in the HA UI
  • This change will allow for both VW and Cupra integrations to be installed side-by-side (for those with both cars!), something not currently possible due to the overlapping library namespace
  • Going forward, this will allow for better quality releases (versions! testing! bug reports!), for other developers to assist through PRs and obviously a better experience for users installing via HACS, including new versions being pushed to users
  • The forking of this from the VW libraries and HA component wasn't an ideal situation, but is a reflection of the amount of changes that have gone into the structure of the code and the increasing difficulty (and thus unlikeliness) of merging this back into the parent project. I'm still not precluding this in future and am happy to support if anyone wants to help
  • I will no longer continue to support the previous version released through this thread, but as they are pretty much the same today anyway, this shouldn't be a big loss to anyone😉

On a matter of practical detail, in order to switch over, you will need to completely remove the old component prior to installing this one. This involves a two-step process of deleting the integration from Devices & Services and then deleting the files from the custom_components folder. If you then reboot HA, you should be good to go ahead and install the new component from HACS. If you do this, once completed you'll have exactly the same entities with the same names so you won't break any UI or automation work you've done 😄 Check the readme for more details.

Going forward, for this new component please report defects and/or product suggestions directly against the project rather than in this thread. I'll leave it up to @tillsteinbach as to whether he wants to leave this thread to cover any future implementation within WeConnect, or close it off with a pointer across to this new component.

Huge thanks to @tillsteinbach and @alangibson who originated this project and hopefully we can keep things moving forward now.

Wow! Awosome work! Can't wait to test it out in the coming week when my car should arrive... 🥰

@Vayatoalla
Copy link

Vayatoalla commented Aug 23, 2023

Hi together, I found a way to integrate the Cupra Born into openHAB. It´s not a very convenient way, but it works up to now smothely and reliable.

I like to thank all the guys who have developed the different tools. Without them the integration won´t be possible.

In the following I document the way in to make it easier for successors.

  1. Home Assistant with HACS and patched We Connect ID

........

  1. Allowing to also configure parameters
  • As configuration parameters changed in openHAB and pushed to the MQTT Broker don´t automatically get accepted and used by Home Assistant, automations must be setup for those parameters. In the following I document the way I found. There might be easier ways available, I don´t know. It´s the first time I´m using Home Assistant.
  • To allow the configuration of the max. charge of the battery, an automation with the "Auslöser" of the type "When an MQTT message has been received" must be added. In this case the topic is "homeassistant/number/cupra_born_target_state_of_charge/state". For any of the settings (50, 60, 70, 80, 90 and 100), I created a seperate automation with the value specified in "Payload" as I haven´t found a way to directly transfer the value. As "Aktionen" I added the "Gerät" of the type "Volkswage CUPRA BORN ..." with the "Aktion" "Wert für CUPRA Born Target State Of Charge setzen". As above, the individual configuration values (50, 60, 70, 80, 90 and 100) must be set in "Wert". Additionally, the action "Dienst ausführen" with "Volkswagen We Connect ID: volkswagen_id_set_target_soc" must be selected.

Hi @Intenos . Thank you for your post, I have followed it to integrate my Cupra Born in Openhab.
By the way, you can use the mqtt payloads in your automations, try 'call a service' and "{{ trigger.payload }}" in the target soc. The YAML should be like this:

alias: SetChargingTarget
description: ""
trigger:

  • platform: mqtt
    topic: homeassistant/number/cupra_born_target_state_of_charge/state
    condition: []
    action:
  • service: cupra_we_connect.volkswagen_id_set_target_soc
    data:
    vin: put your car VIN here
    target_soc: "{{ trigger.payload }}"
    mode: single

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

No branches or pull requests