Mercedes Me Component

Lately, I’ve noticed values from the sensors wouldn’t update and I would need to manually reload the integration.
Today it failed to reload


Hi,

In Europe it’s working fine for my cars. What is your region?

Try to

  1. open your mB mobile and check if it’s working
  2. delete the .mercedes-token… file in your HA-config folder.
  3. restart HA, you should get a reauthenticate task for the component

Europe as well.
Mobile app works fine.

Will try with deleting the token.

Have had a few issues with this as well, generally works if I remove the ‘hub’ in devices and add again.

Do you see any other error messages or warnings in the logs? Sounds like this happened more often, could you enable the debug log of the component. This would help to get better insights and a chance to takle this.

When I added two cars, I had some problems because the two cars were not the same Mercedes account. When a second car is added, it looks normal, but after HA restarts, problems arise and the first car becomes unusable. I’m guessing it’s because the .mercedesme-token-cache file is overwritten by the token data for the second car. Is there any way to fix the problem? I’m in China, when I’m in a benz account, all the data of the vehicle is normal, thank you!

Hi,

The usage of two accounts is not supported. Please use the secondary driver option in the MB-Portal to add the 2nd car to your primary account. Then you can work with one account and multiple cars.

BR
Rene

Thanks, the 2nd car works fine after being added to the primary account.

1 Like

I have published a small bugfix release v0.9.6 - “Good bye Oillevel sensor…”

Fixes:

  • Attribute endofChargeTimeWeekday fixed (Thanks @DragonNZ)
  • Better websocket ConnectionResetError handling (#148)
  • OilLevel Sensor removed, Not provided by the MBAPI anymore

Note to all: You will see a warning in the log when the ConnectionResetError occurred. Normally, the next line will show the recreation of the websocket and therefore you could ignore this warning.

Note to me: Wait a few weeks and check if we can move the warning to a debug level output…

Is there a service available to reset the trip data? I want to set the trip counter to 0 everytime my car is charged…

Hi,

As far as I know, there is no service available to reset the trip counter. Do you have the option in your MB app?

In case you are a more advanced user:
There is a special api (RCP) to control some car features like interior lightning, mirrorbehavior, navigatoroptions. This api is not fully implemented by this integration currently. However, some rudimentary code to check the available functions is in the code already. In case you want to check what is available do the following:

  1. Make sure you have the latest version v0.9.6 installed
  2. Edit the file __init__.py in custom_components/mbapi2020
  3. comment out the line 150 (rcp_supported = False → #rcp_supported = False) and save the change
  4. Restart HA (restart will take longer now, as all the RCP features are collected from the MB APIs)

Check the attributes of the sensor.Your-Plate_rcp_features via the HA-Developer Tools → States

You should see something like this:
image

Check the attribute list if you see something like your trip reset stuff…

And make sure you uncomment the line 150 in the init.py at the end of your test

PS: This will work only for primary cars in your account. All the cars where you are a secondary driver will not show any results. (Permission problem)

No I can’t do this in the app either, but I was hoping it could be done via this integration. I tried the features, but I con’t see anything that applies:

rcp_supported_settings: acousticallockingindication, activatecamerabyreversegear, ambientlightcolor, ambientlightcolorprogram, ambientlighteffects, ambientlightoptions, amblightbrightnesszones, amblightbrightnesszonesenabled, amblightclimateeffect, amblightmulticolor, amblightmulticoloranimation, amblightwelcomeeffect, automaticlocking, automaticsynchronization, dateformat, displaystyle, exteriormirrorconvenience, interiorlightdelayedswitchofftime, locatorlighting, naviavoidoptions, navivignetteroadoptions, timeformat

Thanks, and yes looks like there is no option to achieve the reset. Sorry…

Hi,

I copied the mbapi2020 folder under the custom_components folder but it is not loading. Do i need to add something to the configuration.yaml file ?

Thank you

Restart HA, Refresh your Browser and click add integration in HA, search for MBapi…

regarding running in Docker:
I am setting up an entirely fresh HA instance on docker (not supervised), and I can select between armhf (armv7 32 bit) or arm64 (armv8 64 bit). Tending to 64.
Do I need to stay with armhf, to further use this extension? Or is it free decision?
Is it still to get integrated via the HACS store, as I used to use with HA OS + supervised? Or can/shall I run it in a separate container?

Thanks and Dankeschön for any hint

Hello Rene,
first of all thank you for your work on this.
I am new to Home Assistant and am still finding my way around. I managed go get HA working on a Rapi5 running Docker (no OS yet) and your Mercedes Me Component has been the first Integration I managed to get going.
I saw that during the development, you added the license plate fo the sensor names and IDs so people could manage different cars. I was wondering if there is a way of replacing the license plate with an Alias or just hiding it. I only have one car to manage.
Once again, thank you for the development :smiley: I will keep working on learning and using Home Assistant

Hi,

Thanks for the positive feedback.

There is no option in this integration to change it in general. One option is to change the license plate in the MB mobile app. You can change it under My Car in the Car Garage. Don’t delete the plate completely and don’t use a space, dot or a number at the beginning

Hi @ReneNulschDE I love your integration, thanks. One question that i have is in the area of the Auxheat switch and sensor. For my German E300e I do not have this switch or sensor available in my integration. What have I done wrong?

Hi, thanks. The 300e does not have auxheating capabilities (Standheizung) - the car has.preclimate options (Vorklimatisierung, in this component preheating) - you can build a switch by your own with the standard HA options like buttons or the template switch (see helpers, template switch). Just use the preheating services that you can find under MBAPI2020.preheating_start/stop/configure

Search for preheating in this thread.

Hope that helps
BR Rene
PS: yes, preheating is a wrong naming. At the time that I implemented this, it was winter and I assumed that this function can only warmup the car.

1 Like