Mercedes Me Component

I am so thankfull @ReneNulschDE is working on this!
Based on some inspiration, code and images from this forum I created this picture elements card.

  1. I used this code, to create sensors out of the attributes from the integration

NOTE: adjust it with your own sensors ofcourse!!

## this yaml file creates seperate sensors in HA for the attributes derrived from the Benz sensors. Credits to Rene Nulsch for creating this awesome MercedesMe integration!
## I am not a programmer, this is all derrived from everywhere around the forum, re-use of images, inspiration and code.
## For me, having a splitted Home Assistant config I created this yaml file, named it mercedessensor.yaml and placed it in my sensors directory within home assistant
## I guess it can be part of your configuration file as well..... 


- platform: template
  sensors:
    car_tire_pressure_rear_left:
      friendly_name: Tire pressure Rear Left
      value_template: '{{ states.binary_sensor.g_646_lz_tire_warning.attributes.tirepressureRearLeft }}'
    car_tire_pressure_rear_right:
      friendly_name: Tire pressure Rear Right
      value_template: '{{ states.binary_sensor.g_646_lz_tire_warning.attributes.tirepressureRearRight }}'
    car_tire_pressure_front_left:
      friendly_name: Tire pressure Front Left
      value_template: '{{ states.binary_sensor.g_646_lz_tire_warning.attributes.tirepressureFrontLeft }}'
    car_tire_pressure_front_right:
      friendly_name: Tire pressure Front Right
      value_template: '{{ states.binary_sensor.g_646_lz_tire_warning.attributes.tirepressureFrontRight }}'
    
    
    car_lock_front_right:
      friendly_name: Lock Front Right
      value_template: >-
        {% if is_state_attr('sensor.g_646_lz_lock', 'doorlockstatusfrontright', false)%}
            Closed
        {% else %}
            Open
        {% endif %}
      icon_template: >
        {% if is_state_attr('sensor.g_646_lz_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.g_646_lz_lock', 'doorlockstatusfrontleft', false)%}
            Closed
        {% else %}
            Open
        {% endif %}
      icon_template: >
        {% if is_state_attr('sensor.g_646_lz_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.g_646_lz_lock', 'doorlockstatusrearright', false)%}
            Closed
        {% else %}
            Open
        {% endif %}
      icon_template: >
        {% if is_state_attr('sensor.g_646_lz_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.g_646_lz_lock', 'doorlockstatusrearleft', false)%}
            Closed
        {% else %}
            Open
        {% endif %}
      icon_template: >
        {% if is_state_attr('sensor.g_646_lz_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.g_646_lz_lock', 'decklidstatus', false)%} 
            Closed
        {% else %}
            Open
        {% endif %}
      icon_template: >
        {% if is_state_attr('sensor.g_646_lz_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.g_646_lz_lock', 'hoodStateRollup', false)%} 
            Closed
        {% else %}
            Open
        {% endif %}
      icon_template: >
        {% if is_state_attr('sensor.g_646_lz_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.g_646_lz_windows_closed', 'windowstatusfrontleft', '2')%} 
            Closed
        {% else %}
            Open
        {% endif %}
      icon_template: >
        {% if is_state_attr('binary_sensor.g_646_lz_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.g_646_lz_windows_closed', 'windowstatusfrontright', '2')%} 
            Closed
        {% else %}
            Open
        {% endif %}
      icon_template: >
        {% if is_state_attr('binary_sensor.g_646_lz_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.g_646_lz_windows_closed', 'windowstatusrearleft', '2')%} 
            Closed
        {% else %}
            Open
        {% endif %}
      icon_template: >
        {% if is_state_attr('binary_sensor.g_646_lz_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.g_646_lz_windows_closed', 'windowstatusrearright', '2')%} 
            Closed
        {% else %}
            Open
        {% endif %}
      icon_template: >
        {% if is_state_attr('binary_sensor.g_646_lz_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.g_646_lz_lock', 'sunroofstatus', '0')%} 
            Closed
          {% else %}
            Open
          {% endif %}
        icon_template: >
          {% if is_state_attr('sensor.g_646_lz_lock', 'sunroofstatus', '0')%} 
            mdi:checkbox-blank-circle-outline
          {% else %}
            mdi:checkbox-marked-circle-outline
          {% endif %}

  1. upload this picture to your www directory of HA. I made it transparant. :wink:

download PNG here: https://ibb.co/vYJmQ0j

  1. next I used the following yaml in the picture elements card.
## This is the card yaml, based on a picture-elements card. just create one in yourlovelace dashboard and copy and past in your card.

