Mercedes Me Component

Hi there,
I was using this addon for a couple of weeks, until I had an error with my hassio.

No I receive the message ‘This entity is currently unavailable and is an orphan to a removed’.
Tried reinstalling the integration, but without any luck.

Is there a way to fix this?

Nermind, fixed is already. thanks for this great component.

Hi, I asked a few times without much response.

Would someone be so kind to share their current config with their graphical lovelace implementation? The old ones don’t work anymore since sensors have changed.

Thanks!

Here you go michel!

My sensors are all defined separately:

- platform: template
    sensors:
      car_tire_pressure_rear_left:
        friendly_name: Tire pressure Rear Left
        entity_id:
          - binary_sensor.wdd2462081n170679_tire_warning
        value_template: '{{ states.binary_sensor.wdd2462081n170679_tire_warning.attributes.tirepressureRearLeft }}'
      car_tire_pressure_rear_right:
        friendly_name: Tire pressure Rear Right
        entity_id:
          - binary_sensor.wdd2462081n170679_tire_warning
        value_template: '{{ states.binary_sensor.wdd2462081n170679_tire_warning.attributes.tirepressureRearRight }}'
      car_tire_pressure_front_left:
        friendly_name: Tire pressure Front Left
        entity_id:
          - binary_sensor.wdd2462081n170679_tire_warning
        value_template: '{{ states.binary_sensor.wdd2462081n170679_tire_warning.attributes.tirepressureFrontLeft }}'
      car_tire_pressure_front_right:
        friendly_name: Tire pressure Front Right
        entity_id:
          - binary_sensor.wdd2462081n170679_tire_warning
        value_template: '{{ states.binary_sensor.wdd2462081n170679_tire_warning.attributes.tirepressureFrontRight }}'
      car_lock_front_right:
        friendly_name: Lock Front Right
        entity_id:
          - sensor.wdd2462081n170679_lock
        value_template: >-
          {% if is_state_attr('sensor.wdd2462081n170679_lock', 'doorStateFrontRight', 'DOOR_CLOSED_AND_DOOR_LOCKED')%}
             Closed
          {% else %}
             Open
          {% endif %}
        icon_template: >
          {% if is_state_attr('sensor.wdd2462081n170679_lock', 'doorStateFrontRight', 'DOOR_CLOSED_AND_DOOR_LOCKED')%}
            mdi:lock-outline
          {% else %} 
            mdi:lock-open-variant-outline
          {% endif %}
      car_lock_front_left:
        friendly_name: Lock Front Left
        entity_id:
          - sensor.wdd2462081n170679_lock
        value_template: >-
          {% if is_state_attr('sensor.wdd2462081n170679_lock', 'doorStateFrontLeft', 'DOOR_CLOSED_AND_DOOR_LOCKED')%}
             Closed
          {% else %}
             Open
          {% endif %}
        icon_template: >
          {% if is_state_attr('sensor.wdd2462081n170679_lock', 'doorStateFrontLeft', 'DOOR_CLOSED_AND_DOOR_LOCKED')%}
            mdi:lock-outline
          {% else %} 
            mdi:lock-open-variant-outline
          {% endif %}
      car_lock_rear_right:
        friendly_name: Lock Rear Right
        entity_id:
          - sensor.wdd2462081n170679_lock
        value_template: >-
          {% if is_state_attr('sensor.wdd2462081n170679_lock', 'doorStateRearRight', 'DOOR_CLOSED_AND_DOOR_LOCKED')%}
             Closed
          {% else %}
             Open
          {% endif %}
        icon_template: >
          {% if is_state_attr('sensor.wdd2462081n170679_lock', 'doorStateRearRight', 'DOOR_CLOSED_AND_DOOR_LOCKED')%}
            mdi:lock-outline
          {% else %} 
            mdi:lock-open-variant-outline
          {% endif %}
      car_lock_rear_left:
        friendly_name: Lock Rear Left
        entity_id:
          - sensor.wdd2462081n170679_lock
        value_template: >-
          {% if is_state_attr('sensor.wdd2462081n170679_lock', 'doorStateRearLeft', 'DOOR_CLOSED_AND_DOOR_LOCKED')%}
             Closed
          {% else %}
             Open
          {% endif %}
        icon_template: >
          {% if is_state_attr('sensor.wdd2462081n170679_lock', 'doorStateRearLeft', 'DOOR_CLOSED_AND_DOOR_LOCKED')%}
            mdi:lock-outline
          {% else %} 
            mdi:lock-open-variant-outline
          {% endif %}
      car_lock_trunk:
        friendly_name: Lock trunk
        entity_id:
          - sensor.wdd2462081n170679_lock
        value_template: >-
          {% if is_state_attr('sensor.wdd2462081n170679_lock', 'trunkStateRollup', 'CLOSED_AND_LOCKED')%} 
             Closed
          {% else %}
             Open
          {% endif %}
        icon_template: >
          {% if is_state_attr('sensor.wdd2462081n170679_lock', 'trunkStateRollup', 'CLOSED_AND_LOCKED')%} 
            mdi:lock-outline
          {% else %}
            mdi:lock-open-variant-outline
          {% endif %}
      car_window_front_left:
        friendly_name: Window Front Left
        entity_id:
          - binary_sensor.wdd2462081n170679_windows_closed
        value_template: >-
          {% if is_state_attr('binary_sensor.wdd2462081n170679_windows_closed', 'windowstatusfrontleft', 'CLOSED')%} 
             Closed
          {% else %}
             Open
          {% endif %}
        icon_template: >
          {% if is_state_attr('binary_sensor.wdd2462081n170679_windows_closed', 'windowstatusfrontleft', 'CLOSED')%} 
            mdi:window-closed-variant
          {% else %}
            mdi:window-open-variant
          {% endif %}
      car_window_front_right:
        friendly_name: Window Front Right
        entity_id:
          - binary_sensor.wdd2462081n170679_windows_closed
        value_template: >-
          {% if is_state_attr('binary_sensor.wdd2462081n170679_windows_closed', 'windowstatusfrontright', 'CLOSED')%} 
             Closed
          {% else %}
             Open
          {% endif %}
        icon_template: >
          {% if is_state_attr('binary_sensor.wdd2462081n170679_windows_closed', 'windowstatusfrontright', 'CLOSED')%} 
            mdi:window-closed-variant
          {% else %}
            mdi:window-open-variant
          {% endif %}
      car_window_rear_left:
        friendly_name: Window Rear Left
        entity_id:
          - binary_sensor.wdd2462081n170679_windows_closed
        value_template: >-
          {% if is_state_attr('binary_sensor.wdd2462081n170679_windows_closed', 'windowstatusrearleft', 'CLOSED')%} 
             Closed
          {% else %}
             Open
          {% endif %}
        icon_template: >
          {% if is_state_attr('binary_sensor.wdd2462081n170679_windows_closed', 'windowstatusrearleft', 'CLOSED')%} 
            mdi:window-closed-variant
          {% else %}
            mdi:window-open-variant
          {% endif %}
      car_window_rear_right:
        friendly_name: Window Rear Right
        entity_id:
          - binary_sensor.wdd2462081n170679_windows_closed
        value_template: >-
          {% if is_state_attr('binary_sensor.wdd2462081n170679_windows_closed', 'windowstatusrearright', 'CLOSED')%} 
             Closed
          {% else %}
             Open
          {% endif %}
        icon_template: >
          {% if is_state_attr('binary_sensor.wdd2462081n170679_windows_closed', 'windowstatusrearright', 'CLOSED')%} 
            mdi:window-closed-variant
          {% else %}
            mdi:window-open-variant
          {% endif %}
      car_window_sunroof:
        friendly_name: Window Sunroof
        entity_id:
          - sensor.wdd2462081n170679_lock
        value_template: >-
          {% if is_state_attr('sensor.wdd2462081n170679_lock', 'sunroofstatus', 'TILT_SLIDE_SUNROOF_CLOSED')%} 
             Closed
          {% else %}
             Open
          {% endif %}
        icon_template: >
          {% if is_state_attr('sensor.wdd2462081n170679_lock', 'sunroofstatus', 'TILT_SLIDE_SUNROOF_CLOSED')%} 
            mdi:window-closed-variant
          {% else %}
            mdi:window-open-variant
          {% endif %}

