evcc-io / evcc

Solar Charging ☀️🚘
https://evcc.io
MIT License
3.63k stars 674 forks source link

BMW: start charge with 403 (Forbidden) #17196

Closed PVahldiek closed 1 week ago

PVahldiek commented 1 week ago

Describe the bug

Hi,

we are using evcc in the following setup:

When using the command evcc vehicle -a -l trace we get the following error:

[bmw   ] TRACE 2024/11/11 19:20:06 POST https://cocoapi.bmwgroup.com/eadrax-crccs/v1/vehicles/***/start-charging
[bmw   ] TRACE 2024/11/11 19:20:06 {"type":"https://tools.ietf.org/html/rfc9110#section-15.5.4","title":"Forbidden","status":403,"traceId":"xxx"}
[main  ] ERROR 2024/11/11 19:20:06 start charge: unexpected status: 403 (Forbidden)

This is only the last messages of the trace, the previous steps e.g GET https://cocoapi.bmwgroup.com/eadrax-vcs/v4/vehicles?apptimezone=120&appDateTime=1731349206091 works fine. This seems correlated with some bmw side api error and it seems that something is blocking from their side?

Do you have any idea why this happens? Also we don't see any change in the cars UI state, when plugging in the charger (see screenshot below). The log details (which is logged if we try to plugin the charger) is listed below, evcc is trying to wake up the car, but it can't. I'm not 100% sure but this might be related to the issue above.

image

Thank you in advance

Steps to reproduce

  1. Plug in charger into bmw and check vehicle status and logfile

Configuration details

interval: 30s # control cycle interval

sponsortoken: xxx

# 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: sma-hybrid
  id: 3
  host: xxx
  port: 502
  usage: pv
  modbus: tcpip
  name: pv1
- type: template
  template: sma-hybrid
  id: 3
  host: xxx
  port: 502
  usage: battery
  modbus: tcpip
  name: battery2
- type: template
  template: sma-home-manager
  usage: grid
  host: xxx
  name: grid3

chargers:
- type: template
  template: abl
  id: 1
  host: xxx
  port: 502
  modbus: rs485tcpip
  timeout: 10s
  name: wallbox5

vehicles:
- type: template
  template: bmw
  title: BMW i3
  user: xxx
  password: xxx
  vin: xxx
  capacity: xxx
  name: ev4

loadpoints:
- title: Garage
  charger: wallbox5
  vehicle: ev4
  mode: minpv

site:
  title: Mein Zuhause
  meters:
    grid: grid3
    pv:
    - pv1
    battery:
    - battery2

hems:
  type: sma
  AllowControl: false

Log details

[lp-1 ] DEBUG 2024/11/11 19:07:46 wake-up vehicle, attempts left: 0
[bmw ] TRACE 2024/11/11 19:07:46 POST https://cocoapi.bmwgroup.com/eadrax-vrccs/v3/presentation/remote-commands/***/door-lock
[bmw ] TRACE 2024/11/11 19:07:47 {"eventId":"xxx","creationTime":"2024-11-11T18:07:47.007444Z"}
[abl ] TRACE 2024/11/11 19:08:16 modbus: send ":0103002E0005C9\r\n"
[abl ] TRACE 2024/11/11 19:08:16 modbus: recv ">01030A2EB190640001000100011C\r\n"
[abl ] TRACE 2024/11/11 19:08:16 modbus: send ":0103002E0005C9\r\n"
[abl ] TRACE 2024/11/11 19:08:16 modbus: recv ">01030A2EB190640001000100011C\r\n"

What type of operating system are you running?

Linux

Nightly build

Version

evcc version 0.131.5

andig commented 1 week ago

Völlig unabhängig vom API: der i3 muss bei Verbindung laden, sonst startet er auch später die Ladung nicht. Dafür ist "Welcomecharge" vorgesehen und kann über das UI am Fahrzeug konfiguriert werden. Der Bedarf über das BMW API zu starten sollte sich damit erledigen.

andig commented 1 week ago

...und natürlich https://github.com/evcc-io/evcc/discussions/17213

PVahldiek commented 1 week ago

Danke für die Antworten. Offenbar sind wir nicht die einzigen mit dem Problem.

Den Tipp mit dem welcomecharge habe ich ausprobiert. Der o.g. Fehler mit 403 kommt nur, wenn ich das Auto per command evcc vehicle -a -l trace zu laden teste.

