BMW/Mini new cloud access restrictions
Describe the bug
Hi,
I just received a notification within the myBMW app (attached). It seems like, this is in effect already now:
Steps to reproduce
Configure a BMW vehicle
Configuration details
BMW
Log details
no log entries
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
0.208.1
Just for completeness, also relevant for template mini.
Thanks! Now we know why BMW/Mini isn't working anymore since today - See https://github.com/evcc-io/evcc/discussions/23677
It has not been working for a long time or really only with horrible hcaptcha "process". We should be able to find a somewhat-working solution using the BMW EU data act streaming interface, but that will take some time to implement.
At least it seems that there is an API in place which should work for a project like EVCC. The customer has to generate their own API token within the bmw/mini connected portal and EVCC could use it. EVCC unlike the other companys does not want to get my data. It's just me wanting my own data (requesting from my own server) using code provided by EVCC. So from my understanding there is no need for EVCC to register at the BMW Aftersales Portal. It's "only" a REST API.
https://bmw-cardata.bmwgroup.com/customer/public/api-documentation/Id-Introduction
Side note: You can also see the difference in the links to the APIs. The one is /customer/ while the other is /thirdparty/ https://bmw-cardata.bmwgroup.com/thirdparty/public/car-data/technical-configuration/api-documentation
Looks like the first libraries to use the streaming mqtt API are available https://github.com/whi-tw/bmw-cardata-streaming-poc?tab=readme-ov-file
Maybe this helps to implement the interface.
There is also a first home assistant integration using the API https://github.com/JjyKsi/bmw-cardata-ha
Maybe it helps as an intermediate solution.
I was just informed that everything is already covered here: #23684
Here is a description of the authentication flow and how to connect through mqtt https://github.com/whi-tw/bmw-cardata-streaming-poc/blob/main/AUTHENTICATION.md
In the corresponding home assistant issue, people were also successful using mqtt, see https://github.com/home-assistant/core/issues/138976#issuecomment-3349037888
There is also a first home assistant integration using the non-streaming API https://github.com/JjyKsi/bmw-cardata-ha
Maybe it helps as an intermediate solution.
Just tried this out and at least some sensors are showing up. 👍🏻
Opened a ticket with mini connect.
I got no upfront information. And I see EVCC not as 3rd part solution, because we host it on our own hardware and configure ourselves. Let's look forward how we can overcome the situation.
The MQTT API works like a charm
The relevant data points that I got working are
- vehicle.vehicle.travelledDistance
- vehicle.vehicle.preConditioning.activity (INACTIVE, HEATING, COOLING?)
- vehicle.powertrain.tractionBattery.charging.port.anyPosition.isPlugged
- vehicle.drivetrain.electricEngine.charging.status (NOCHARGING, INITIALIZATION, CHARGINGACTIVE, CHARGINGPAUSED, CHARGINGENDED, CHARGINGERROR)
- vehicle.drivetrain.batteryManagement.header (SoC)
- vehicle.drivetrain.electricEngine.kombiRemainingElectricRange
Updates are immediate, but when nothing is ongoing, the client does not receive anything. To get an initial state, the non-streaming API needs to be used as it seems.
I can confirm this. Will be added to evcc asap.
Yes, the "only" issue is that the SoC will not get updated regularly during charging - based on the feedbacks so far. That's why in the Home Assistant Integration it was created a sensor for the extrapolated SoC. (but in evcc that is already existing anyway).
In the integration the idea is to add the API poll on a regular base, seems this is triggering an update of the MQTT messages.
Evcc does extrapolation anyhow.
I connected it now to evcc through the home assistant api. Will do some tests to see how it performs.
Zumindest scheint es, dass es eine API gibt, die für ein Projekt wie EVCC funktionieren sollte. Der Kunde muss sein eigenes API-Token innerhalb des mit bmw/mini verbundenen Portals generieren und EVCC könnte es verwenden. EVCC möchte im Gegensatz zu den anderen Unternehmen meine Daten nicht erhalten. Ich möchte lediglich meine eigenen Daten (die ich von meinem eigenen Server anfordere) mithilfe des von EVCC bereitgestellten Codes. Nach meinem Verständnis ist es also nicht erforderlich, dass sich EVCC beim BMW Aftersales Portal registriert. Es ist „nur“ eine REST-API.
https://bmw-cardata.bmwgroup.com/customer/public/api-documentation/Id-Introduction
Randbemerkung: Sie können den Unterschied auch in den Links zu den APIs sehen. Der eine ist /Kunde/ während der andere ist /dritte Seite/ https://bmw-cardata.bmwgroup.com/thirdparty/public/car-data/technical-configuration/api-documentation
Leider schaffe ich es nicht eine API zu erstellen, wir haben zwei verschiedene Accounts mit zwei verschiedenen i4.
Ich kann auf CardDataClient erstellen klicken, dann muss man ja die zwei Regler auf der rechten Seite aktivieren, diese gehen nach ein paar Sekunden wieder aus und oben auf der Seite erscheint ein rotes Feld mit einem Error, man soll sich mit einem Code an die Kundenbetreuung wenden, hat es schon jemand geschafft und kann mir erklären wie?
Danke im Vorraus
Works quite well with the home assistant addon, but the soc is not updated often
First one is the mqtt soc, second the charge power, third the extrapolated evcc soc.
Ich kann auf CardDataClient erstellen klicken, dann muss man ja die zwei Regler auf der rechten Seite aktivieren, diese gehen nach ein paar Sekunden wieder aus und oben auf der Seite erscheint ein rotes Feld mit einem Error, man soll sich mit einem Code an die Kundenbetreuung wenden, hat es schon jemand geschafft und kann mir erklären wie?
Hatte keinerlei Probleme mit unserem i4. Mit " zwei Regler auf der rechten Seite" meinst du das, was man in https://bmw-cardata.bmwgroup.com/customer/public/api-documentation/Id-Technical-registration_Step-2 sieht?
Ich kann auf CardDataClient erstellen klicken, dann muss man ja die zwei Regler auf der rechten Seite aktivieren, diese gehen nach ein paar Sekunden wieder aus und oben auf der Seite erscheint ein rotes Feld mit einem Error, man soll sich mit einem Code an die Kundenbetreuung wenden, hat es schon jemand geschafft und kann mir erklären wie?
Hatte keinerlei Probleme mit unserem i4. Mit " zwei Regler auf der rechten Seite" meinst du das, was man in https://bmw-cardata.bmwgroup.com/customer/public/api-documentation/Id-Technical-registration_Step-2 sieht?
Also die Checkboxes/Schalter für "Request access to CarData API" und "CarData Stream" - ja, da kommt bei mir auch ein Fehler.
Ich kann auf CardDataClient erstellen klicken, dann muss man ja die zwei Regler auf der rechten Seite aktivieren, diese gehen nach ein paar Sekunden wieder aus und oben auf der Seite erscheint ein rotes Feld mit einem Error, man soll sich mit einem Code an die Kundenbetreuung wenden, hat es schon jemand geschafft und kann mir erklären wie?
Hatte keinerlei Probleme mit unserem i4. Mit " zwei Regler auf der rechten Seite" meinst du das, was man in https://bmw-cardata.bmwgroup.com/customer/public/api-documentation/Id-Technical-registration_Step-2 sieht?
Also die Checkboxes/Schalter für "Request access to CarData API" und "CarData Stream" - ja, da kommt bei mir auch ein Fehler.
Da bin ich ja froh nicht der einzige zu sein. Vorübergehend habe ich gerade meinen BMW bei evcc über Tronity eingebunden, wusste nicht das es diese option gibt, nun warten wir mal bis evcc weiter kommt und dann schauen wir mal
Ich kann auf CardDataClient erste klicken, dann muss man ja die zwei Regler auf der rechten Seite aktivieren, diese gehen nach einem Paar Sekunden wieder aus und oben auf der Seite erscheint ein rotes Feld mit einem Fehler, man soll sich mit einem Code an die Kundenbetreuung wenden, hat es schon gesagt geschafft und kann mir erklären wie?
Hatte keinelei Probleme mit unserem i4. Mit "zwei Regler auf der rechten Seite" meinst du das, war Mann in https://bmw-cardata.bmwgroup.com/customer/public/api-documentation/Id-Technical-registration_Step-2 sieht?
ja genau das meinte ich, ich kann die zwei "Schalter" aktivieren und dann ein paar sekunden später gehen sie wieder aus und oben auf der Website kommt ein fehlercode mit welchem man sich an die Kundenbetreuung wenden soll. Hab das mit zwei unabhängigen Accounts probiert
https://bmw-cardata.bmwgroup.com/customer/public/api-documentation/Id-Introduction