In lovelace I use a picture element card to display the icons where I want them:

elements:
  - entity: sensor.wdd2462081n170679_odometer
    prefix: 'Odometer : '
    style:
      color: '#FFFFFF'
      left: 50%
      top: 15%
    type: state-label
  - entity: sensor.wdd2462081n170679_fuel_level
    prefix: 'Gas : '
    style:
      color: '#FFFFFF'
      left: 50%
      top: 18%
    type: state-label
  - entity: sensor.car_tire_pressure_front_left
    style:
      color: '#FFFFFF'
      left: 10%
      top: 27%
    type: state-label
  - entity: sensor.car_tire_pressure_front_right
    style:
      color: '#FFFFFF'
      left: 89%
      top: 27%
    type: state-label
  - entity: sensor.car_tire_pressure_rear_left
    style:
      color: '#FFFFFF'
      left: 10%
      top: 81%
    type: state-label
  - entity: sensor.car_tire_pressure_rear_right
    style:
      color: '#FFFFFF'
      left: 89%
      top: 81%
    type: state-label
  - entity: sensor.car_lock_front_left
    style:
      '--paper-item-icon-color': white
      left: 22%
      top: 53%
    type: state-icon
  - entity: sensor.car_lock_front_right
    style:
      '--paper-item-icon-color': white
      left: 78%
      top: 53%
    type: state-icon
  - entity: sensor.car_lock_rear_left
    style:
      '--paper-item-icon-color': white
      left: 22%
      top: 73%
    type: state-icon
  - entity: sensor.car_lock_rear_right
    style:
      '--paper-item-icon-color': white
      left: 78%
      top: 73%
    type: state-icon
  - entity: sensor.car_lock_trunk
    style:
      '--paper-item-icon-color': white
      left: 50%
      top: 90%
    type: state-icon
  - entity: sensor.car_window_front_left
    style:
      '--paper-item-icon-color': white
      left: 28%
      top: 53%
    type: state-icon
  - entity: sensor.car_window_front_right
    style:
      '--paper-item-icon-color': white
      left: 72%
      top: 53%
    type: state-icon
  - entity: sensor.car_window_rear_left
    style:
      '--paper-item-icon-color': white
      left: 28%
      top: 73%
    type: state-icon
  - entity: sensor.car_window_rear_right
    style:
      '--paper-item-icon-color': white
      left: 72%
      top: 73%
    type: state-icon
  - entity: sensor.car_window_sunroof
    style:
      '--paper-item-icon-color': white
      left: 50%
      top: 55%
    type: state-icon
  - entity: binary_sensor.wdd2462081n170679_tire_warning
    prefix: 'Tire alarm : '
    style:
      color: '#FFFFFF'
      left: 15%
      top: 1%
    type: state-label
  - entity: sensor.wdd2462081n170679_lock
    prefix: 'Doors Locked : '
    style:
      color: '#FFFFFF'
      left: 49%
      top: 1%
    type: state-label
  - entity: binary_sensor.wdd2462081n170679_windows_closed
    prefix: 'Windows closed : '
    style:
      color: '#FFFFFF'
      left: 80%
      top: 1%
    type: state-label
