evcc icon indicating copy to clipboard operation
evcc copied to clipboard

Call to Cupra API results in 404

Open tgold opened this issue 2 years ago • 38 comments

Describe the bug

The API call to the endpoint for getting the car status results in a 404.

Steps to reproduce

  1. configure a car as Cupra
  2. Start charging

...

Configuration details

network:
  schema: http
  host: evcc.local # .local suffix announces the hostname on MDNS
  port: 7070

log: debug
levels:
  cache: error

# unique installation id
plant: {removed}

interval: 30s # control cycle interval

sponsortoken: {removed}

# sponsors can set telemetry: true to enable anonymous data aggregation
# see https://github.com/evcc-io/evcc/discussions/4554
telemetry: false

meters:
- type: template
  template: solaredge-hybrid
  id: 1
  host: 192.168.0.91
  port: 1502
  usage: grid
  modbus: tcpip
  timeout: 10s
  name: grid1
- type: template
  template: solaredge-hybrid
  id: 1
  host: 192.168.0.91
  port: 1502
  usage: pv
  modbus: tcpip
  timeout: 10s
  name: pv2
- type: template
  template: solaredge-hybrid
  id: 1
  host: 192.168.0.91
  port: 1502
  usage: battery
  modbus: tcpip
  timeout: 10s
  name: battery3

chargers:
- type: template
  template: alfen
  id: 1
  host: 192.168.0.93
  port: 502
  modbus: tcpip
  name: wallbox5

vehicles:
- type: template
  template: cupra
  title: Cupra Born
  user: {removed}
  password: {removed}
  capacity: 58
  name: ev4

loadpoints:
- title: Carport
  charger: wallbox5
  vehicle: ev4
  mode: pv
  enable:
    delay: 1m
    threshold: -1600
  disable:
    delay: 10m
    threshold: -500

site:
  title: name
  residualPower: 100
  meters:
    grid: grid1
    pv:
    - pv2
    battery:
    - battery3

Log details

[cupra ] TRACE 2024/07/24 08:28:27 GET https://ola.prod.code.seat.cloud.vwgroup.com/v2/users/{removed}/vehicles/{removed}/mycar
[cupra ] TRACE 2024/07/24 08:28:27 {"timestamp":"2024-07-24T06:28:27.176470629Z","path":"/v2/users/{removed}/vehicles/{removed}/mycar","status":404,"error":"Not Found","message":"No static resource v2/users/{removed}/vehicles/{removed}/mycar.","requestId":"281f1c4d-8633507"}
[cupra ] TRACE 2024/07/24 09:40:57 POST https://tokenrefreshservice.apps.emea.vwapps.io/refreshTokens
[cupra ] TRACE 2024/07/24 09:40:57 brand=cupra&grant_type=refresh_token&refresh_token={removed}{"access_token":"{removed}","expires_in":3599,"id_token":"{removed}","refresh_token":"{removed}","token_type":"bearer"}
[cupra ] TRACE 2024/07/24 09:40:57 GET https://ola.prod.code.seat.cloud.vwgroup.com/v2/users/{removed}/vehicles/{removed}/mycar
[cupra ] TRACE 2024/07/24 09:40:58 {"timestamp":"2024-07-24T07:40:57.988374052Z","path":"/v2/users/{removed}/vehicles/{removed}/mycar","status":404,"error":"Not Found","message":"No static resource v2/users/{removed}/vehicles/{removed}/mycar.","requestId":"8a1abe18-9282696"}
[cupra ] TRACE 2024/07/24 09:41:27 GET https://ola.prod.code.seat.cloud.vwgroup.com/v2/users/{removed}/vehicles/{removed}/mycar
[cupra ] TRACE 2024/07/24 09:41:27 {"timestamp":"2024-07-24T07:41:27.559217308Z","path":"/v2/users/{removed}/vehicles/{removed}/mycar","status":404,"error":"Not Found","message":"No static resource v2/users/{removed}/vehicles/{removed}/mycar.","requestId":"828b0abc-9264007"}
[cupra ] TRACE 2024/07/24 09:42:27 GET https://ola.prod.code.seat.cloud.vwgroup.com/v2/users/{removed}/vehicles/{removed}/mycar
[cupra ] TRACE 2024/07/24 09:42:27 {"timestamp":"2024-07-24T07:42:27.506778529Z","path":"/v2/users/{removed}/vehicles/{removed}/mycar","status":404,"error":"Not Found","message":"No static resource v2/users/{removed}/vehicles/{removed}/mycar.","requestId":"b6240937-9272867"}

