Mercedes Me Component

Hi @Toro,

any input about your environment? Do you use Venv? If yes, please install lxml in that environment.

BR
Rene

Thanks, I forgot that HA in hassbian is in Venv. works fine now!

Hi @ReneNulschDE,

I created a new pull request. Testing status is now: “works for me”. Please test the heater_on -functionality with your car before accepting the request (with electric car there is just the climate -switch, so I cannot test anything else). They use partly same code, so it’s possible that I break something there. Locking and unlocking seems to work.

I must say that I am surprised how big difference there is between GIT and SVN - a good learning experience :slight_smile:

1 Like

Hello,

All seems OK now! Thanks!

Hello,

Don’t want to rush you, but do you found a chance to upload the png’s for the MercedesMe integration?

Thank you for this great component!
It’s working great so far!
my “beta” panel view:

7 Likes

I can’t get

- warningenginelight
  attributes: warningbrakefluid, warningwashwater, warningcoolantlevellow, warninglowbattery

I can see them inside my mercedes app but they are not present inside HA
what could be the issue?

Hi @exus85,
could you add the configuration option

save_car_details: true

Please restart your HA. After that you will find 2 files in your HA configuration directory. feat_.json and state_.json.

Could you share these two files via a private message with me. I’ll take a look.

BR
Rene

I don’t know what happened, but I just restarted HA in order to get the json files and now the sensor it’s visible!
binary_sensor.fe270je_engine_light_warning :grinning:

I do see in the debug location being recieved by HA, however, there is no devicetracker created. Is there something I’m missing. I see that the code for it is there?

Debug:

> 2019-07-02 06:43:00 DEBUG (SyncWorker_17) [custom_components.mercedesmeapi.apicontroller] get_location for XXXX called
> 2019-07-02 06:43:00 DEBUG (SyncWorker_17) [custom_components.mercedesmeapi.apicontroller] get location for XXXX called
> 2019-07-02 06:43:00 DEBUG (SyncWorker_17) [custom_components.mercedesmeapi.apicontroller] Connect to URL get https://vhs.meapp.secure.mercedes-benz.com/api/v1/vehicles/XXXX/location
> 2019-07-02 06:43:00 DEBUG (SyncWorker_17) [custom_components.mercedesmeapi.apicontroller] get_location result: {'heading': 253.1, 'latitude': XXX, 'longitude': XXX}

Config:

mercedesmeapi:
  username: !secret mb_username
  password: !secret mb_password
  pin: !secret mb_pin
  country_code: NL               # two digts country code
  accept_lang: en_NL             # four digits country code
  save_car_details: true         # save a json to the HA config directory with the features and states, please use this for debug only

Hi, could you share your feat_*.json? Check the second last post.

send json via DM

I get this error when i try to unlock the car:

'NoneType' object has no attribute 'get'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 121, in handle_call_service
    connection.context(msg))
  File "/usr/src/homeassistant/homeassistant/core.py", line 1150, in async_call
    self._execute_service(handler, service_call))
  File "/usr/src/homeassistant/homeassistant/core.py", line 1172, in _execute_service
    await handler.func(service_call)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 194, in handle_service
    required_features
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 316, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 337, in _handle_service_platform_call
    await getattr(entity, func)(**data)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/mercedesmeapi/lock.py", line 69, in unlock
    self._data.unlock(self._vin)
  File "/config/custom_components/mercedesmeapi/apicontroller.py", line 298, in unlock
    return self._execute_car_action(CAR_UNLOCK_URL, car_id, 'car unlock', self.pin)
  File "/config/custom_components/mercedesmeapi/apicontroller.py", line 353, in _execute_car_action
    if result.get("status") == 'PENDING':
AttributeError: 'NoneType' object has no attribute 'get'

(LOCK works, but UNLOCK doesn’t work. I have the latest version of your code. Unlock works in the Mercedes app.)
What have i done wrong? :smile:

Hi,
sorry not so much time these days. Please find a link to a imgur album. I hope it’ll work now?!

1 Like

Looks good. But all the filenames have changed… Any change you could zip them up from your hass directly and mail them to me? I will add the zip then to a google drive for the rest.
I can send you my mailaddress privately if you would agree.

Thanks!

1 Like

Hi @Konrad_Lindblad,

do you have set the correct PIN in your config? Please switch the debug logging on, and share the output.

any progress to why I don’t get the device tracker?

not yet, I’ll add some more debug code…

okay I’ll be patient :slight_smile:

Hi, this weekend i got some time to rework my configuration which wasn’t working at all before I updated to the new variant.

Is there a way to directly use attributes in lovelace picture-element-cards? If no I would strongly recommend to go back to the single sensor elements. Not everybody is using attribute cards. If theres an other way please tell me. For now i will use template sensors and extract the attributes…

1 Like