Mercedes Me Component

Just sent you an email. Thanks for taking the time to look through this.

Hi @jackgithome ,

you have configured (HA, Configuration, Integrations, MBAPI2020, Configure) an exclusion for the VIN “W1KWF6…”. Please change this config and replace the value with the VIN “W1K20…”. Restart HA and check again. (You can find the VINs in the log that you have send to me.)

Background:

  • In the US-region, each account has two VINs (the last 7 digits are the same) for the same car.
  • The API/Websocket delivers only for one VIN the sensor data

BR
Rene

1 Like

Look at my post above. I too am in the US region. Every time I restart HA I lose my MB entities for anywhere between 2 - 10 hours. Then for reasons unknown, it connects w/o any action from me.

I haven’t had the time to dig into it yet.

@rmertz3282 ,

thanks. Would be good if you could enable the debug mode and let me review the logs for this 2-10h period. Based on the experience, I assume that MB sells to much cars in US right now :slight_smile: and struggles with the systems…

or, … we have an access token / Timezone problem… do you see any info in the log

Thank you so much. This resolved my issue. It is now working as expected!

Sorry, so I have everything working now, however, I can’t seem to get the APIs to work. I’ve left them as they were previously configured and when I look at them they seem correct. I’m calling the service MercedesME 2020: doors_lock and passing the correct VIN. Yet it doesn’t do anything. None of the services seem to be working? Did something change in one of the newer releases? Am I calling them incorrectly?

Here’s the error I’m getting in the logs:
Can’t lock car (MY VIN). VIN unknown or feature not availabe for this car.

6:45:42 PM – (WARNING) MercedesME 2020 (custom integration)

Please go to the integration option dialog and activate „ Disable capabilities check“.

That did it, thank you so much. Been a while since my original setup so I forgot a bunch of the steps.

Hi.

I note you say that your code uses the Mercedes API. In my Mercedes me app, I can change the interior led colour. It’s called the ambient lighting. Can I also do this through your add-on please.

Hi @Mtsuleman ,

currently not. But the bad weather time is starting, let me check.

BR
Rene

1 Like

Dear MB-Integration Users,

slightly Off-Topic (ok, Smart cars are part of the MB Family), but I have published a first version of a “Smart EQ Connect”-integration. The sensor set is limited like the trunk of these cars :slight_smile:

have fun
BR
Rene

1 Like

Hey dear MB hass.io community,
I’m having some issues, and can’t really come along with a proper solution.
I can’t see any entities in home-assistant. What I did was installing via HACS and configuring my account. It seems to work but I don’t get any more data…
What I can see is within “integrations” it shows mbapi2020 and Mercedes ME 2020.

Car is a GLE 2021 / W167.

I’ve attached a screenshot.

Thanks in advance!

Somehow I saw that the remote diagnosis option was deactivated within the app… It’s still activating but maybe that was the reason why?

Hi @P1Rebo ,

do you see the car data in the mobile app already? If yes, just restart HA. If nothing is visible, please enable the debug log and share it here or via a private message.

BR
Rene

Thanks @ReneNulschDE for the fast reply. It still remains in activation within the Mercedes me iOS app. As I saw this is normal and can take some time. In HA I still can’t see any entities yet. I will give an update asap.

1 Like

After installation this component works well for 3 hours in my HA configuration.
After that period of time for every 5min I get errors and component stops to work because of token error.
Do You know what can I do to solve it?
This component worked in my config for months and yesterday after deinstallation and new installation something has changed. Yesterday after 3 hours from installation it stopped to work. Today I tried and situation is the same. After few hours it stopped to work again.

2021-11-27 21:33:29 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File “/config/custom_components/mbapi2020/websocket.py”, line 123, in async_connect
headers = await self._websocket_connection_headers()
File “/config/custom_components/mbapi2020/websocket.py”, line 224, in _websocket_connection_headers
token = await self.oauth.async_get_cached_token()
File “/config/custom_components/mbapi2020/oauth.py”, line 136, in async_get_cached_token
token_info = await self.async_refresh_access_token(token_info[“refresh_token”])
KeyError: ‘refresh_token’

2021-11-27 21:38:29 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File “/config/custom_components/mbapi2020/websocket.py”, line 123, in async_connect
headers = await self._websocket_connection_headers()
File “/config/custom_components/mbapi2020/websocket.py”, line 224, in _websocket_connection_headers
token = await self.oauth.async_get_cached_token()
File “/config/custom_components/mbapi2020/oauth.py”, line 136, in async_get_cached_token
token_info = await self.async_refresh_access_token(token_info[“refresh_token”])
KeyError: ‘refresh_token’

per me è la stessa cosa da ieri, dopo l’aggiornamento, ha smesso di funzionare

for me it’s the same thing since yesterday, after the update, it stopped working,
is there any solution?

Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/config_entries.py”, line 304, in async_setup
result = await component.async_setup_entry(hass, self) # type: ignore
File “/config/custom_components/mbapi2020/init.py”, line 105, in async_setup_entry
token_info = await mercedes.client.oauth.async_get_cached_token()
File “/config/custom_components/mbapi2020/oauth.py”, line 136, in async_get_cached_token
token_info = await self.async_refresh_access_token(token_info[“refresh_token”])
KeyError: ‘refresh_token’

Hi,

I see this error too since Friday. Let me check if there was a change in the MB-Auth-Backend or if I made a mistake.

BR
RenĂŠ

I have published a release “Release 0.5.14 - Bugfix refresh_token error”. This should fix the error:

File “/usr/src/homeassistant/homeassistant/config_entries.py”, line 304, in async_setup
result = await component.async_setup_entry(hass, self) # type: ignore
File “/config/custom_components/mbapi2020/init.py”, line 105, in async_setup_entry
token_info = await mercedes.client.oauth.async_get_cached_token()
File “/config/custom_components/mbapi2020/oauth.py”, line 136, in async_get_cached_token
token_info = await self.async_refresh_access_token(token_info[“refresh_token”])
KeyError: ‘refresh_token’

A ReAuthentication is required - See the red box on the integration page after restart.

Background:
MB changed something in the OAuth Backend. In the past the refresh_token was always present. Now the refresh_token is missing sometimes… :roll_eyes:

@bobofruit , @dolam : May I ask you to recheck?

BR
Rene

2 Likes