What type of operating system are you running?

Linux

Version

0.128.4

tgold avatar Jul 24 '24 07:07 tgold

Looks like api has changed. Does https://github.com/TA2k/ioBroker.vw-connect work for you?

andig avatar Jul 24 '24 08:07 andig

I don't have ioBroker so I am not able to test.

tgold avatar Jul 24 '24 08:07 tgold

Same issue here. While https://github.com/daernsinstantfortress/cupra_we_connect is still working, evcc is throwing 404 errors.

sebster6 avatar Jul 24 '24 13:07 sebster6

Unfortunately the git history is not easy to understand: https://github.com/daernsinstantfortress/cupra_we_connect/releases. Do you see where the fix was introduced or which api is used?

andig avatar Jul 24 '24 16:07 andig

Indeed, need to check https://github.com/daernsinstantfortress/WeConnect-Cupra-python which contains the actual code...

andig avatar Jul 24 '24 16:07 andig

Could it be these changes?

sebster6 avatar Jul 24 '24 16:07 sebster6

Falls es hilft, der ioBroker Adapter zeigt Verbindungsstatus = Grün also Okay an, aber der SOC stimmt nicht und auch der Timestamp ist alt. 15.06.2024 um genau zu sein.

JBufe avatar Jul 24 '24 17:07 JBufe

Habe seit heute auch das gleich Problem mit meinem Cupra Born. Interessant war das auch Tronity für ganz kurze Zeit heute morgen 0% angezeigt hat aber nach einer Stunde war dann wieder alles ok. Hat Cupra was verändert? Wäre cool wenn es jemand fixen könnte. Habe eben Eyond (nutze Eyond als Stromanbieter. Zur Zeit lade ich aber 100% über PV) gecheckt die nutzen Enode um die Daten auszulesen. Hier sieht alles normal aus. Der Ladestand stimmt mit dem Fahrzeug überein.

log: Draussen: vehicle soc: unexpected status: 404 (Not Found)

rainerme avatar Jul 24 '24 19:07 rainerme

Hi, same issue here: no vehicle SOC in EVCC. But in Tronity and in Home Assistant the SOC is available (and correct) Micha

quickmicha avatar Jul 25 '24 09:07 quickmicha

Hi. I’ve got the same issue running into the 404 error …. No soc

mafischerhei avatar Jul 25 '24 13:07 mafischerhei

Auch bei mir… kein SOC für meinen CUPRA Born mit 404 Fehler…

backbe avatar Jul 25 '24 16:07 backbe

Bei mir das Gleiche. Abhilfemaßnahmen, die früher mal funktionieren haben, wie Ab- und Anmelden in der Cupra App helfen dieses Mal nicht. Fahrzeug gelöscht und neu angelegt auch nicht.

digitalonkel avatar Jul 26 '24 06:07 digitalonkel

Auch bei mir… kein SOC für meinen CUPRA Born mit 404 Fehler…

rbeudel avatar Jul 26 '24 12:07 rbeudel

Vielleicht könnte in diesem Zusammenhang auch das Problem der fehlenden KM-Übermittlung an die Load-Session-DB gefixt werden? :)

MrSmashd avatar Jul 26 '24 13:07 MrSmashd

