Hi, just stumbled on this MB developer documentation for which I did not see any mention before, so I thought I’d share this here: Mercedes‑Benz /developers – The API platform by Mercedes‑Benz
Yeah, this is a B2B api and not B2C (and very limited) - take a search here - this was discussed multiple times… As long as MB does no provide a good B2C API, I will not invest time in it…
Let me give you an update, I’m still analyzing it and puzzling on a solution.
What I understood so far:
- (rule 1) we have the old web socket connection throttling -->18-20h web socket usage per day per account
- (rule 2) a new policy is active since last Wednesday, whenever a web socket channel is opened to often (amount unknown, but much lower than what I build to prevent rule 1) the user context (access, refresh token) gets blocked for ?24? hours
Ideas:
see here for details
In case one of the techies here has other ideas, let me know
Just posting here maybe limit tthe number of connections or API requests like Daikin is doing, not sure if it will help…
I have published a pre-release “v0.27.0-beta.1 - HTTP429 - Read the release notes…”. You can install it via HACS, select the component and use the menu to Redownload and select the specific version.
Pre-release Notice
This is a pre-release version. Please expect potential bugs. Enable debug logging if errors occur, and report issues by creating a new GitHub issue with as much relevant information as possible.
Short Testing Cycle
This version has undergone only a very limited testing period. It is not recommended for use in production environments.
Breaking Changes
1. HTTP 429 Errors
- Mercedes-Benz recently introduced changes to the backend API, resulting in rate limits for certain resources (e.g., real-time updates). This required new token generation on a daily basis.
- To address this, a new login flow using your Mercedes-Benz username and password was implemented. These credentials are now used to recover automatically from such issues.
- Action required: After updating, restart Home Assistant and reauthenticate using your MB account credentials.
- The token creation tool is no longer needed.
- Note: HTTP 429 errors may still occur once per day. When this happens, a new login and automatic reload of the component will be triggered to return it to a valid state.
2. China Region Removed
- The China region has been removed from the configuration dialog.
- The last known working version for China is v0.22. You can download this version via HACS.
- If you’d like to contribute to the continued development for the China region, please refer to issue #339.
Other Fixes
- Resolved an issue where the recorder component could log errors such as:
ERROR (Recorder) [homeassistant] Error doing job: Task was destroyed but it is pending!...
(Occurred in rare scenarios.) - Adjusted the default precision for tire pressure sensors to
0.0
for better compatibility with Bar units.
(This is still a work in progress and will be further refined.)
Chore
- Two new sensors for monitoring the WebSocket connection are now available.
These are disabled by default — enable them via the integration settings page if needed.
Acknowledgements
Thanks for your patience and support.
Special thanks to the new sponsors, everyone who starred the repository, and all contributors!
So far, the pre-release component is working fine, thanks a lot, Rene.
It’s sad that there have been such major changes on the part of MB and it’s not easy to adapt the component. Is there any way to contact MB dev support? The HA user community is quite large now, maybe there is someone from MB among us who has a better overview of this service and can contribute to the development of the integration.
I’m complaining a little bit, not about the component, but about the latest changes in entity names, organized in HA. It took me 10 minutes to find these sensors, and after activating them, I couldn’t find them again. I’ll make someone’s job easier, so here are these entities, and you can use them directly in the entity search.
sensor.websocket_connections_today
sensor.websocket_online_today
Running the latest beta now. Seems to work, but I found following log entry already:
Logger: homeassistant
Source: runner.py:112
First occurred: 16:32:33 (2 occurrences)
Last logged: 16:32:33
Error doing job: Task was destroyed but it is pending! (<Task pending name='Task-606' coro=<Websocket._start_queue_handler() running at /config/custom_components/mbapi2020/websocket.py:184> wait_for=<Future pending cb=[Task.task_wakeup()]> cb=[gather.<locals>._done_callback() at /usr/local/lib/python3.13/asyncio/tasks.py:820]>)
Error doing job: Task was destroyed but it is pending! (<Task pending name='Task-605' coro=<MBAPI2020DataUpdateCoordinator.ws_connect() running at /config/custom_components/mbapi2020/coordinator.py:64> wait_for=<_GatheringFuture pending cb=[Task.task_wakeup()]>>)
@VietNgoc : You should complain about the component. My mistake, missed to create an “account” device and linking the sensors to it… its on my list now…
v0.26.x will not work anymore since this morning.
I have published a new beta: v027.0-beta.2
New fixes in beta-2:
- Multiple errors
Error doing job: Task was destroyed but it is pending!
are logged (this was a complex change and therefor I decided to publish an additional beta version - will I ever understand this asyncio-stuff in python…???) - The first Http429 is logged as a warning instead of an error. (in case re-login does not solve the problem, all other 429 are logged as error.) - makes it easier to get a notification or react with an automation… (more for me and my development workflows…)
New features in beta-2:
- The new web-socket sensors are bound to a new “account” device to find them more easily esp. with the HA frontend changes in 2025.07. (the sensors out of beta.1 get deleted on first start and you need to enable them again if needed)
Thanks Rene, beta.2 works perfectly
It is done. I have published v0.27.0… Please check the release notes…
The release has the title “What a week…”…
This was an intensive week, more or less working full-time to get the component back on track… but here is the release…
Breaking Changes
1. HTTP 429 errors
- Mercedes-Benz recently introduced changes to the backend API, resulting in rate limits for certain resources (e.g., real-time updates). This required new token generation on a daily basis.
- To address this, a new login flow using your Mercedes-Benz username and password was implemented. These credentials are now used to recover automatically from such issues.
- Action required: After updating, restart Home Assistant and reauthenticate using your MB account credentials.
- The token creation tool is no longer needed.
- Note: a HTTP 429 warning may still occur once per day. When this happens, a new login and automatic reload of the component will be triggered to return it to a valid state.
- Important: MFA is not supported and will not work.
2. China Region Removed
- The China region has been removed from the configuration dialog.
- The last known working version for China is v0.22. You can download this version via HACS.
- If you’d like to contribute to the continued development for the China region, please refer to issue #339.
Other Fixes
-
Resolved an issue where the recorder component could log errors such as:
ERROR (Recorder) [homeassistant] Error doing job: Task was destroyed but it is pending!...
(Occurred in rare scenarios.) -
Adjusted the default precision for tire pressure sensors to
0.0
for better compatibility with Bar units.
(This is still a work in progress and will be further refined.)
Chore
- A Http 418 I’m not a teapot error was thrown since this Thursday morning. This is solved too…
Changes after the beta phase:
Thanks to all the beta testers: I’ve removed the web socket sensors as this needs some more rework and has a lower priority. Please delete the old sensors (or just ignore it…)
Acknowledgements
Thanks for your patience and support.
Special thanks to the new sponsors, everyone who starred the repository, and all contributors in the beta phase - you helped a lot!
Thank you so much for the effort to fix this nuisance!
@alexr544 : This log entry is from Jul-7 and the latest release was on Jul-11th - so not related to the last update - but yes, some others are seeing this even with the latest update. Analysis ongoing…
Thanks. Thought i updated. Then did right after i posted this. Then started getting this. Did confirm my credentials are correct. As well as the VIN and code.
Its working for me now. Sorry for the trouble.
Was my own stupidity and i chalk it up to old person vision
I put my VIN in the config thinking it needed it in the config. When all it did need was the pin and by me putting the VIN i excluded it.
Thanks a lot for the quick help, everything’s working great. My only worry is that all these ‘new devices’ showing up with each login might trigger some kind of alert on Mercedes side and they could end up blocking the account.
Sorry for beeing off topic, but I’m experiencing the same problem on Android…
Is IOS working already?
I’m not getting any feedback from ME support…
Hey @Amistad, are other services like “window open” working? If not, did you try to logoff and login again in the official app. Based on my tests, the app has the same blocking problems like this component and can’t reauthenticate to the websocket (the tunnel that is used to execute the command)
If yes, try to disable/enable the digital services in the app. This helps sometimes.
I have published a bugfix release v0.27.1:
Fixes after v0.27.0
- Different login errors when a blocking happens two times per day or multiple accounts are configured
- Websocket was not closed if the ignitions status of an excluded car was “on”
- FIN/VIN was not masked in the debug log output
This bugfixes should stabilize the overall flow. However, the blocking error will still appear and sometimes it will take after midnight until the websocket connection gets unblocked and the component gets reloaded…
Accounts with MFA setup are not supported. (as the automatic Relogin never will get the second pin…)
See the release notes of v0.27.0 to get a complete overview of changes.
Thanks for your patience and support.
Special thanks to the sponsors (a, b), everyone who starred the repository, and all contributors in the beta phase - you helped a lot!