Mercedes Me Component

You can upload them to an album on imgur.com, then share the album here.

Hi!

I have installed lxml with “pip3 install lxml” without error but I get the following error, any idea?

Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.7/site-packages/homeassistant/setup.py”, line 156, in _async_setup_component
component.setup, hass, processed_config) # type: ignore
File “/usr/lib/python3.7/concurrent/futures/thread.py”, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File “/home/homeassistant/.homeassistant/custom_components/mercedesmeapi/init.py”, line 215, in setup
from custom_components.mercedesmeapi.oauth import MercedesMeOAuth
File “/home/homeassistant/.homeassistant/custom_components/mercedesmeapi/oauth.py”, line 16, in
import lxml.html
ModuleNotFoundError: No module named ‘lxml’

Hi @molano,

Thank you for the log. I have pushed a small change. The device locator is checking the car features now. Please check if the error is not logged anymore.

Thx
Rene

1 Like

Hi @jruoho,

thank you for the pull request. Based on your private message, I’ll not accept the PR but I have changed the code to fix the PRECOND start.

Could you please check?

Thx
Rene

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.