Cupra Born Support in Home Assistant

All CUPRA Born related discussions
Post Reply
daern
Posts: 177
Joined: Wed Jul 20, 2022 1:31 pm

Post by daern »

No problem! I'm currently testing a new version that will fully support HACS, so future versions will be much easier to update. Just give me a few days... :-)

daern
Posts: 177
Joined: Wed Jul 20, 2022 1:31 pm

Post by daern »

New version released! The long and the short of it is as follows:

New user? Install this using HACS as you would any other custom component (search for "Cupra" after adding the custom repo)

Already using it? You need to uninstall the old version completely first (delete the integration from within HA, then delete the files from the custom_components folder), reboot HA and then install the new one with HACS (or manually if you prefer). If you do this, all of your entity names will be maintained and any automations or UI pages will work as before without changes. Bit more detail here.

Either way, once you've got the new version installed, you'll get updates through HACS as normal and new features when they appear. If you have any suggestions, please raise here.
daern
Posts: 177
Joined: Wed Jul 20, 2022 1:31 pm

Post by daern »

New version (0.4) released. As a few people (myself included) have had some issues with cars going offline, the component now exposes an online state so you can monitor it and take action should you want to:

0eda3f12ae1f445aa9c06808855bc802a58e4b16.png

Update through HACS or manually if you prefer.

You can add an automation something like this to monitor it:

Code: Select all

- id: car_offline
  alias: "Notify if car is offline"
  trigger:
    - platform: state
      entity_id: binary_sensor.cupra_born_car_is_online
      from:
        - "on"
        - "off"
      to:
        - "on"
        - "off"
  action:
    - service: notify.pushover
      data_template:
        title: >
          Car has {% if is_state('binary_sensor.cupra_born_car_is_online', 'off') %}gone offline{% else %}returned online{% endif %}
        message: >
          The car has {% if is_state('binary_sensor.cupra_born_car_is_online', 'off') %}gone offline{% else %}returned online{% endif %}

          This happened at: {{ now() }}
        data:
          sound: siren 
born_owner
Posts: 29
Joined: Mon Apr 24, 2023 2:33 pm

Post by born_owner »

daern wrote: Mon Jun 12, 2023 10:41 pm the component now exposes an online state so you can monitor it
So is this a reflection purely of Cupra's server uptime, or would it show as offline if the car is out of reception on the eSIM too (for example)? I think it would be good to know how often the app server(s) is/are actually down, particularly if this is a paid service due for renewal at some point in the future. I'm just wondering if this sensor could be used as a measure of that, or not.
Born V2, 77kW, e-Boost, Vapour Grey
daern
Posts: 177
Joined: Wed Jul 20, 2022 1:31 pm

Post by daern »

haydnw wrote: Mon Jun 19, 2023 12:00 pm
daern wrote: Mon Jun 12, 2023 10:41 pm the component now exposes an online state so you can monitor it
So is this a reflection purely of Cupra's server uptime, or would it show as offline if the car is out of reception on the eSIM too (for example)? I think it would be good to know how often the app server(s) is/are actually down, particularly if this is a paid service due for renewal at some point in the future. I'm just wondering if this sensor could be used as a measure of that, or not.
No, it's nothing to do with their server uptime. This uses the returned status that informs whether the VAG back end thinks your car is online or offline. I've had mine glitch up and down a time or two, so does definitely seem to be affected by things like network coverage and obviously can be impacted if you (or your car!) turns off the online options in the infotainment system. It's not used to monitor whether the back-end is actually working or not (which I guess I could add separately if needed, although it's been working ok recently).

This has been primarily added so I know if the car decides to shut off the online services autonomously as when this happened to me a couple of weeks ago, I wasn't aware of it as it just results in no data being updated on the back-end.
born_owner
Posts: 29
Joined: Mon Apr 24, 2023 2:33 pm

Post by born_owner »

Great, thanks for confirming.

On a separate note, I had notification on Saturday that SimpleIcons will not be including the Cupra logo in their set because the T&Cs on the Cupra UK website don't allow use of it for any purpose whatsoever. Which is a shame.
Born V2, 77kW, e-Boost, Vapour Grey
daern
Posts: 177
Joined: Wed Jul 20, 2022 1:31 pm

Post by daern »

haydnw wrote: Mon Jul 03, 2023 6:44 am Great, thanks for confirming.

