Mercedes Me Component

Hi everyone, I’m new here and also a newcomer to HA! I tried to integrate Mercedes ME as described, the integration is visible, no entities appear!
What am I doing wrong? What did i forget Can someone give me a few tips, thanks for any support.

The pre-entry climate control can be set with a service call. If connected to an active wall box or charger, this will also enable the battery pre-conditioning.

  - type: picture-elements
    elements:
      - type: service-button
        title: Deactivate
        service: mbapi2020.preheat_stop
        service_data:
          vin: W1XXXXXXXXXXX0
        target: {}
        style:
          top: 80%
          left: 80%
      - type: service-button
        title: Activate
        service: mbapi2020.preheat_start
        service_data:
          vin: W1XXXXXXXXXXXX0
        target: {}
        style:
          top: 20%
          left: 20%
    image: /local/climate.PNG

image

The range automatically uses km as it’s a distance entity and HA can be set only metric or imperial. It will be miles if you change to imperial, but then you will also get fahrenheit instead of celsius, etc.

Create another entity in node red or a template in Configuration.yaml as a workaround.

My implementation for the EQC (based on mobiledude’s) and others are searchable on this thread.

1 Like

Hi all,

Slightly off-topic post here.

I subscribed to several Mercedes Me services to use with this integration. They recently expired and I’m trying to renew them (UK), so that I can get the status back into HA once again.

One that expired was “Remote Retrieval of Vehicle Status”, which is the one that I need to get things like Odometer, Warning Lights, Window status, Charge Status, etc.

In the Mercedes Me app, it lists this service with a Buy button next to it, but when I click on Buy to renew it, it takes me to the Mercedes Me store, which doesn’t list the Remote Retrival of Vehicle Status as an option.

Anyone got any idea how I can renew/repurchase this option? (I have a 2016 C350e if that makes any difference).

(I’ve tried reaching out to Mercedes, but you can only email them and I’ve had no response after several days).

Thanks!

This is my script… seems to do nothing :stuck_out_tongue:

alias: EQC Heater on
sequence:
  - service: mbapi2020.preheat_start
    data:
      vin: W1XXXXXXXXXX
      type: '0'
mode: single
icon: mdi:radiator

I’m not familiar with script syntax as I’ve never used them but looks fine. I think if you omit type: it must default to 0 as it’s not in the service call I use from lovelace, which I know works fine.

Thank you!

the ‘type’ field breaks the automation - it works without it :smiley:

Type 1 is for older cars who do not support the preheat “now” command, in this case i use
“immediate” command. Default is 0.

It would be cleaner if the data coming back from the API is represented as it’s unit of measure (also coming back in the API) rather than what the system is set to. I’ll do this work-around if Rene can’t get to this tweak.

Did you sign-in to the integration?
Have you checked the logs?

… it’s a bit tricky to try help out without a few more details on what you did/didn’t do…

1 Like

Hey Larsen, after reinstalling the integration, MB-Me works for me too. Sorry for my minimal description and thanks for your feedback. Greeting

2 Likes

Hi @Mobiledude & @ReneNulschDE ,

Love your programming and I’m trying to make a new view in my lovelace to have this kind of integration for my GLE 350 DE