image: /local/mercedes.jpg
title: Mercedes
type: picture-elements

Finally looking like this:

3 Likes

Great, I’ll try this one.
Thanks! :+1:

1 Like

Hi,

I have pushed a new prerelease version to prevent warnings in further versions of HA.

:warning: Home Assistant Core Version 0.110 or higher required

Hi @tom.b,

try to delete the .mercedesme-token-cache file in you HA config directory and restart. if this not help enable the logging and share the output.

Hi, any change you could share the image?

Here you go!

2 Likes

Great job on this component, it worked right out of the box for me. Wondering when it will be part of HA natively.

Side question, does anyone know what the attribute remoteStartTemperature under Remote Start represent?

Hey All, i’m getting a failure on the second oauth step…

When i paste the html from step 2 i get…

Login failed.

Your e-mail address/mobile phone number or your password is incorrect. Please try again or reset your password.

And a field to “Enter characters from the image”. How to fix this?

The resulting failure is:

2020-05-12 18:01:05 ERROR (MainThread) [homeassistant.setup] Error during setup of component mercedesmeapi
Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/setup.py", line 175, in _async_setup_component component.setup, hass, processed_config # type: ignore 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/__init__.py", line 99, in setup token_info = auth_handler.request_initial_token() File "/config/custom_components/mercedesmeapi/oauth.py", line 230, in request_initial_token step_3_form = {x.attrib["name"]: x.attrib["value"] for x in step_3_elements} File "/config/custom_components/mercedesmeapi/oauth.py", line 230, in <dictcomp> step_3_form = {x.attrib["name"]: x.attrib["value"] for x in step_3_elements} File "src/lxml/etree.pyx", line 2479, in lxml.etree._Attrib.__getitem__ KeyError: 'value'