elements:
  - entity: sensor.g_646_lz_fuel_level
    prefix: ''
    style:
      transform: 'translate(-50%, -50%) scale(1.3, 1.3)'
      color: lightgrey
      left: 15%
      top: 17%
    type: state-label
  - entity: sensor.g_646_lz_odometer
    prefix: ' '
    style:
      transform: 'translate(-50%, -50%) scale(1.3, 1.3)'
      color: lightgrey
      left: 39%
      top: 17%
    type: state-label
  - entity: sensor.car_window_sunroof
    style:
      transform: 'translate(-50%, -50%) scale(0.7, 0.7)'
      '--paper-item-icon-color': null
      left: 57%
      top: 17.5%
    type: state-icon
  - entity: binary_sensor.g_646_lz_tire_warning
    prefix: ''
    style:
      transform: 'translate(-50%, -50%) scale(0.7, 0.7)'
      color: '#FFFFFF'
      left: 66.5%
      top: 17.5%
    type: state-icon
  - entity: binary_sensor.g_646_lz_low_brake_fluid_warning
    prefix: ''
    style:
      transform: 'translate(-50%, -50%) scale(0.7, 0.7)'
      color: '#FFFFFF'
      left: 76%
      top: 17.5%
    type: state-icon
  - entity: binary_sensor.g_646_lz_low_coolant_level_warning
    prefix: ''
    style:
      transform: 'translate(-50%, -50%) scale(0.7, 0.7)'
      color: '#FFFFFF'
      left: 85.5%
      top: 17.5%
    type: state-icon
  - entity: binary_sensor.g_646_lz_low_wash_water_warning
    prefix: ''
    style:
      transform: 'translate(-50%, -50%) scale(0.7, 0.7)'
      color: '#FFFFFF'
      left: 95%
      top: 17.5%
    type: state-icon
  - entity: sensor.car_tire_pressure_front_right
    style:
      transform: 'translate(-50%, -50%) scale(0.8, 0.8)'
      color: lightgrey
      left: 38%
      top: 32%
    type: state-label
  - entity: sensor.car_tire_pressure_rear_right
    style:
      transform: 'translate(-50%, -50%) scale(0.8, 0.8)'
      color: lightgrey
      left: 84%
      top: 32%
    type: state-label
  - entity: sensor.car_tire_pressure_front_left
    style:
      transform: 'translate(-50%, -50%) scale(0.7, 0.7)'
      color: lightgrey
      left: 38%
      top: 90%
    type: state-label
  - entity: sensor.car_tire_pressure_rear_left
    style:
      transform: 'translate(-50%, -50%) scale(0.8, 0.8)'
      color: lightgrey
      left: 84%
      top: 90%
    type: state-label
  - entity: sensor.car_lock_front_right
    style:
      '--paper-item-icon-color': white
      transform: 'translate(-50%, -50%) scale(0.7, 0.7)'
      left: 61%
      top: 38%
    type: state-icon
  - entity: sensor.car_lock_rear_right
    style:
      '--paper-item-icon-color': white
      transform: 'translate(-50%, -50%) scale(0.7, 0.7)'
      left: 68%
      top: 38%
    type: state-icon
  - entity: sensor.car_lock_front_left
    style:
      '--paper-item-icon-color': white
      transform: 'translate(-50%, -50%) scale(0.7, 0.7)'
      left: 61%
      top: 83%
    type: state-icon
  - entity: sensor.car_lock_rear_left
    style:
      '--paper-item-icon-color': white
      transform: 'translate(-50%, -50%) scale(0.7, 0.7)'
      left: 68%
      top: 83%
    type: state-icon
  - entity: sensor.car_lock_trunk
    style:
      '--paper-item-icon-color': white
      transform: 'translate(-50%, -50%) scale(0.7, 0.7)'
      left: 95%
      top: 60%
    type: state-icon
  - entity: sensor.car_window_front_right
    style:
      '--paper-item-icon-color': lightgrey
      transform: 'translate(-50%, -50%) scale(0.7, 0.7)'
      left: 56%
      top: 31%
    type: state-icon
  - entity: sensor.car_window_rear_right
    style:
      '--paper-item-icon-color': lightgrey
      transform: 'translate(-50%, -50%) scale(0.7, 0.7)'
      left: 73%
      top: 31%
    type: state-icon
  - entity: sensor.car_window_front_left
    style:
      '--paper-item-icon-color': lightgrey
      transform: 'translate(-50%, -50%) scale(0.7, 0.7)'
      left: 56%
      top: 90%
    type: state-icon
  - entity: sensor.car_window_rear_left
    style:
      '--paper-item-icon-color': lightgrey
      transform: 'translate(-50%, -50%) scale(0.7, 0.7)'
      left: 73%
      top: 90%
    type: state-icon
  - entity: binary_sensor.g_646_lz_park_brake_status
    prefix: ''
    style:
      transform: 'translate(-50%, -50%) scale(0.6, 0.6)'
      color: '#FFFFFF'
      left: 11%
      top: 42%
    type: state-icon
  - entity: binary_sensor.g_646_lz_windows_closed
    prefix: ''
    style:
      transform: 'translate(-50%, -50%) scale(0.6, 0.6)'
      color: '#FFFFFF'
      left: 11%
      top: 52%
    type: state-icon
  - entity: sensor.g_646_lz_lock
    prefix: ''
    style:
      color: '#FFFFFF'
      left: 11%
      top: 64%
    type: state-label
  - entity: device_tracker.g_646_lz_device_tracker
    prefix: ''
    style:
      color: lightgrey
      left: 11%
      top: 77%
    type: state-label
image: /local/mercnew.png
type: picture-elements

Enjoy playing around…moving around the sensors can create sometimes headaches :-). I would love to see more variants on this. I am not happy with the lock status 2, but since my programming skills are limited…it takes some time to figure thinks out hehehehe.

18 Likes