I’ve copied and altered the sensors file into my sensor.yaml file, but unfortunately, the sensors are not visible on my picture elements card. Is sensors. yaml the correct file to put the template sensors in :slight_smile:


  - platform: template
    sensors:
        car_tire_pressure_rear_left:
          friendly_name: Tire pressure Rear Left
          value_template: '{{ states.binary_sensor.2_amu_833_tire_warning.attributes.tirepressureRearLeft }}'
        car_tire_pressure_rear_right:
          friendly_name: Tire pressure Rear Right
          value_template: '{{ states.binary_sensor.2_amu_833_tire_warning.attributes.tirepressureRearRight }}'
        car_tire_pressure_front_left:
          friendly_name: Tire pressure Front Left
          value_template: '{{ states.binary_sensor.2_amu_833_tire_warning.attributes.tirepressureFrontLeft }}'
        car_tire_pressure_front_right:
          friendly_name: Tire pressure Front Right
          value_template: '{{ states.binary_sensor.2_amu_833_tire_warning.attributes.tirepressureFrontRight }}'
        car_lock_front_right:
          friendly_name: Lock Front Right
          value_template: >-
            {% if is_state_attr('sensor.2_amu_833_lock', 'doorlockstatusfrontright', false)%}
                Closed
            {% else %}
                Open
            {% endif %}
          icon_template: >
            {% if is_state_attr('sensor.2_amu_833_lock', 'doorlockstatusfrontright', false)%}
              mdi:lock-outline
            {% else %} 
              mdi:lock-open-variant-outline
            {% endif %}
        car_lock_front_left:
          friendly_name: Lock Front Left
          value_template: >-
            {% if is_state_attr('sensor.2_amu_833_lock', 'doorlockstatusfrontleft', false)%}
                Closed
            {% else %}
                Open
            {% endif %}
          icon_template: >
            {% if is_state_attr('sensor.2_amu_833_lock', 'doorlockstatusfrontleft', false)%}
              mdi:lock-outline
            {% else %} 
              mdi:lock-open-variant-outline
            {% endif %}
        car_lock_rear_right:
          friendly_name: Lock Rear Right
          value_template: >-
            {% if is_state_attr('sensor.2_amu_833_lock', 'doorlockstatusrearright', false)%}
                Closed
            {% else %}
                Open
            {% endif %}
          icon_template: >
            {% if is_state_attr('sensor.2_amu_833_lock', 'doorlockstatusrearright', false)%}
              mdi:lock-outline
            {% else %} 
              mdi:lock-open-variant-outline
            {% endif %}
        car_lock_rear_left:
          friendly_name: Lock Rear Left
          value_template: >-
            {% if is_state_attr('sensor.2_amu_833_lock', 'doorlockstatusrearleft', false)%}
                Closed
            {% else %}
                Open
            {% endif %}
          icon_template: >
            {% if is_state_attr('sensor.2_amu_833_lock', 'doorlockstatusrearleft', false)%}
              mdi:lock-outline
            {% else %} 
              mdi:lock-open-variant-outline
            {% endif %}
        car_lock_trunk:
          friendly_name: Lock trunk
          value_template: >-
            {% if is_state_attr('sensor.2_amu_833_lock', 'decklidstatus', false)%} 
                Closed
            {% else %}
                Open
            {% endif %}
          icon_template: >
            {% if is_state_attr('sensor.2_amu_833_lock', 'decklidstatus', false)%} 
              mdi:lock-outline
            {% else %}
              mdi:lock-open-variant-outline
            {% endif %}
        car_lock_hood:
          friendly_name: Lock hood
          value_template: >-
            {% if is_state_attr('sensor.2_amu_833_lock', 'hoodStateRollup', false)%} 
                Closed
            {% else %}
                Open
            {% endif %}
          icon_template: >
            {% if is_state_attr('sensor.2_amu_833_lock', 'hoodStateRollup', false)%} 
              mdi:lock-outline
            {% else %}
              mdi:lock-open-variant-outline
            {% endif %}
        car_window_front_left:
          friendly_name: Window Front Left
          value_template: >-
            {% if is_state_attr('binary_sensor.2_amu_833_windows_closed', 'windowstatusfrontleft', '2')%} 
                Closed
            {% else %}
                Open
            {% endif %}
          icon_template: >
            {% if is_state_attr('binary_sensor.2_amu_833_windows_closed', 'windowstatusfrontleft', '2')%} 
              mdi:window-closed
            {% else %}
              mdi:window-open
            {% endif %}
        car_window_front_right:
          friendly_name: Window Front Right
          value_template: >-
            {% if is_state_attr('binary_sensor.2_amu_833_windows_closed', 'windowstatusfrontright', '2')%} 
                Closed
            {% else %}
                Open
            {% endif %}
          icon_template: >
            {% if is_state_attr('binary_sensor.2_amu_833_windows_closed', 'windowstatusfrontright', '2')%} 
              mdi:window-closed
            {% else %}
              mdi:window-open
            {% endif %}
        car_window_rear_left:
          friendly_name: Window Rear Left
          value_template: >-
            {% if is_state_attr('binary_sensor.2_amu_833_windows_closed', 'windowstatusrearleft', '2')%} 
                Closed
            {% else %}
                Open
            {% endif %}
          icon_template: >
            {% if is_state_attr('binary_sensor.2_amu_833_windows_closed', 'windowstatusrearleft', '2')%} 
              mdi:window-closed
            {% else %}
              mdi:window-open
            {% endif %}
        car_window_rear_right:
          friendly_name: Window Rear Right
          value_template: >-
            {% if is_state_attr('binary_sensor.2_amu_833_windows_closed', 'windowstatusrearright', '2')%} 
                Closed
            {% else %}
                Open
            {% endif %}
          icon_template: >
            {% if is_state_attr('binary_sensor.2_amu_833_windows_closed', 'windowstatusrearright', '2')%} 
              mdi:window-closed
            {% else %}
              mdi:window-open
            {% endif %}
        car_window_sunroof:
            friendly_name: Window Sunroof
            value_template: >-
              {% if is_state_attr('sensor.2_amu_833_lock', 'sunroofstatus', '0')%} 
                Closed
              {% else %}
                Open
              {% endif %}
            icon_template: >
              {% if is_state_attr('sensor.2_amu_833_lock', 'sunroofstatus', '0')%} 
                    mdi:checkbox-blank-circle-outline
                  {% else %}
                    mdi:checkbox-marked-circle-outline
                  {% endif %}        