Thanks

Hi

Im using this fantastic componen sice more that one year. Today i just discovered that there is not anymore on the HA the entity for the location GPS
Is that normal? maybe i just delete by error…
If is the last case how can re-add it again?

Thanks

Update
Ok I added log line _LOGGER.debug(“Loging dict —> {0}”.format(form)) to oauth.py

I can see that my password and username are posted correctly in the form.

But still i get the error and i have to enter the code from the image in step 2…

Hi,

Is the location available in the official app? Could be that your location service license has expired und you have to put some bucks into the MB Maschine.

BR
Rene

Hi,

In which country is your car registered? Can you share your configuration (without login data)?

BR
Rene

Hi @nikechristo,

I have no plans to add this to HA currently. I’m using an inofficial API and the API can change every Friday.

I have not found a description for remoteStartTemperature.

BR
Rene

Hi Rene,

It’s in the Netherlands, and the current config is:

mercedesmeapi:
  username: !secret auto_user
  password: !secret auto_pass
  pin: !secret auto_pin
  country_code: NL
  accept_lang: nl_NL
  save_car_details: false

Thanks

Fair enough @ReneNulschDE, and I figured remoteStartTemperature to be the cabin temperature.

Hi @GrammaTonic,

could you please delete country_code and accept_lang and try again? Does the MB mobile app allow the login?

BR
Rene

Hi @ReneNulschDE

Yes I’m using the Mobile app for 2 months now.
Also I logged out and reset my password and login again works.

When i remove the 2 vars: country_code,accept_lang your code is defaulting to “DE” and “en_DE” thats ok.

But still in the second phase i will get “Enter characters from the image”

                    <!-- Captcha -->

                        <div id="captcha_input_ctr" class="form-group mandatory">

                            <label for="captcha_input" class="col-md-12 control-label">
                                Enter characters from the image</label>

                            <div class="col-md-12">
                                <input class="fvalue form-control input-sm" id="captcha_input" type="text"
                                       name="captcha" autocomplete="off" maxlength="4">

                                <div class="error-msg-placement"></div>
                                <div class="reload-captcha-image-container visible-md visible-lg">
                                    <a href="javascript:reloadCaptcha('/wl');">
                                        <img id="reload-captcha-image"
                                             src="https://cdn-iam.mercedes-benz.com/wl/images/reload3-28e2f7f.gif"
                                             alt='Reload image'
                                             title='Reload image'> Reload image
                                    </a>
                                </div>
                            </div>

Thanks

I have pushed a new release version 0.37 to prevent warnings in the latest version 0.110 of HA.

:warning: Home Assistant Core Version 0.110 or higher required

1 Like