VW: token refresh doesn't work
Describe the bug
As reported by @TobiasHuber1980.
Steps to reproduce
- Set up VW connection
- wait a few hours
- data stops being updated, errors are logged
Configuration details
none
Log details
[id ] TRACE 2025/11/25 21:08:53 GET https://emea.bff.cariad.digital/user-login/refresh/v1
[id ] TRACE 2025/11/25 21:08:53 { "servlet":"org.glassfish.jersey.servlet.ServletContainer-543b855", "message":"Scopes [openid, profile, email] do not match required scopes [openid, profile, badge, cars, dealers, vin]", "url":"/refresh/v1", "status":"400" }
[id ] TRACE 2025/11/25 21:08:53 GET https://emea.bff.cariad.digital/user-login/refresh/v1
[id ] TRACE 2025/11/25 21:08:54 { "servlet":"org.glassfish.jersey.servlet.ServletContainer-4353230", "message":"Scopes [openid, profile, email] do not match required scopes [openid, profile, badge, cars, dealers, vin]", "url":"/refresh/v1", "status":"400" }
[id ] TRACE 2025/11/25 21:08:54 GET https://emea.bff.cariad.digital/user-login/refresh/v1
[id ] TRACE 2025/11/25 21:08:54 { "servlet":"org.glassfish.jersey.servlet.ServletContainer-543b855", "message":"Scopes [openid, profile, email] do not match required scopes [openid, profile, badge, cars, dealers, vin]", "url":"/refresh/v1", "status":"400" }
What type of operating system or environment does evcc run on?
Linux
External automation
- [x] I have made sure that no external automation like HomeAssistant or Node-RED is active or accessing any of the mentioned devices when this issue occurs.
Nightly build
- [x] I have verified that the issue is reproducible with the latest nightly build
Version
No response
Try just removing the email scope then. To test, force a refresh by settings token.Expiry = time.Time{} after initial token exchange.
I'm following a completely different approach (by investigating what other libs do). Not sure yet if that's a clever way, because the process seems to use legacy endpoints for refreshing. We're not requesting scopes anywhere, so I'm not quite sure where to change that yet...
Do an http trace of the flow and look what's different- that's usually the best way.
Die id Integration ist komplett kaputt. Ein Login selbst endet auch nur mit " creating vehicle XYZ failed: cannot create vehicle type 'template': cannot create vehicle type 'vw': form not found"
Wenn ich mich recht erinnere, war der Login auf der Volkswagen Seite früher (bis kürzlich) in dieser unnötigen und nervigen 2-Schritt-Logik, erst nur Eingabe der E-Mail-Adresse, und dann weiter zur nächsten Seite und dann das Passwort. Der Blödsinn ist jetzt weg, die Webseite hat User+Passwort direkt in einem Schritt:
@allcoolusernamesaregone Dein Problem ist in der nightly-Version schon behoben (siehe #25399). Das hier ist ein Folgeproblem.
http trace of the flow and look what's different
That’s what I usually do, but the problem is: what should be my reference? The app does certificate pinning since a few versions ago. Not unsolvable but definitely a hurdle. And tracing other integrations would have the same issue that is assumed: following a legacy way to do the refresh which might soon be obsolete, causing the next break.
I'll be unavailable to work on this until tomorrow evening... this is my current status: https://github.com/oliverrahner/evcc/tree/fix/vw_refresh
for me it looks like there are two ways: in the UI in the Car on "prüfen" i get a success. The "normal" Request in the logs show me
jobs=charging,fuelStatus,climatisation,measurements": unexpected status: 400 (Bad Request)
Guten Morgen.
Sorry, mein Englisch ist nicht so gut. Habe auch bei unseren e Up mit token von @andig das Problem, dass der soc nicht abgerufen wird seit drei Tagen. Da war das Problem:
rror from EVCC: 2025/11/25 17:34:16 rpc error: code = Unknown desc = cannot create vehicle type 'vw': form not found (LV0) 2025-11-25 17:34:10: PID: 21072: Lp1: Requesting SoC (LV0) 2025-11-25 17:32:25: PID: 19542: Lp1: Charging, but nothing to do yet. Incrementing timer. (LV0) 2025-11-25 17:30:53: PID: 17930: Lp1: Error from EVCC: 2025/11/25 17:30:53 rpc error: code = Unknown desc = cannot create vehicle type 'vw': form not found (LV0) 2025-11-25 17:30:47: PID: 17930: Lp1: Requesting SoC (LV0)
Jetzt steht:
2025-11-27 07:21:31: PID: 7793: Lp1: Nothing to do yet. Incrementing timer. (LV0) 2025-11-27 07:20:29: PID: 6375: Lp1: Nothing to do yet. Incrementing timer. (LV0) 2025-11-27 07:19:18: PID: 4734: Lp1: Error from EVCC: 2025/11/27 07:19:18 rpc error: code = Unavailable desc = connection error: desc = "error reading server preface: read tcp [2003:cb:3f4a:6a25:7833:151c:861f:fcc1]:39434->[2a09:8280:1::6:621]:8080: use of closed network connection" (LV0) 2025-11-27 07:18:57: PID: 4734: Lp1: Requesting SoC (LV0)
Soc wird weiterhin nicht aktualisiert in Openwb, in der vw App klappts. Kann mir jemand sagen, was ich tun kann, um das Problem zu beheben?
Vielen Dank, VG Kilian
Infolgedessen wurde der vorgegebene Ziel-Ladestand heute überschritten, sodass der Wagen vollständig auf 100% geladen wurde. Es wäre ggf. noch sinnvoll, die Fortsetzung des Ladevorgangs von der Existenz des aktuellen Ladestandes des Fahrzeugs abhängig zu machen, um ein unkontrolliertes Überladen über das festgelegte Limit hinaus zu verhindern.
maybe completely unrelated and if so can just be ignored...
[main ] ERROR 2025/11/27 11:56:30 creating vehicle car2 failed: cannot create vehicle type 'template': cannot create vehicle type 'peugeot': token expired
I'm seeing expired tokens for Peugeot as well even though it shouldn't have happened I think. (https://github.com/evcc-io/evcc/discussions/25628)
Wenn man per VW App den max Ladestand einstellt, läd es ja nur bis dahin. Also da kann man sich dann schon mal helfen oder sehe ich da was falsch. Werde heute Nacht auch mal laden müssen.
for me it looks like there are two ways: in the UI in the Car on "prüfen" i get a success. The "normal" Request in the logs show me
jobs=charging,fuelStatus,climatisation,measurements": unexpected status: 400 (Bad Request)
ERROR 2025/11/26 17:53:48 vehicle soc: Get "https://emea.bff.cariad.digital/vehicle/v1/vehicles/nnn/selectivestatus?jobs=charging,fuelStatus,climatisation,measurements": unexpected status: 400 (Bad Request)
When I run this directly in the browser, it looks like this:
{"error":{"message":"Bad Request","info":"missing or invalid auth header"}}
@andig token refreshen bringt leider keine Verbesserung. Geht immer noch nicht.
Mit was testest du? Es gibt ja nicht einmal ein nightly. Wenn morgen früh das nightly verfügbar ist kannst du damit testen oder mit dem nächsten release...
Ah OK. Ich dachte, ich soll nur das token refreshen und dann sollte es wieder gehen. Sorry, ich bin da technisch nicht so fit.
Running 8fb8cee72 (compiled from source) since midnight, after about an hour of charging today:
[id ] TRACE 2025/11/28 11:46:14 GET https://emea.bff.cariad.digital/vehicle/v1/vehicles/<VIN>/selectivestatus?jobs=charging,fuelStatus,climatisation,measurements
[id ] TRACE 2025/11/28 11:46:14 {"error":{"message":"Unauthorized","info":"token is expired"}}
[lp-1 ] WARN 2025/11/28 11:46:14 vehicle soc: unexpected status: 401 (Unauthorized) (ignored by estimator)
[lp-1 ] DEBUG 2025/11/28 11:46:14 soc estimated: 44.99% (vehicle: 40.00%)
[lp-1 ] DEBUG 2025/11/28 11:46:14 vehicle soc: 45%
[lp-1 ] ERROR 2025/11/28 11:46:14 vehicle range: unexpected status: 401 (Unauthorized)
Gleiche Fehlermeldung hier! Problem scheint noch nicht 100% gefixt!
Tatsache, auch mit nightly 1842 bekomme ich diese Meldung.
[lp-1 ] DEBUG 2025/11/28 17:00:12 charge power: 0W
[lp-1 ] DEBUG 2025/11/28 17:00:12 charge currents: [0.07 0 0]A
[lp-1 ] DEBUG 2025/11/28 17:00:12 charger status: A
[id ] TRACE 2025/11/28 17:00:12 GET https://emea.bff.cariad.digital/vehicle/v1/vehicles/***/selectivestatus?jobs=charging,fuelStatus,climatisation,measurements
[id ] TRACE 2025/11/28 17:00:12 {"error":{"message":"Unauthorized","info":"token is expired"}}
[lp-1 ] WARN 2025/11/28 17:00:12 vehicle soc: unexpected status: 401 (Unauthorized) (ignored by estimator)
[lp-1 ] DEBUG 2025/11/28 17:00:12 soc estimated: 56.00% (vehicle: 56.00%)
[lp-1 ] DEBUG 2025/11/28 17:00:12 vehicle soc: 56%
[lp-1 ] ERROR 2025/11/28 17:00:12 vehicle range: unexpected status: 401 (Unauthorized)
[lp-1 ] DEBUG 2025/11/28 17:00:27 charge power: 0W
[lp-1 ] DEBUG 2025/11/28 17:00:27 charge currents: [0.07 0 0]A
Der Skoda Citigo hingegen sieht gut aus.
[lp-2 ] DEBUG 2025/11/28 17:01:27 charge total import: 1566.451kWh
[lp-2 ] DEBUG 2025/11/28 17:01:27 charger status: A
[skoda ] TRACE 2025/11/28 17:01:27 GET https://mysmob.api.connect.skoda-auto.cz/api/v1/charging/***
[skoda ] TRACE 2025/11/28 17:01:28 {"isVehicleInSavedLocation":false,"status":{"remainingTimeToFullyChargedInMinutes":40,"state":"CONNECT_CABLE","battery":{"remainingCruisingRangeInMeters":109000,"stateOfChargeInPercent":71}},"settings":{"availableChargeModes":[],"maxChargeCurrentAc":"MAXIMUM","maxChargeCurrentAcAmpere":32},"carCapturedTimestamp":"2025-11-28T13:37:31Z","errors":[{"type":"CARE_MODE_IS_NOT_AVAILABLE","description":"Care mode is not available."},{"type":"AUTO_UNLOCK_IS_NOT_AVAILABLE","description":"Auto unlock is not available."},{"type":"CHARGE_LIMIT_IS_NOT_AVAILABLE","description":"Charge limit is not available."}]}
[lp-2 ] DEBUG 2025/11/28 17:01:28 soc estimated: 71.00% (vehicle: 71.00%)
[lp-2 ] DEBUG 2025/11/28 17:01:28 vehicle soc: 71%
Ich habe 4x ID in evcc, beim starten werden meistens nur zwei oder drei Autos erkannt. Ich habe den Code mal um einen rate limiter für den login erweitert, die ergebnisse waren nicht konsistent.
Klickt man um UI auf prüfen, wird das Auto erkannt - aber man muss dann rebooten und es ist ein anderes Auto nicht mehr erreichbar.
Trace-Log im Anhang.
evcc-20251128-175227-trace.log evcc-20251128-175356-trace.log
@andig ich kann dir credentials / evcc.db zukommen lassen.