Thanks in advance !

Kr,

Bart

HI Robert,

Where do you put this code ? Directly in configuration.yaml ? Or in template.yaml (include folder)

Thx !!

Bart

It’s Richard, but no problem :slight_smile:

Yes, I put all my code in the configuration.yaml, but you can do it in any separate yaml as long as it’s included.

I assume you’ve clicked on the configuration checker for errors? Next check Developer Tools to see if they are exposed and working as expected.

Sorry Richard :-),

I’ve tried several things, including pasting into the configuration.yaml. When I put it at the configuration.yaml, it interferes with my other declarations in that file, ending up in following error:

Invalid config for [light.template]: [sensors] is an invalid option for [light.template]. Check: light.template->sensors. (See ?, line ?).
Invalid config for [sensor.template]: invalid template (TemplateSyntaxError: expected token ‘end of print statement’, got ‘_amu_833_tire_warning’) for dictionary value @ data[‘sensors’][‘car_tire_pressure_front_left’][‘value_template’]. Got ‘{{ states.binary_sensor.2_amu_833_tire_warning.attributes.tirepressureFrontLeft }}’
invalid template (TemplateSyntaxError: expected token ‘end of print statement’, got ‘_amu_833_tire_warning’) for dictionary value @ data[‘sensors’][‘car_tire_pressure_front_right’][‘value_template’]. Got ‘{{ states.binary_sensor.2_amu_833_tire_warning.attributes.tirepressureFrontRight }}’
invalid template (TemplateSyntaxError: expected token ‘end of print statement’, got ‘_amu_833_tire_warning’) for dictionary value @ data[‘sensors’][‘car_tire_pressure_rear_left’][‘value_template’]. Got ‘{{ states.binary_sensor.2_amu_833_tire_warning.attributes.tirepressureRearLeft }}’
invalid template (TemplateSyntaxError: expected token ‘end of print statement’, got ‘_amu_833_tire_warning’) for dictionary value @ data[‘sensors’][‘car_tire_pressure_rear_right’][‘value_template’]. Got ‘{{ states.binary_sensor.2_amu_833_tire_warning.attributes.tirepressureRearRight }}’. (See ?, line ?).

Partial code of the configuration yaml as follows:

light:
  - platform: group
    name: Keuken lights
    entities:
      - light.dimbare_spot_gu10_1
      - light.dimbare_spot_gu10_2
  - platform: group
    name: Gang lights
    entities:
      - light.hue_ambiance_lamp_1_gang
      - light.hue_ambiance_lamp_2_gang
  - platform: group
    name: Buiten Spots
    entities:
      - light.hue_color_spot_1_overkapping
      - light.hue_color_spot_2_overkapping
      - light.hue_color_spot_3_overkapping
      - light.hue_color_spot_4_overkapping
      - light.hue_color_spot_5_overkapping
      - light.hue_color_spot_6_overkapping
      
  - platform: template
    sensors:
      car_tire_pressure_rear_left:
        friendly_name: Tire pressure Rear Left
        value_template: '{{ states.binary_sensor.2_amu_833_tire_warning.attributes.tirepressureRearLeft }}'
      car_tire_pressure_rear_right:
        friendly_name: Tire pressure Rear Right
        value_template: '{{ states.binary_sensor.2_amu_833_tire_warning.attributes.tirepressureRearRight }}'
      car_tire_pressure_front_left:
        friendly_name: Tire pressure Front Left
        value_template: '{{ states.binary_sensor.2_amu_833_tire_warning.attributes.tirepressureFrontLeft }}'
      car_tire_pressure_front_right:
        friendly_name: Tire pressure Front Right
        value_template: '{{ states.binary_sensor.2_amu_833_tire_warning.attributes.tirepressureFrontRight }}'
      car_lock_front_right:
        friendly_name: Lock Front Right
        value_template: >-
          {% if is_state_attr('sensor.2_amu_833_lock', 'doorlockstatusfrontright', false)%}
              Closed
          {% else %}
              Open
          {% endif %}
        icon_template: >
          {% if is_state_attr('sensor.2_amu_833_lock', 'doorlockstatusfrontright', false)%}
            mdi:lock-outline
          {% else %} 
            mdi:lock-open-variant-outline
          {% endif %}
      car_lock_front_left:
        friendly_name: Lock Front Left
        value_template: >-
          {% if is_state_attr('sensor.2_amu_833_lock', 'doorlockstatusfrontleft', false)%}
              Closed
          {% else %}
              Open
          {% endif %}
        icon_template: >
          {% if is_state_attr('sensor.2_amu_833_lock', 'doorlockstatusfrontleft', false)%}
            mdi:lock-outline
          {% else %} 
            mdi:lock-open-variant-outline
          {% endif %}
      car_lock_rear_right:
        friendly_name: Lock Rear Right
        value_template: >-
          {% if is_state_attr('sensor.2_amu_833_lock', 'doorlockstatusrearright', false)%}
              Closed
          {% else %}
              Open
          {% endif %}
        icon_template: >
          {% if is_state_attr('sensor.2_amu_833_lock', 'doorlockstatusrearright', false)%}
            mdi:lock-outline
          {% else %} 
            mdi:lock-open-variant-outline
          {% endif %}
      car_lock_rear_left:
        friendly_name: Lock Rear Left
        value_template: >-
          {% if is_state_attr('sensor.2_amu_833_lock', 'doorlockstatusrearleft', false)%}
              Closed
          {% else %}
              Open
          {% endif %}
        icon_template: >
         {% if is_state_attr('sensor.2_amu_833_lock', 'doorlockstatusrearleft', false)%}
            mdi:lock-outline
          {% else %} 
            mdi:lock-open-variant-outline
          {% endif %}
      car_lock_trunk:
        friendly_name: Lock trunk
        value_template: >-
          {% if is_state_attr('sensor.2_amu_833_lock', 'decklidstatus', false)%} 
              Closed
          {% else %}
              Open
          {% endif %}
        icon_template: >
          {% if is_state_attr('sensor.2_amu_833_lock', 'decklidstatus', false)%} 
            mdi:lock-outline
          {% else %}
            mdi:lock-open-variant-outline
          {% endif %}
      car_lock_hood:
        friendly_name: Lock hood
        value_template: >-
          {% if is_state_attr('sensor.2_amu_833_lock', 'hoodStateRollup', false)%} 
              Closed
          {% else %}
              Open
          {% endif %}
        icon_template: >
         {% if is_state_attr('sensor.2_amu_833_lock', 'hoodStateRollup', false)%} 
            mdi:lock-outline
          {% else %}
            mdi:lock-open-variant-outline
          {% endif %}
      car_window_front_left:
        friendly_name: Window Front Left
        value_template: >-
          {% if is_state_attr('binary_sensor.2_amu_833_windows_closed', 'windowstatusfrontleft', '2')%} 
              Closed
          {% else %}
             Open
          {% endif %}
        icon_template: >
          {% if is_state_attr('binary_sensor.2_amu_833_windows_closed', 'windowstatusfrontleft', '2')%} 
            mdi:window-closed
          {% else %}
            mdi:window-open
          {% endif %}

