Mercedes Me Component

Dear MB Component Users,

Today, I received the following message from the mb-dev team. I do not know what it means for this component. Just a heads up that some changes are on the way that could break the component.

I’ll try to adjust the component or move it to the new api. If someone of you would like to help send me a message (mb.dev - at - nulsch.de) (I’m on vacation the next two weeks…)

Dear Developers and Digital Enthusiasts,

An important rearrangement is coming up to you: We are about to change our OAuth provider. For this reason, you will soon have to make changes to your applications, which use our OAuth-protected API products. This will require, for example, adjustments to the API and OAuth endpoints.
­
Our request: at the beginning of August we will send you precise instructions to ensure that your affected applications continue to work. Make sure to use the upcoming instructions, because after a transition phase starting from then, today’s OAuth endpoints etc. will no longer be valid. That means you lose access to these API products. So on your part, please plan some effort between the beginning of August and the end of September 2020.

Stay tuned for the upcoming instructions. We’ll get in touch.

Hi Petrica,

please share some more details.

In what region do you live? What Android/IOS App do use the manage your car?

BR
Rene

Hi Arunas,

the implementation of the Aux Heat Switch is poor as I have no car to test intensively. Some users out of this thread gave me access to their cars but debugging and testing when the cars is thousands miles away is not so good.

You can switch the Aux Heat on immediately but not with timing.

Also my next car will not have the Aux Heater - no winter in Germany anymore…

BR
Rene

@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