Das ist das vollständige Log inkl. Änderungen für welcomecharge. Startpunkt ist der Anschluss des Autos an die Wallbox. Interessant ist, dass er den wake up (für charger und vehicle) nicht hinbekommt, er versucht es 5 mal und scheitert dann. Dementsprechend schaltet er auch nie auf C. Kann das auch mit der modbus Kommunikation zusammenhängen? Ich sehe (bis auf den letzten /door-lock nichts in Bezug auf BMW), sehe aber auch keine konkrete Fehlermeldung. Habt ihr noch eine Idee?

[lp-1 ] INFO 2024/11/13 13:07:04 car connected
[lp-1 ] DEBUG 2024/11/13 13:07:04 pv timer elapse
[lp-1 ] DEBUG 2024/11/13 13:07:04 pv timer inactive
[abl ] TRACE 2024/11/13 13:07:04 modbus: send ":010300040001F7\r\n"
[abl ] TRACE 2024/11/13 13:07:04 modbus: recv ">01030204B145\r\n"
[abl ] TRACE 2024/11/13 13:07:04 modbus: send ":010300040001F7\r\n"
[abl ] TRACE 2024/11/13 13:07:04 modbus: recv ">01030204B145\r\n"
[lp-1 ] DEBUG 2024/11/13 13:07:04 vehicle status: A
[lp-1 ] DEBUG 2024/11/13 13:07:04 vehicle soc: 70%
[lp-1 ] DEBUG 2024/11/13 13:07:04 vehicle soc limit: 100%
[lp-1 ] DEBUG 2024/11/13 13:07:04 vehicle range: 144km
[abl ] TRACE 2024/11/13 13:07:04 modbus: send ":0103000F0005E8\r\n"
[abl ] TRACE 2024/11/13 13:07:04 modbus: recv ">01030A0F3F010B010B03E8010B95\r\n"
[abl ] TRACE 2024/11/13 13:07:04 modbus: send ":0103000F0005E8\r\n"
[abl ] TRACE 2024/11/13 13:07:04 modbus: recv ">01030A0F3F010B010B03E8010B95\r\n"
[lp-1 ] DEBUG 2024/11/13 13:07:04 pv charge current: min 6A > 0A (186W @ 3p, battery: false)
[abl ] TRACE 2024/11/13 13:07:04 modbus: send ":01100014000102006474\r\n"
[abl ] TRACE 2024/11/13 13:07:04 modbus: recv ">011000140001DA\r\n"
[abl ] TRACE 2024/11/13 13:07:04 modbus: send ":01100014000102006474\r\n"
[abl ] TRACE 2024/11/13 13:07:04 modbus: recv ">011000140001DA\r\n"
[lp-1 ] DEBUG 2024/11/13 13:07:04 max charge current: 6A
[abl ] TRACE 2024/11/13 13:07:04 modbus: send ":01100014000102006474\r\n"
[abl ] TRACE 2024/11/13 13:07:04 modbus: recv ">011000140001DA\r\n"
[abl ] TRACE 2024/11/13 13:07:04 modbus: send ":01100014000102006474\r\n"
[abl ] TRACE 2024/11/13 13:07:04 modbus: recv ">011000140001DA\r\n"
[lp-1 ] DEBUG 2024/11/13 13:07:04 charger enable
[lp-1 ] DEBUG 2024/11/13 13:07:04 wake-up timer: start
[lp-1 ] DEBUG 2024/11/13 13:07:25 set charge mode: now
[lp-1 ] DEBUG 2024/11/13 13:07:25 pv timer reset
[lp-1 ] DEBUG 2024/11/13 13:07:25 pv timer inactive
[abl ] TRACE 2024/11/13 13:07:25 modbus: send ":0103002E0005C9\r\n"
[abl ] TRACE 2024/11/13 13:07:25 modbus: recv ">01030A2EB190640001000100011C\r\n"
[abl ] TRACE 2024/11/13 13:07:25 modbus: send ":0103002E0005C9\r\n"
[abl ] TRACE 2024/11/13 13:07:26 modbus: recv ">01030A2EB190640001000100011C\r\n"
[lp-1 ] DEBUG 2024/11/13 13:07:26 charge power: 0W
[abl ] TRACE 2024/11/13 13:07:26 modbus: send ":0103002E0005C9\r\n"
[abl ] TRACE 2024/11/13 13:07:26 modbus: recv ">01030A2EB190640001000100011C\r\n"
[abl ] TRACE 2024/11/13 13:07:26 modbus: send ":0103002E0005C9\r\n"
[abl ] TRACE 2024/11/13 13:07:26 modbus: recv ">01030A2EB190640001000100011C\r\n"
[lp-1 ] DEBUG 2024/11/13 13:07:26 charge currents: [0 0 0]A
[lp-1 ] DEBUG 2024/11/13 13:07:26 vehicle odometer: 25871km
[abl ] TRACE 2024/11/13 13:07:26 modbus: send ":010300040001F7\r\n"
[abl ] TRACE 2024/11/13 13:07:26 modbus: recv ">01030204B145\r\n"
[abl ] TRACE 2024/11/13 13:07:26 modbus: send ":010300040001F7\r\n"
[abl ] TRACE 2024/11/13 13:07:26 modbus: recv ">01030204B145\r\n"
[lp-1 ] DEBUG 2024/11/13 13:07:26 charger status: B
[abl ] TRACE 2024/11/13 13:07:26 modbus: send ":0103000F0005E8\r\n"
[abl ] TRACE 2024/11/13 13:07:26 modbus: recv ">01030A0F3F010B010B00640064C4\r\n"
[abl ] TRACE 2024/11/13 13:07:26 modbus: send ":0103000F0005E8\r\n"
[abl ] TRACE 2024/11/13 13:07:26 modbus: recv ">01030A0F3F010B010B00640064C4\r\n"
[abl ] TRACE 2024/11/13 13:07:26 modbus: send ":01100014000102010ACD\r\n"
[abl ] TRACE 2024/11/13 13:07:26 modbus: recv ">011000140001DA\r\n"
[abl ] TRACE 2024/11/13 13:07:26 modbus: send ":01100014000102010ACD\r\n"
[abl ] TRACE 2024/11/13 13:07:26 modbus: recv ">011000140001DA\r\n"
[lp-1 ] DEBUG 2024/11/13 13:07:26 max charge current: 16A
[abl ] TRACE 2024/11/13 13:07:33 modbus: send ":0103002E0005C9\r\n"
[abl ] TRACE 2024/11/13 13:07:33 modbus: recv ">01030A2EB1910A00010001000175\r\n"
[abl ] TRACE 2024/11/13 13:07:33 modbus: send ":0103002E0005C9\r\n"
[abl ] TRACE 2024/11/13 13:07:33 modbus: recv ">01030A2EB1910A00010001000175\r\n"
[lp-1 ] DEBUG 2024/11/13 13:07:33 charge power: 0W
[abl ] TRACE 2024/11/13 13:07:33 modbus: send ":0103002E0005C9\r\n"
[abl ] TRACE 2024/11/13 13:07:33 modbus: recv ">01030A2EB1910A00010001000175\r\n"
[abl ] TRACE 2024/11/13 13:07:33 modbus: send ":0103002E0005C9\r\n"
[abl ] TRACE 2024/11/13 13:07:33 modbus: recv ">01030A2EB1910A00010001000175\r\n"
[lp-1 ] DEBUG 2024/11/13 13:07:33 charge currents: [0 0 0]A
[abl ] TRACE 2024/11/13 13:07:34 modbus: send ":010300040001F7\r\n"
[abl ] TRACE 2024/11/13 13:07:34 modbus: recv ">01030204B145\r\n"
[abl ] TRACE 2024/11/13 13:07:34 modbus: send ":010300040001F7\r\n"
[abl ] TRACE 2024/11/13 13:07:34 modbus: recv ">01030204B145\r\n"
[lp-1 ] DEBUG 2024/11/13 13:07:34 charger status: B
[abl ] TRACE 2024/11/13 13:07:34 modbus: send ":0103000F0005E8\r\n"
[abl ] TRACE 2024/11/13 13:07:34 modbus: recv ">01030A0F3F010B010B010A010A76\r\n"
[abl ] TRACE 2024/11/13 13:07:34 modbus: send ":0103000F0005E8\r\n"
[abl ] TRACE 2024/11/13 13:07:34 modbus: recv ">01030A0F3F010B010B010A010A76\r\n"
[abl ] TRACE 2024/11/13 13:08:03 modbus: send ":0103002E0005C9\r\n"
[abl ] TRACE 2024/11/13 13:08:03 modbus: recv ">01030A2EB1910A00010001000175\r\n"
[abl ] TRACE 2024/11/13 13:08:03 modbus: send ":0103002E0005C9\r\n"
[abl ] TRACE 2024/11/13 13:08:03 modbus: recv ">01030A2EB1910A00010001000175\r\n"
[lp-1 ] DEBUG 2024/11/13 13:08:03 charge power: 0W
[abl ] TRACE 2024/11/13 13:08:03 modbus: send ":0103002E0005C9\r\n"
[abl ] TRACE 2024/11/13 13:08:03 modbus: recv ">01030A2EB1910A00010001000175\r\n"
[abl ] TRACE 2024/11/13 13:08:03 modbus: send ":0103002E0005C9\r\n"
[abl ] TRACE 2024/11/13 13:08:03 modbus: recv ">01030A2EB1910A00010001000175\r\n"
[lp-1 ] DEBUG 2024/11/13 13:08:03 charge currents: [0 0 0]A
[abl ] TRACE 2024/11/13 13:08:04 modbus: send ":010300040001F7\r\n"
[abl ] TRACE 2024/11/13 13:08:04 modbus: recv ">01030204B145\r\n"
[abl ] TRACE 2024/11/13 13:08:04 modbus: send ":010300040001F7\r\n"
[abl ] TRACE 2024/11/13 13:08:04 modbus: recv ">01030204B145\r\n"
[lp-1 ] DEBUG 2024/11/13 13:08:04 charger status: B
[abl ] TRACE 2024/11/13 13:08:04 modbus: send ":0103000F0005E8\r\n"
[abl ] TRACE 2024/11/13 13:08:04 modbus: recv ">01030A0F3F010B010B010A010A76\r\n"
[abl ] TRACE 2024/11/13 13:08:04 modbus: send ":0103000F0005E8\r\n"
[abl ] TRACE 2024/11/13 13:08:04 modbus: recv ">01030A0F3F010B010B010A010A76\r\n"
[lp-1 ] DEBUG 2024/11/13 13:08:04 wake-up charger, attempts left: 5
[abl ] TRACE 2024/11/13 13:08:04 modbus: send ":01100005000102E0E027\r\n"
[abl ] TRACE 2024/11/13 13:08:04 modbus: recv ">011000050001E9\r\n"
[abl ] TRACE 2024/11/13 13:08:04 modbus: send ":01100005000102E0E027\r\n"
[abl ] TRACE 2024/11/13 13:08:04 modbus: recv ">011000050001E9\r\n"
[abl ] TRACE 2024/11/13 13:08:07 modbus: send ":01100005000102A1A1A5\r\n"
[abl ] TRACE 2024/11/13 13:08:07 modbus: recv ">011000050001E9\r\n"
[abl ] TRACE 2024/11/13 13:08:07 modbus: send ":01100005000102A1A1A5\r\n"
[abl ] TRACE 2024/11/13 13:08:07 modbus: recv ">011000050001E9\r\n"
[abl ] TRACE 2024/11/13 13:08:33 modbus: send ":0103002E0005C9\r\n"
[abl ] TRACE 2024/11/13 13:08:33 modbus: recv ">01030A2EB1910A00010001000175\r\n"
[abl ] TRACE 2024/11/13 13:08:33 modbus: send ":0103002E0005C9\r\n"
[abl ] TRACE 2024/11/13 13:08:33 modbus: recv ">01030A2EB1910A00010001000175\r\n"
[lp-1 ] DEBUG 2024/11/13 13:08:33 charge power: 0W
[abl ] TRACE 2024/11/13 13:08:33 modbus: send ":0103002E0005C9\r\n"
[abl ] TRACE 2024/11/13 13:08:33 modbus: recv ">01030A2EB1910A00010001000175\r\n"
[abl ] TRACE 2024/11/13 13:08:33 modbus: send ":0103002E0005C9\r\n"
[abl ] TRACE 2024/11/13 13:08:33 modbus: recv ">01030A2EB1910A00010001000175\r\n"
[lp-1 ] DEBUG 2024/11/13 13:08:33 charge currents: [0 0 0]A
[abl ] TRACE 2024/11/13 13:08:34 modbus: send ":010300040001F7\r\n"
[abl ] TRACE 2024/11/13 13:08:34 modbus: recv ">01030204B145\r\n"
[abl ] TRACE 2024/11/13 13:08:34 modbus: send ":010300040001F7\r\n"
[abl ] TRACE 2024/11/13 13:08:34 modbus: recv ">01030204B145\r\n"
[lp-1 ] DEBUG 2024/11/13 13:08:34 charger status: B
[abl ] TRACE 2024/11/13 13:08:34 modbus: send ":0103000F0005E8\r\n"
[abl ] TRACE 2024/11/13 13:08:34 modbus: recv ">01030A0F3F010B010B010A010A76\r\n"
[abl ] TRACE 2024/11/13 13:08:34 modbus: send ":0103000F0005E8\r\n"
[abl ] TRACE 2024/11/13 13:08:34 modbus: recv ">01030A0F3F010B010B010A010A76\r\n"
[abl ] TRACE 2024/11/13 13:09:03 modbus: send ":0103002E0005C9\r\n"
[abl ] TRACE 2024/11/13 13:09:03 modbus: recv ">01030A2EB1910A00010001000175\r\n"
[abl ] TRACE 2024/11/13 13:09:03 modbus: send ":0103002E0005C9\r\n"
[abl ] TRACE 2024/11/13 13:09:03 modbus: recv ">01030A2EB1910A00010001000175\r\n"
[lp-1 ] DEBUG 2024/11/13 13:09:03 charge power: 0W
[abl ] TRACE 2024/11/13 13:09:03 modbus: send ":0103002E0005C9\r\n"
[abl ] TRACE 2024/11/13 13:09:03 modbus: recv ">01030A2EB1910A00010001000175\r\n"
[abl ] TRACE 2024/11/13 13:09:03 modbus: send ":0103002E0005C9\r\n"
[abl ] TRACE 2024/11/13 13:09:03 modbus: recv ">01030A2EB1910A00010001000175\r\n"
[lp-1 ] DEBUG 2024/11/13 13:09:03 charge currents: [0 0 0]A
[abl ] TRACE 2024/11/13 13:09:04 modbus: send ":010300040001F7\r\n"
[abl ] TRACE 2024/11/13 13:09:04 modbus: recv ">01030204B145\r\n"
[abl ] TRACE 2024/11/13 13:09:04 modbus: send ":010300040001F7\r\n"
[abl ] TRACE 2024/11/13 13:09:04 modbus: recv ">01030204B145\r\n"
[lp-1 ] DEBUG 2024/11/13 13:09:04 charger status: B
[abl ] TRACE 2024/11/13 13:09:04 modbus: send ":0103000F0005E8\r\n"
[abl ] TRACE 2024/11/13 13:09:04 modbus: recv ">01030A0F3F010B010B010A010A76\r\n"
[abl ] TRACE 2024/11/13 13:09:04 modbus: send ":0103000F0005E8\r\n"
[abl ] TRACE 2024/11/13 13:09:04 modbus: recv ">01030A0F3F010B010B010A010A76\r\n"
[lp-1 ] DEBUG 2024/11/13 13:09:04 wake-up vehicle, attempts left: 4
[bmw ] TRACE 2024/11/13 13:09:04 POST https://cocoapi.bmwgroup.com/eadrax-vrccs/v3/presentation/remote-commands/*/door-lock
[bmw ] TRACE 2024/11/13 13:09:04 {"eventId":"xxx","creationTime":"2024-11-13T12:09:04.596986Z"}
[abl ] TRACE 2024/11/13 13:09:33 modbus: send ":0103002E0005C9\r\n"
[abl ] TRACE 2024/11/13 13:09:33 modbus: recv ">01030A2EB1910A00010001000175\r\n"
[abl ] TRACE 2024/11/13 13:09:33 modbus: send ":0103002E0005C9\r\n"
[abl ] TRACE 2024/11/13 13:09:33 modbus: recv ">01030A2EB1910A00010001000175\r\n"
[lp-1 ] DEBUG 2024/11/13 13:09:33 charge power: 0W

Danke für die Hilfe.

andig commented 1 week ago

Offenbar sind wir nicht die einzigen mit dem Problem.

Die BMW Fehler waren gestört. Das machen sie nicht selektiv für Dich...

When using the command evcc vehicle -a -l trace we get the following error:

Geht bei meinem i3 ohne Fehler.

Kann das auch mit der modbus Kommunikation zusammenhängen?

Nein

Den Tipp mit dem welcomecharge habe ich ausprobiert.

Damit sollte das Auto bei Ladefreigabe auch aufwachen. Mein i3 tut das.

Dementsprechend schaltet er auch nie auf C.

Das sollte nicht sein. Aber am Ende können wir es auch nicht ändern. Wenn Dein Auto bei Ladefreigabe der WB nicht aufwacht musst Du dich bitte an BMW wenden. BMW ist herzlich willkommen uns eine dokumentierte Schnittstelle anzubieten.

er versucht es 5 mal und scheitert dann.

Das Log zeigt kein scheitern.

Long story short: hier gibts leider nix was wir tun können :(