On a separate note, I had notification on Saturday that SimpleIcons will not be including the Cupra logo in their set because the T&Cs on the Cupra UK website don't allow use of it for any purpose whatsoever. Which is a shame.
Yes, very much so. HA accepted the Cupra logos in their own branding project, but it's a shame that Cupra are restricting access like this. This means you will at least see sensible icons in HA now.
User avatar
SilverCupra
Posts: 68
Joined: Fri Jun 17, 2022 9:11 am

Post by SilverCupra »

Hi guy's,

I have been playing with this and created an automation to run every 5 mins to check that my car is secure (all doors locked, boot locked and windows closed). Fairly simple, just checks the binary sensors provided by the Integration.

Works a treat and displays car secure status on my home assistant panel..

However, I have a question, does anyone know if my repeating 5 minute automation just retrieves data from the Cupra servers, or will it be waking the car to get the information ?

The reason for the question is that I am concerned if such a repeating automation was to continually wake the car, would it have any affect on security and battery charge.

Anyone know ?
Cupra Born V2 | Tech-L | Geysor Silver
daern
Posts: 177
Joined: Wed Jul 20, 2022 1:31 pm

Post by daern »

Glad to hear you have this working!

It's worth noting that, on the whole, HA is event-driven. This means that you don't typically need to poll for things, but rather you can create listeners that wait for something to happen and then use that. This is lower cost and generally results in simpler, more predictable automations.

Here is my "check the car is locked up" automation which might help you coming up with cool new automations :-)

Code: Select all

- id: car_left_unlocked
  alias: Car Left Unlocked
  mode: single
  trigger:
    - platform: time
      at: '21:00:00'
    - platform: state
      entity_id: 
        - binary_sensor.cupra_born_overall_status
      from: "off"
      to: "on"
      for: "00:15:00"
    - platform: state
      entity_id: 
        - binary_sensor.cupra_born_engine_status
      from: "on"
      to: "off"
      for: "00:15:00"
  condition:
    - condition: state
      entity_id: binary_sensor.cupra_born_engine_status
      state: 'off'
      for: "00:15:00"
    - condition: state
      entity_id: binary_sensor.cupra_born_overall_status
      state: 'on'
      for: "00:15:00"
  action:
    - service: notify.pushover
      data_template:
        title: >
          Car has been left insecure
        message: >
          The car has been parked up, but not secured. You should correct this.
          The doors are currently {% if is_state('binary_sensor.cupra_born_door_lock_status', 'off') %}Locked{% else %}Unlocked{% endif %}.
        data:
          sound: siren  
    - service: media_player.volume_mute
      data:
        entity_id: media_player.downstairs_broadcast
        is_volume_muted: false
    - service: media_player.volume_set
      data:
        entity_id: media_player.downstairs_broadcast
        volume_level: 0.5
    - service: tts.google_translate_say
      entity_id: media_player.downstairs_broadcast
      data:
        message: The car has been left unlocked
You'll notice that this is event driven and that it uses three triggers:
1. Car unlocked for 15 minutes
2. Car stopped for 15 minutes
3. Fixed time at 9pm

It then checks conditions to verify that the car is both stopped and insecure, before sending an appropriate notification. The 9pm trigger is a "check before bed" alert, to remind me in case I ignored the rest during the day.
However, I have a question, does anyone know if my repeating 5 minute automation just retrieves data from the Cupra servers, or will it be waking the car to get the information ?

The reason for the question is that I am concerned if such a repeating automation was to continually wake the car, would it have any affect on security and battery charge.
No for all cases. In fact, your 5 minute poll is simply checking the state of the local integration, which is independently retrieving the status every 30s. Querying this more often won't make it poll any quicker and, indeed, using state triggers will let you know when something changes in the fastest possible way. Even the 30s poll by the integration is really only poking VAG's API, to ask what the last reported state of the vehicle is. No matter how often you poll this, it won't get the car to report any quicker. It will, however, upset VAG which is why it's not configurable... ;-)
viking2010
Posts: 17
Joined: Mon Jul 11, 2022 10:47 am

Post by viking2010 »

daern wrote: Mon Jul 03, 2023 1:36 pm
haydnw wrote: Mon Jul 03, 2023 6:44 am Great, thanks for confirming.

On a separate note, I had notification on Saturday that SimpleIcons will not be including the Cupra logo in their set because the T&Cs on the Cupra UK website don't allow use of it for any purpose whatsoever. Which is a shame.
Yes, very much so. HA accepted the Cupra logos in their own branding project, but it's a shame that Cupra are restricting access like this. This means you will at least see sensible icons in HA now.
FYI, the Cupra logo is available if you use the HA HACS add-on "Custom Brand Icons" available here: https://github.com/elax46/custom-brand-icons
Post Reply