Was mir auch aufgefallen ist: Bei so einem Fehler geht EVCC davon aus, dass der SoC 0% ist. Wenn man eine Minimalladung konfiguriert hat lädt er dann immer das Auto voll, egal was sonst eingestellt ist. Sinnvoller wäre es, auf Gastfahrzeug zu wechseln. Das habe ich nun auch gemacht, dann verhält er sich bis auf das Zielladen wieder normal.

TazerReloaded avatar Jul 26 '24 16:07 TazerReloaded

Gleiches Problem hier. Kein soc. Homeassistant und cupra App zeigen korrekte Werte.

hazy66 avatar Jul 26 '24 19:07 hazy66

bei mir auch. Der ioB Adapter VW-Connect hingegen zeigt mir den korrekten SOC und Status verbunden an.

Auf das von TazorReloaded beschriebene Problem bin ich auch gestossen. Ich habe in evcc immer 30% Min SOC bei Ankunft eingestellt. Damit hat er mir heute den Born geladen. Ausgerechnet in der Strom-Hochpreisphase. Nicht so toll :-(

pustelbaer avatar Jul 26 '24 19:07 pustelbaer

Ich habe das selbe Problem auch schon zum wiederholten Mal mit EVCC. Wobei es in Homeassistant korrekt funktioniert.

Ich habe mir nun einen Workaround gebaut. Ich übergebe die Werte aus Homeassistant an EVCC. Somit wird das Cupra-API nur von Homeassistant abgefragt. Die Daten danach lokal verteilt. Falls es auch jemandem von euch hilft:

Wichtig: Homeassistant URL, Token und die Sensoren sind entsprechend euren Bedürfnissen anzupassen.

vehicles:
- type: custom
  name: Cupra
  title: Born
  icon: car
  capacity: 58
  phases: 3
  onIdentify:
    mode: pv
    mincurrent: 6
    maxcurrent: 16
  identifiers:
    - blue
  soc: # battery soc (%)
    source: http
    uri: 'https://homeassistant.local:8123/api/states'
    method: GET
    headers:
      - content-type: application/json
    auth:
      type: bearer
      password: [TOKEN]
    insecure: false
    jq: '.[] | select(.entity_id=="sensor.cupra_born_state_of_charge").state|tonumber'
    timeout: 5s
  range: # optional electric range (km)
    source: http
    uri: 'https://homeassistant.local:8123/api/states'
    method: GET
    headers:
      - content-type: application/json
    auth:
      type: bearer
      password: [TOKEN]
    insecure: false
    jq: '.[] | select(.entity_id=="sensor.cupra_born_range_in_kilometers").state|tonumber'
    timeout: 5s
  odometer:
    source: http
    uri: 'https://homeassistant.local:8123/api/states'
    method: GET
    headers:
      - content-type: application/json
    auth:
      type: bearer
      password: [TOKEN]
    insecure: false
    jq: '.[] | select(.entity_id=="sensor.cupra_born_odometer_in_kilometers").state|tonumber'
    timeout: 5s
  limitsoc: # SoC limit configured in vehicle (%) - to be verified
    source: http
    uri: 'https://homeassistant.local:8123/api/states'
    method: GET
    headers:
      - content-type: application/json
    auth:
      type: bearer
      password: [TOKEN]
    insecure: false
    jq: '.[] | select(.entity_id=="sensor.cupra_born_target_state_of_charge").state|tonumber
    timeout: 5s

Edit: typo sensor & battery capacity

vistalba avatar Jul 27 '24 10:07 vistalba

Same issue here.

dadaniel avatar Jul 27 '24 10:07 dadaniel

Ich habe das selbe Problem auch schon zum wiederholten Mal mit EVCC. Wobei es in Homeassistant korrekt funktioniert.

sehr cool. Danke.

Ist der SoC dann auch nutzbar für das Ladelimit dass ich in evcc einstellen kann? Oder eine reine Anzeige?

hazy66 avatar Jul 27 '24 10:07 hazy66