Mercedes Me Component

Thanks. Can we analyze this a little bit deeper? Normally, the capabilities check works in Europe. May I ask you, to enable the “Debug Only: Enable save…” option in the integration options? Restart HA, wait 2 min. Disable the option.

You will find few files in the messages folder of the mbapi2020 integration (HA_CONFIG/custom_components). Would be great if you could send this to me via private message here or via email mb.dev.ihaveastream(-at-)nulsch.de

and no, I can’t steal your car with the details :wink:

BR
Rene

what is your region? EU, US or Asia?

OK, of course I’m happy to support from my end where I can.
I’ll send the data to you shortly.

BR,
Stefan

1 Like

I’m in Norway, so Europe.

For Europe, the following endpoints are used:

https://id.mercedes-benz.com
https://bff-prod.risingstars.daimler.com
wss://websocket-prod.risingstars.daimler.com/ws
https://rcp-rs.query.api.dvb.corpinter.net
https://psag.query.api.dvb.corpinter.net

Thank you very much! :grin: :+1: :metal: :+1:

1 Like

Thank you for the great add-on. It reads pretty well. However, I fail at the configuration. I am running a supervised version of HA in a docker and haveHACS installed. Having selected “MercedesME 2020”, downloaded and restarted HA I fail to proceed. As hard as I try - under no circumstances or options I’m prompted for my Mercedes ME ID.
Under HACS clicking the card Mercedes Me 2020 the installation description is shown. The 3 dots in the bottom right corner contain: Information - Repository - Aktualisierungsinformation - reload - report an issue - report for removal of repository - remove. Configuration (on the side-bar) - integration doesn’t show MercedesMe 2020 at all. Needless to mention config/custom_components/mbapi2020 exists (with some files)
What am I doing wrong ? Thank you for support

Rallye

Hi @rallye ,

after the installation via HACS:

  • Make sure you reboot HA once
  • Refresh your Browser Window (Ctrl+F5)
  • Go to HA, Configuration, Integrations, click on the “+”-sign and search for MBAPI2020
  • Follow the wizard

BR
Rene

Thank you so much, Rene ! Worked perfectly and I’m very happy now. Thank you for the great module !

Regs from Vienna

I am building a keyless entry system for my car with the integration and ESPresense, and I have most bits working as they should. Only one problem: The charger and parking space is outside our master bedroom. When the car is parked there, it will react to our phones coming into the master bedroom as if we’re outside the car. A wooden house doesn’t stop the Bluetooth signal at all. Is there a way to use the car’s position to deactivate the function for the phones, but not for the keys, when it’s parked there? Another, but less reliable version (since I don’t always hook it up when I’m parked, but most of the time) would be if I could see if the charging cable was connected, not just when it’s charging at the moment, but all the time. But a GPS point would be better.

Edit: Solved by using a second Pi with OpenWRT so that it connects to the house wifi when it’s home and uses 4G when it’s not. As long as a ping sensor shows that the house wifi is reachable (I use the server, 192.168.0.1) the automation will only fire on our keys, not the phones.

1 Like

Hi from Australia,
I’m trying to use this add-on and I can only see the sensors. I’m mainly interested in being able to configure the maximum charge of my car. I’ve set up a security pin in the app and entered it into the configuration of the integration but I still don’t have any controls. Any ideas as to what I’m doing wrong?

Did you check the HA log for any potentially related errors / warnings?

I’m trying to get an automation not to lock the doors if one of the doors are open. I know the value I am looking for from the template editor, it’s
</s> <s>"{{ state_attr('sensor.mastiff_lock','doorstatusfrontleft') }}"</s> <s>
which is set as “false” if the door is closed or “true” if it’s open (and so on for the other doors). I just don’t know how to make that into a not condition, since the conditions I have go directly on the state of the lock, like this, which stops the automation locking the car if it’s already locked:

</s> <s> - condition: state</s> <s> entity_id: sensor.mastiff_lock</s> <s> state: "1"</s> <s>
But using the “substate” like that would not work, of course. I am pretty sure I’d need to use a value template, but I haven’t done much with those at all. Can somebody please tell me what I need to do?

Found it, it was easier than I thought:

      - condition: state
        entity_id: sensor.mastiff_lock
        attribute: decklidstatus
        state: "True"

This should be the luggage door. But I can’t get the engine hood status working, maybe because it’s because it’s an EQC, so there’s no engine under there?

The integration stopped working for me at some point, so I removed the integration and the HACS component, removed the authentication, and re-installed.
When setting up, I keep getting “Unknown error occured”.
This is the result from the logs:

Logger: aiohttp.server
Source: custom_components/mbapi2020/client.py:67
Integration: MercedesME 2020 (documentation, issues)
First occurred: 4:36:31 PM (3 occurrences)
Last logged: 4:36:45 PM

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 435, in _handle_request
    resp = await request_handler(request)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_app.py", line 504, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/web_middlewares.py", line 117, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 100, in forwarded_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 28, in request_context_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 219, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 137, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 166, in post
    return await super().post(request, flow_id)
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 62, in wrapper
    result = await method(view, request, *args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 111, in post
    result = await self._flow_mgr.async_configure(flow_id, data)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 252, in async_configure
    result = await self._async_handle_step(flow, cur_step["step_id"], user_input)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 325, in _async_handle_step
    result: FlowResult = await getattr(flow, method)(user_input)
  File "/config/custom_components/mbapi2020/config_flow.py", line 74, in async_step_user
    client = Client(session=session, hass=self.hass, region=user_input[CONF_REGION])
  File "/config/custom_components/mbapi2020/client.py", line 67, in __init__
    self.__lock = RLock()
  File "/usr/local/lib/python3.9/multiprocessing/context.py", line 73, in RLock
    return RLock(ctx=self.get_context())
  File "/usr/local/lib/python3.9/multiprocessing/synchronize.py", line 187, in __init__
    SemLock.__init__(self, RECURSIVE_MUTEX, 1, 1, ctx=ctx)
  File "/usr/local/lib/python3.9/multiprocessing/synchronize.py", line 57, in __init__
    sl = self._semlock = _multiprocessing.SemLock(
FileNotFoundError: [Errno 2] No such file or directory

Hi @kzaoaai ,

this is strange. Never have seen this before. Could you enable the debug mode of the component check for any error before?

Thx
Rene

Hi @liams ,

greetings from Germany :slight_smile:

Not sure want you mean by “don’t have any controls” - Do you see all of your sensors and get they updated?

To configure max-charge you have to call the service “mbapi2020.battery_max_soc_configure”. See developer tools, services in HA.

Do you mean the full HA log set at debug? setting both components below to debug doesn’t provide additional details or errors.

custom_components.mbapi2020: debug
aiohttp.server: debug

Thanks. Could you describe your environment? for example output of HA, Configuration, General, Info. Do you use any special CPU Arch or OS?

I’m running HA Supervised, in an Ubuntu WSL2 environment. Everything else works as intended…

hi @kzaoaai, I can reproduce the bug in Ubuntu on WSL2, but do not know how to fix this. I’m not a specialist of the HA-supervised setup. Should be something related to access to /dev/shm under WSL - I tried different things without success. (google for “wsl” “SemLock” FileNotFoundError) - Can’t help right now.