Mercedes Me Component

Hi Terp,

Thank you for this! This is fantastic. I couldn’t find a GitHub repo attached to it so I’ll ask my questions here:

  1. Is it possible to also add support for Pay As You Drive Insurance API? Adding an odometer with all the other data being collected adds another dimension to the data.
    • I did change the scope manually in the OAuth URL to include access to that API, but not seeing anything in the JSON file. All I see is “[]” for the whole page which indicates an empty JSON file on ym end.
  2. Where is the JSON file stored if I am not broadcasting messages via MQTT? Is there a limit to the collection?

Thanks for sharing your solution!

One question, this workaround allows us to get the location of the vehicle? Or only the lock status and fuel range?

Only the basic info, according to the devs, location has been removed due to privacy reasons. its also not possible to lock/unlock the car

Hi

You should be able to override the default scope by setting the env variable in docker: SCOPE=“mb:vehicle:mbdata:fuelstatus mb:vehicle:mbdata:vehiclestatus mb:vehicle:mbdata:vehiclelock mb:vehicle:mbdata:payasyoudrive”

and you can see the data in:

docker run -ti --rm -v mercedesme:/tmp --entrypoint cat terpz/mercedesme:latest /tmp/token

and

docker run -ti --rm -v mercedesme:/tmp --entrypoint cat terpz/mercedesme:latest /tmp/data

I also updated the image, so it should workaround the tokens expiring/deleted

Hi,

long time no message from my side. The delivery of my new car took some weeks longer.

I have created a prototype of a new integration. It’s an early version.

What should work:

  1. HACS integration via custom repo (https://github.com/ReneNulschDE/mbapi2020)
  2. Add the integration via the integration frontend
  3. Device Registry
  4. Some first sensors (including location and some other data that is not available in the official APIs)

Whats missing:
- A lot… most important - the websocket connection has no reconnect and need a HA restart. (Help needed in case you know more about AIOHTTP and Websockets

  • Adding more sensors
  • Adding configuration options (Exclude Cars, Rename Cars, Language)
  • Adding actions (Locks,Windows, Climate Control )
  • Change Devicetracker from old platform to new
  • … tons of other stuff

Please check the Repo for some more information.

Some pictures:
image

9 Likes

Just tested with my A200 Limousine in Belgium, works great.
Currently reporting 10 sensors

2 Likes

Same here in Spain! Works like a charm (on my B200)!! Thanks René for all your great work. I wish I could help out, but way to novice to even get close…

car

1 Like

Working great here - c350e in the UK. I’ve 11 sensors, but I notice that some of those have much more detail as attributes (e.g. liquid range, tyre pressure, etc), which is great!
I don’t get Position info - is that because I don’t subscribe to the relevant service on Mercedes Me?
I also don’t have Door status (open/closed/etc), which I do get using the MMe Dev API.

Thanks for the hard work - this will be really useful!

1 Like

Hi,

Thx. Yes, you need an active subscription for the location data. The door sensor is on the way into the repo :wink:

Sensors vs. attributes is a long discussion. I took the decision to add all the other relevant data as attributes to keep the frontend clean (yes, this was in times before Lovelace). You can create your sensors with a “template”-sensor with a reference to the attributes. This was discussed one or two years ago in this thread and you will find some examples.

But I’m open to make all the stuff available as sensors - just let me know… or make an PR

2 Likes

working very nicely again here in the Netherlands, A200. thanks again Rene!

1 Like

Great work, thanks for that nice integration… Works with our 2019 GLA W156…

1 Like

Hi @DerekO,

door options are available now as attributes of the Lock sensor.

image

1 Like

That was quick! Thanks

Out of curiosity, why do you have entities for Low Brake Fluid Warning, Low Coolant Level Warning and Low Wash Water Warning, when these are also attributes of the Engine Warning Light entity?

:slight_smile: Copied my code from the last integration. My initial plan was to create a “car”-Sensor with all this minor relevant topics. This is on my backlog with a low prio since a long time :wink:

hi,

Wonderful to see this active - I’ve used your component before and now reinstalled it as HACS component. Issue I run into is I cannot find the Mercedes Me connection setup - I’m referring to the popup you are showing in the set of screen prints - after plenty of reboots?

How can I convince it to find the new car ? I’ve activated debug log but don’t see anything apart from the warning there is a custom integration. Anywhere I can wipe settings from the previous integration? I am currently running version 2020.12.0 on an RPI4.

I had an old mercedesme: in my configuration.yaml but that was commented out as I did not extend my subscription to the service. New car comes with active subscription again.

Many thanks!
Jhh

This is awesome! Works like a charm! Now I wish I had not thrown away my lovelace config a couple of months ago :-(.

For your info: some log warning:
Logger: homeassistant.util.async_
Source: util/async_.py:105
First occurred: 11:03:04 (1 occurrences)
Last logged: 11:03:04

Detected I/O inside the event loop. This is causing stability issues. Please report issue to the custom component author for mbapi2020 doing I/O at custom_components/mbapi2020/oauth.py, line 192: response = requests.post(

Once you installed it via HACS and restarted HA, did you then go into Config/Integrations and add it there? That’s when the Config screen appears and it will appear as an integration on that page, showing the device.

2 Likes

Of course I didn’t :blush: - thanks for pointing that out. Works like a charm now!

Excellent work @ReneNulschDE
It is working well in Portugal.

1 Like