Mercedes Me Component

@ReneNulschDE -

I am in Dallas, USA - and trying to connect my 2017 GLS450 to Home Assistant using the Mercedes ME (USA) android app V2.5.5.

I tried to use the Mercedes ME Connect android app build 2.16.0-795 but my GLS is 2017, therefore the app redirect me to to download / use the Mercedes ME (USA) app.

Looks like there are some constrains using your integration - so all the models 2019 and new can use the Mercedes ME Connect and connect to Home Assistant - but models prior to 2019 will have to use the Mercedes ME (USA) and cannot connect to the Home Assistant.

Do you think the models prior to 2019 can, in the near future, be integrated to the Home Assistant via your add-on ?

Appreciate once again all your work for this integration.
Petrica

Hi @ReneNulschDE,

After update to 0.113.2 the component stoped working.

I have this in the log:

Detalhes do log ( ERROR )
Logger: homeassistant.setup
Source: custom_components/mercedesmeapi/apicontroller.py:540
First occurred: 17:01:59 (1 occurrences)
Last logged: 17:01:59

Error during setup of component mercedesmeapi
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 670, in urlopen
    httplib_response = self._make_request(
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 426, in _make_request
    six.raise_from(e, None)
  File "<string>", line 3, in raise_from
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 421, in _make_request
    httplib_response = conn.getresponse()
  File "/usr/local/lib/python3.8/http/client.py", line 1332, in getresponse
    response.begin()
  File "/usr/local/lib/python3.8/http/client.py", line 303, in begin
    version, status, reason = self._read_status()
  File "/usr/local/lib/python3.8/http/client.py", line 264, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "/usr/local/lib/python3.8/socket.py", line 669, in readinto
    return self._sock.recv_into(b)
  File "/usr/local/lib/python3.8/ssl.py", line 1241, in recv_into
    return self.read(nbytes, buffer)
  File "/usr/local/lib/python3.8/ssl.py", line 1099, in read
    return self._sslobj.read(len, buffer)
ConnectionResetError: [Errno 104] Connection reset by peer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 439, in send
    resp = conn.urlopen(
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 726, in urlopen
    retries = retries.increment(
  File "/usr/local/lib/python3.8/site-packages/urllib3/util/retry.py", line 403, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "/usr/local/lib/python3.8/site-packages/urllib3/packages/six.py", line 734, in reraise
    raise value.with_traceback(tb)
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 670, in urlopen
    httplib_response = self._make_request(
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 426, in _make_request
    six.raise_from(e, None)
  File "<string>", line 3, in raise_from
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 421, in _make_request
    httplib_response = conn.getresponse()
  File "/usr/local/lib/python3.8/http/client.py", line 1332, in getresponse
    response.begin()
  File "/usr/local/lib/python3.8/http/client.py", line 303, in begin
    version, status, reason = self._read_status()
  File "/usr/local/lib/python3.8/http/client.py", line 264, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "/usr/local/lib/python3.8/socket.py", line 669, in readinto
    return self._sock.recv_into(b)
  File "/usr/local/lib/python3.8/ssl.py", line 1241, in recv_into
    return self.read(nbytes, buffer)
  File "/usr/local/lib/python3.8/ssl.py", line 1099, in read
    return self._sslobj.read(len, buffer)
urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 193, in _async_setup_component
    result = await asyncio.wait_for(task, SLOW_SETUP_MAX_WAIT)
  File "/usr/local/lib/python3.8/asyncio/tasks.py", line 483, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/mercedesmeapi/__init__.py", line 107, in setup
    mercedesme_api = Controller(
  File "/config/custom_components/mercedesmeapi/apicontroller.py", line 342, in __init__
    self._get_cars()
  File "/config/custom_components/mercedesmeapi/apicontroller.py", line 540, in _get_cars
    response = self.session.get(ME_STATUS_URL(URL_USR_API(self.region)),
  File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 543, in get
    return self.request('GET', url, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 530, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 643, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 498, in send
    raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))

Can you help please?

1 Like

I have the same problem after Home Assistant update.

Hi,

Looks like Mercedes has disabled the API endpoints. This not a problem of the HA version.

I‘m on vacation the next two weeks and I‘ll take a look after my return.

Please see my message about the Mercedes API changes that I have posted some days before.

BR
René

6 Likes

Hi. same problem for me.
have a great vacation.

1 Like

Dear MB-Component-Fans,

I’m back from vacation and spend two hours to analyze the situation. Looks like the (current :wink: ) version of the component is dead because MB disabled all the relavant API endpoints. (And this 2 weeks after I have ordered my new car.)

I have requested that the HACS entry get’s removed and I’ll archive the GitHub Repo.

Please remove the component from your configuration.yaml and delete all the entries from your entities registry.

Thank you for all your help in the last years.

MB has published a new public but limited API that could be a starting point for a new component. If someone is interested to work on this - let me know.

BR
Rene

@ …Insider: All the new App-API Endpoints have “risingstar” in the hostname. I have taken this as an inspiration and after 3 hours my current status is

  • Login is working,
  • Rest APIs accessible
  • the tricky part is the new WebSocket connection that is used to transmit the status changes. It’s based on Google’s protobuf. I have an early implementation running on my machine. So 10% of the way is done. Please don’t ask “How long will it take?” - I’ll publish news here in case I have something to show.

@MB-Dev-Team: Any chance to get your protobuf description file? Then we don’t have to play cat and mouse.

6 Likes

Do you have one of them “buy me a coffe” links perhaps? I just want to donate to show appreciation for your hard work Rene.

1 Like

Thanks Konrad, I use this project to continue learning alongside my “normal” work. Please donate to your favorite NGO or https://sea-watch.org/en/.

Thank you
Rene

3 Likes

Hi Rene.
Thanks for your effort.
If you need help I could try to support you!

I think it’s documented over here:

Nice find! :grimacing::+1:t2: https://twitter.com/mobiledude73/status/1292920364394319873?s=21

hej if which calls were you using before? I worked with this API for a non public project, I might be able to speed up your search, from a quick glance in your repo I would guess you should use this api:


hit me up if you need further assistance.
1 Like

I saw Connected Vehicle API. but seems working only with simulated cars… Am I wrong?

Hi,

the BYOD (Bring yourown car, https://developer.mercedes-benz.com/products/vehicle_status) API is the topic that I described as the limited new API. We can use this API but some very useful information are not included (Location or Heaters for example).

All other official APIs are not available for private persons.

BR
Rene

Hi, before I used the unofficial APIs that the Android/IOS apps have been used. It was clear from the beginning (and you can see this in this thread) that at some point MB will change the endpoints and. I was in contact with the MB Dev team the last two years to push for an API that is accessible by private persons. Unfortunatelly, a very small data/command set is available now.

The Connected Vehicle API is not available for a private person. A private person can use the BYOC API only, but this API is limited and does not show location information (even that I have paid for) for example.

BR
Rene

Hi Rene,

the url for location is not working:

https://bff-prod.risingstars.daimler.com/api/v1/vehicles/xxx/location

can you please share the URL.

Thanks
Sebastian

Hi Sebastian,

I have not found an REST endpoint for the location.

You have to open a websocket session (/ws) and decrypt the incomming messages (based on protobuf, check with protoc --decode_raw < message)

please keep in mind to send the received message otherwise you will get every 15 seconds the complete status and not the changes only.

BR
Rene

Rene,

I dont know if this was already mentioned but my integration from the US is still working.

RM

2 Likes

HI RM,

good to know, thank you - I assume this will change soon. :frowning:
BR
Rene

@ReneNulschDE I do the same for iobroker I already extracted the protos but also struggling to convert the ws data to deserialize data. Maybe we can join forces here.