Mercedes Me Component

Bugfix Release v0.7.2

Looks like the MB Engineers cleaned up their API Gateway configuration. The good thing is that its more consistent now. The bad thing: I had to implement the cleanup in my code too. Unfortunately, I was in the middle to prepare the christmas present and therefore you get new features in this release too. Thanks to @Thomas55555 for the PR

Bugfix:

  • Error on Integration Setup (MB API Headers Change)

New features:

  • New Sensor Geofencing Violations
  • Multiple New Sensors that have been extended attributes in the past (Thanks to @Thomas55555)

Open Topics:

  • Readme is not up-to-date with the new sensors from Thomas
  • As always, its not tested in the US/APAC region

@Bamboooo : May I ask you to test again?

BR
Rene

1 Like

Hello Rene, good morning
Unfortunately, v0.7.2 also has the same problems

Logger: custom_components.mbapi2020.oauth
Source: custom_components/mbapi2020/oauth.py:138
Integration: MercedesME 2020 (documentation, issues)
First occurred: 05:18:57 (6 occurrences)
Last logged: 05:20:41

ClientError requesting data from https://id.mercedes-benz.com/as/token.oauth2: 400, message=‘Bad Request’, url=URL(‘https://id.mercedes-benz.com/as/token.oauth2’)

Could you please delete the .Mercedes token file in your HA folder and reauthenticate?

OK, that’s it!
Thank you very much for your tireless efforts
Many greetings

Hello,
Unfortunately, it gives me the same. The country is Luxembourg, my application works, the PIN is also set.
They have the cars, who lists the two cars, but does not fill them.

Can't connect to MB APIs; Retrying in background
8:59:21 PM – (WARNING) MercedesME 2020 (custom integration) - message first occurred at 8:57:24 PM and shows up 9 times
Config entry 'mbapi2020' for mbapi2020 integration not ready yet; Retrying in background
8:59:15 PM – (WARNING) config_entries.py - message first occurred at 8:57:45 PM and shows up 2 times
Config entry 'mbapi2020' for mbapi2020 integration not ready yet; Retrying in background
8:57:24 PM – (WARNING) config_entries.py

Képernyőfotó 2022-12-20 - 21.02.28

Hi @WebPower ,

Short way:
0. Make sure you are running on >HA2022.11 and MBAPI2020 >= v0.7.2

  1. please delete the .Mercedes token file in your HA folder
  2. Restart HA
  3. Reauthenticate the component

Long (tech) way:
What are the version numbers of HA and MBAPI2020?
Could you enable the debug log and share the log via private message?

BR
Rene

Just FYI: had the same issue after upgrading to Home Assistant 2022.12.8.

Read Rene´s super quick responses to others reporting the same issues, upgraded to 0.7.2 and all works fine again.

Thanks,
Alex

Region: Germany
connected car: 2019 V-class

1 Like

Bugfix Release v0.7.4 - Asia-Pacific Region

Bugfix:

  • Error on Integration Setup Asia-Pacific Region (MB API Headers Change)

Someone else getting the error that:

Entität nicht verfügbar: sensor.wXXXXXXXXXXXXA5_charging_power_2 not available? Could not work that out … Thanks a lot!

Hello,

I deleted everything, mercedes me token too, reinstalled everything but the error is the same. The code is also good, now I will change it to another one in the mobile app.

Can't connect to MB APIs; Retrying in background
10:50:45 AM – (WARNING) MercedesME 2020 (custom integration) - message first occurred at 10:50:06 AM and shows up 4 times
Config entry 'mbapi2020' for mbapi2020 integration not ready yet; Retrying in background
10:50:06 AM – (WARNING) config_entries.py
Error handling request
10:50:01 AM – (ERROR) MercedesME 2020 (custom integration)
ClientError requesting data from https://id.mercedes-benz.com/as/token.oauth2: 400, message='Bad Request', url=URL('https://id.mercedes-benz.com/as/token.oauth2')
10:50:01 AM – (ERROR) MercedesME 2020 (custom integration)
2022-12-22 10:53:27.517 DEBUG (MainThread) [custom_components.mbapi2020.oauth] Start async_get_cached_token()
2022-12-22 10:53:27.518 DEBUG (MainThread) [custom_components.mbapi2020.oauth] Start async_get_cached_token()
2022-12-22 10:53:29.030 DEBUG (MainThread) [custom_components.mbapi2020] VIN not found in masterdata. Used FIN WDD2229861A3xxxxx instead.
2022-12-22 10:53:29.030 DEBUG (MainThread) [custom_components.mbapi2020.oauth] Start async_get_cached_token()
2022-12-22 10:53:30.919 DEBUG (MainThread) [custom_components.mbapi2020.oauth] Start async_get_cached_token()
2022-12-22 10:53:32.745 DEBUG (MainThread) [custom_components.mbapi2020] RCP supported for car WDD2229861A3xxxxx: False
2022-12-22 10:53:32.745 DEBUG (MainThread) [custom_components.mbapi2020] Init - car added - WDD2229861A3xxxxx
2022-12-22 10:53:32.745 DEBUG (MainThread) [custom_components.mbapi2020] VIN not found in masterdata. Used FIN WDD2220571A0xxxxx instead.
2022-12-22 10:53:32.745 DEBUG (MainThread) [custom_components.mbapi2020.oauth] Start async_get_cached_token()
2022-12-22 10:53:33.708 DEBUG (MainThread) [custom_components.mbapi2020.oauth] Start async_get_cached_token()
2022-12-22 10:53:34.037 DEBUG (MainThread) [custom_components.mbapi2020] RCP supported for car WDD2220571A0xxxxx: False
2022-12-22 10:53:34.037 DEBUG (MainThread) [custom_components.mbapi2020] Init - car added - WDD2220571A0xxxxx
2022-12-22 10:53:34.037 DEBUG (MainThread) [custom_components.mbapi2020.oauth] Start async_get_cached_token()