I know I can’t put the - platform: template under my grouping of lights, but have no clue how to solve this. Creating a different .yaml file in the include folder didn’t help

Kr,

Bart

Hi Bart,

It’s a simple fix. After (or before) your light group, enter the car sensors starting like this:

sensor:
  - platform: template
    sensors:

Hi Richard,

Unfortunately, still have no sensors available. Checked for the entities in developer tools, but they AREN’t recognized…

Maybe something to do with spacing ???

sensors:
  - type: template
    sensors:
      car_tire_pressure_rear_left:
        friendly_name: Tire pressure Rear Left
        value_template: '{{ states.binary_sensor.2_amu_833_tire_warning.attributes.tirepressureRearLeft }}'
      car_tire_pressure_rear_right:
        friendly_name: Tire pressure Rear Right
        value_template: '{{ states.binary_sensor.2_amu_833_tire_warning.attributes.tirepressureRearRight }}'
      car_tire_pressure_front_left:
        friendly_name: Tire pressure Front Left
        value_template: '{{ states.binary_sensor.2_amu_833_tire_warning.attributes.tirepressureFrontLeft }}'
      car_tire_pressure_front_right:
        friendly_name: Tire pressure Front Right
        value_template: '{{ states.binary_sensor.2_amu_833_tire_warning.attributes.tirepressureFrontRight }}'
      car_lock_front_right:
        friendly_name: Lock Front Right
        value_template: >-
          {% if is_state_attr('sensor.2_amu_833_lock', 'doorlockstatusfrontright', false)%}
              Closed
          {% else %}
              Open
          {% endif %}
        icon_template: >
          {% if is_state_attr('sensor.2_amu_833_lock', 'doorlockstatusfrontright', false)%}
            mdi:lock-outline
          {% else %} 
            mdi:lock-open-variant-outline
          {% endif %}
      car_lock_front_left:
        friendly_name: Lock Front Left
        value_template: >-
          {% if is_state_attr('sensor.2_amu_833_lock', 'doorlockstatusfrontleft', false)%}
              Closed
          {% else %}
              Open
          {% endif %}
        icon_template: >
          {% if is_state_attr('sensor.2_amu_833_lock', 'doorlockstatusfrontleft', false)%}
            mdi:lock-outline
          {% else %} 
            mdi:lock-open-variant-outline
          {% endif %}

No, it’s the first two lines. Replace with those in my previous post.

Hi Richard,

How stupid of me :slight_smile: Feeling ridiculous :slight_smile:

However, now the entities are visible and my picture template card is populating… still a lot of no-matches, but probably that has something to do witch mapping of the entities:

Thanks a lot Richard, you helped me out !

Kr,

Bart

Hi RICHARD,;

Last question :slight_smile:

How did you display everything in your lovelace ? Are you using grid or stack-cards ? Just curious about your code

Thx mate,

Kr,

Bart

Hi Bart,

Grid & picture elements. If you scroll back far enough you can find all of my code (based on mobiledude’s implementation).

KR