Did you try to delete the .mercedesme-token-cache file in your HA-config folder and restart HA ?

Yes,

But the error is the same, I broke the MB2020 integration, I also deleted the token: .config/mercedesme-token-cache. I restarted HA. I reinstalled the integration, re-entered the data. He finds the account, who gives me the two available cars, I set the country code to LU in the configuration panel, I don’t mind the language en-GB, I enter the security pin.


2022-12-22 11:26:12.398 WARNING (MainThread) [custom_components.mbapi2020] Can't connect to MB APIs; Retrying in background
2022-12-22 11:26:22.402 INFO (MainThread) [custom_components.mbapi2020.client] WSL not detected - running in rlock mode
2022-12-22 11:26:22.402 DEBUG (MainThread) [custom_components.mbapi2020.oauth] Start async_get_cached_token()
2022-12-22 11:26:22.402 DEBUG (MainThread) [custom_components.mbapi2020.oauth] Start async_get_cached_token()
2022-12-22 11:26:23.541 DEBUG (MainThread) [custom_components.mbapi2020] VIN not found in masterdata. Used FIN WDD2229861A3xxxx instead.
2022-12-22 11:26:23.541 DEBUG (MainThread) [custom_components.mbapi2020.oauth] Start async_get_cached_token()
2022-12-22 11:26:23.644 DEBUG (MainThread) [custom_components.mbapi2020.oauth] Start async_get_cached_token()
2022-12-22 11:26:23.857 DEBUG (MainThread) [custom_components.mbapi2020] RCP supported for car WDD2229861Axxxxxx: False
2022-12-22 11:26:23.857 DEBUG (MainThread) [custom_components.mbapi2020] Init - car added - WDD2229861A366609
2022-12-22 11:26:23.857 DEBUG (MainThread) [custom_components.mbapi2020] VIN not found in masterdata. Used FIN WDD2220571Axxxxx instead.
2022-12-22 11:26:23.857 DEBUG (MainThread) [custom_components.mbapi2020.oauth] Start async_get_cached_token()
2022-12-22 11:26:23.963 DEBUG (MainThread) [custom_components.mbapi2020.oauth] Start async_get_cached_token()
2022-12-22 11:26:24.183 DEBUG (MainThread) [custom_components.mbapi2020] RCP supported for car WDD2220571A0xxxx: False
2022-12-22 11:26:24.184 DEBUG (MainThread) [custom_components.mbapi2020] Init - car added - WDD2220571Axxxxx
2022-12-22 11:26:24.184 DEBUG (MainThread) [custom_components.mbapi2020.oauth] Start async_get_cached_token()
2022-12-22 11:26:24.264 DEBUG (MainThread) [custom_components.mbapi2020.api] Traceback (most recent call last):
  File "/config/custom_components/mbapi2020/api.py", line 89, in _request
    resp.raise_for_status()
  File "/usr/local/lib/python3.10/site-packages/aiohttp/client_reqrep.py", line 1004, in raise_for_status
    raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 403, message='Forbidden', url=URL('https://bff.emea-prod.mobilesdk.mercedes-benz.com/v1/vehicle/WDF447813134xxxx/capabilities/commands')

2022-12-22 11:26:24.265 WARNING (MainThread) [custom_components.mbapi2020] Can't connect to MB APIs; Retrying in background

Hi @WebPower ,

do you have ordered a new car or have a car without the communication module? (chip-shortage)

Please go to the option dialog of the component and add the VIN WDF447813134xxxx to the exclusion list.

The security code is not relevant here.

There is a car registered in your account where we can’t get the capabilities. I heard this once when the comms-module was not available when they build the car. (is an open bug in the github repo)

Thx
Rene

Hi Sven,

I have seen this multiple times. Sometimes this value is not delivered via the API on startup of HA. Could you restart your HA and check if it gets reported again? Sometime a restart after 24h brings the value back. I have not found a solution for this (or better I create the sensors only on startup and have no option to create sensors whenever the data comes available later on)

BR
Rene
PS: Few people have reported this for the starter_battery too (when the car was not moved for 3-4 days)

Hello ReneNulschDE

This was the solution, I put it in the exclusion list. It works now! Thank you very much. That little Bus wasn’t properly credited to my account, but that’s okay. That’s how it works now. Thanks again.

Happy holidays to everyone.

Hi Karoly,

this is solved in the master branch now and will be part of the next release. I just ignore the error and write an info into the log that “Disabling of the capability check” is needed to use the car related services.

Thanks for reporting - however I do not get your “little Bus” statement.

BR
Rene

do you have ordered a new car or have a car without the communication module? (chip-shortage):
I wrote there that there is a car in my system that was not properly entered under my account. It’s a company transporter, but I don’t need it. VIN WDF447813134xxxx - this is a company car, they wanted to put it under my account, but they didn’t complete the process at the Mercedes center. It’s not interesting anyway.

1 Like

Hi Rene since I live in South Korea and my family really used well with your component, so thankful! however when its updated to 0.7.4, I can only see one device (there was 2 devices including all sensors). Would you plz check why the other device is not pop up?

Hi Jayjung,

to evaluate this, please enable the debug log for this component. Restart HA and share the log via private message or email (mbdev.jayjung (at) nulsch [.] de)

To enable the debug log, you have to add/change your ha configuration.yaml:

logger:
  default: warn
  logs:
    custom_components.mbapi2020: debug