Mercedes Me Component

Hi,

I don’t have some attributes in some binary sensors/sensors, like:

  • warninglowbattery
  • tankReserveLamp
  • liquidconsumptionstart

Is it normal?

Have someone the same situation?

Thanks

Restarting HA did update.

Thank you for your work and contributions.

I guess it’s normal, I do have liquidconsumptionstart but not the other two (W177/A220).

Hi,

this depends on your car model, configuration (+build year) and the money that you spend. Some cars report the lightswitchposition and other cars the Odometer only.

BR
Rene

Hi,

Thanks @ReneNulschDE and @robertklep.

I just found it strange to be just a few attributes. For example, in the warningenginelight binary sensor, I have all the attributes (warningbrakefluid, warningwashwater and warningcoolantlevellow) except the warninglowbattery.

At mercedes me app I have the battery status indication.

BR
Joca

Hi,

wait: We had this problem with the old component too that sometimes attributes are missing. I have never found a reason and flagged this as HA-magic.

Could you change the line 41 in client.py to true and restart HA? Wait until the sensors are loaded. Jump the to the messages folder in custom_components/mbapi2020 and pick the largest new json file. Search for warninglowbattery this file. Is it in the file?

Don’t forget to change the line 41 back to false.

BR
Rene

Hi @ReneNulschDE,

I can’t found this option at line 41:

sorry - line 43 - uupps this is true already. Then take a look in to the messages folder. I will push an update to the repo that sets it to false.

Hi,

Line 43 has always been true (I never changed it).
I don’t find warninglowbattery in the largest file (I have several of the same size)

BR
Joca

Line43: Yes, my mistake - I pushed it with true to the repo but it should be false to save your disk space.

OK, looks like MB does not report this attribute for your car.

BR
Rene

Thanks anyway @ReneNulschDE.

BR
Joca

Hi, can you share the new card with the liquid range and days until service? Thanks

sure. here you go.

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.car_rangeliquid
    prefix: ''
    style:
      transform: 'translate(-50%, -50%) scale(0.7, 0.7)'
      color: lightgrey
      left: 17%
      top: 6%
    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_service_days
    prefix: ' '
    style:
      transform: 'translate(-50%, -50%) scale(0.7, 0.7)'
      color: lightgrey
      left: 45%
      top: 6%
    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: 9%
      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: 9%
      top: 52%
    type: state-icon
  - entity: sensor.my_car_lock_status
    prefix: ''
    style:
      transform: 'translate(-50%, -50%) scale(0.7, 0.7)'
      color: lightgrey
      left: 16.5%
      top: 64%
    type: state-label
  - entity: device_tracker.g_646_lz_device_tracker
    prefix: ''
    style:
      transform: 'translate(-50%, -50%) scale(0.7, 0.7)'
      color: lightgrey
      left: 10.5%
      top: 77%
    type: state-label
image: /local/mercnew.png
type: picture-elements


2 Likes

Can you share this card? I’m specially interested in the charging information. Thanks

1 Like

Hi.
I have a strange behavior with device tracker. I always see my car at home. Yesterday I’ve moved it outside of my garage… but the position was indicating home… (I moved about 15 km)…
With Mercedes me application I saw the right position.
Any idea? Thanks…

Hi,

this is a problem with the underlaying websocket connection. The connection is not very stable currently. Restart HA and then it should work again. I will rework this part over the weekend.

BR
Rene

1 Like

Here we go, it is picture-elements of course. Since the sensor names contain the registration number, the names have been altered. German labels.

          - type: picture-elements
            image: "/local/lovelace/mercedes.jpg"
            elements:
              - type: icon
                icon: mdi:gas-station
                style:
                  # Positioning of the element
                  left: 73%
                  top: 5%
                  color: black
                  max-width: 1px
              - type: state-label
                entity: binary_sensor.aa_a_1234e_liquid_range_critical
                prefix: "Warnung Benzinreserve: "
                style:
                  # Positioning of the element
                  left: 75%
                  top: 5%
                  color: black
                  max-width: 1px
              - type: icon
                icon: mdi:car-brake-alert
                style:
                  # Positioning of the element
                  left: 73%
                  top: 10%
                  color: black
                  max-width: 1px
              - type: state-label
                entity: binary_sensor.aa_a_1234e_low_brake_fluid_warning
                prefix: "Warnung Bremsflüssigkeit: "
                style:
                  # Positioning of the element
                  left: 75%
                  top: 10%
                  color: black
                  max-width: 1px
              - type: icon
                icon: mdi:car-coolant-level
                style:
                  # Positioning of the element
                  left: 73%
                  top: 15%
                  color: black
                  max-width: 1px
              - type: state-label
                entity: binary_sensor.aa_a_1234e_low_coolant_level_warning
                prefix: "Warnung Kühlflüssigkeit: "
                style:
                  # Positioning of the element
                  left: 75%
                  top: 15%
                  color: black
                  max-width: 1px
              - type: icon
                icon: mdi:wiper-wash
                style:
                  # Positioning of the element
                  left: 73%
                  top: 20%
                  color: black
                  max-width: 1px
              - type: state-label
                entity: binary_sensor.aa_a_1234e_low_wash_water_warning
                prefix: "Warnung Wischwasser: "
                style:
                  # Positioning of the element
                  left: 75%
                  top: 20%
                  color: black
                  max-width: 1px
              - type: icon
                icon: mdi:car-tire-alert
                style:
                  # Positioning of the element
                  left: 73%
                  top: 25%
                  color: black
                  max-width: 1px
              - type: state-label
                entity: binary_sensor.aa_a_1234e_tire_warning
                prefix: "Warnung Reifendruck: "
                style:
                  # Positioning of the element
                  left: 75%
                  top: 25%
                  color: black
                  max-width: 1px
              - type: icon
                icon: mdi:car-cog
                style:
                  # Positioning of the element
                  left: 73%
                  top: 30%
                  color: black
                  max-width: 1px
              - type: state-label
                entity: sensor.aa_a_1234e_odometer
                prefix: "Service in "
                attribute: serviceintervaldays
                suffix: " Tagen"
                style:
                  # Positioning of the element
                  left: 75%
                  top: 30%
                  color: black
                  max-width: 1px
              - type: state-label
                entity: binary_sensor.aa_a_1234e_tire_warning
                suffix: " kPa"
                attribute: tirepressureFrontLeft
                style:
                  # Positioning of the element
                  left: 34%
                  top: 20%
                  color: black
                  max-width: 1px
              - type: state-label
                entity: binary_sensor.aa_a_1234e_tire_warning
                suffix: " kPa"
                attribute: tirepressureFrontRight
                style:
                  # Positioning of the element
                  left: 60%
                  top: 20%
                  color: black
                  max-width: 1px
              - type: state-label
                entity: binary_sensor.aa_a_1234e_tire_warning
                suffix: " kPa"
                attribute: tirepressureRearLeft
                style:
                  # Positioning of the element
                  left: 34%
                  top: 75%
                  color: black
                  max-width: 1px
              - type: state-label
                entity: binary_sensor.aa_a_1234e_tire_warning
                suffix: " kPa"
                attribute: tirepressureRearRight
                style:
                  # Positioning of the element
                  left: 60%
                  top: 75%
                  color: black
                  max-width: 1px
              - type: icon 
                icon: mdi:car-door-lock
                style:
                  # Positioning of the element
                  left: 3%
                  top: 5%
                  color: black
                  max-width: 1px
              - type: state-label
                entity: sensor.aa_a_1234e_lock2
                prefix: "Zentralverriegelung: "
                style:
                  # Positioning of the element
                  left: 5%
                  top: 5%
                  color: black
                  max-width: 1px
              - type: icon 
                icon: mdi:car-door
                style:
                  # Positioning of the element
                  left: 3%
                  top: 10%
                  color: black
                  max-width: 1px
              - type: state-label
                entity: binary_sensor.aa_a_1234e_windows_closed
                prefix: "Fenster geschlossen: "
                style:
                  # Positioning of the element
                  left: 5%
                  top: 10%
                  color: black
                  max-width: 1px
              - type: icon 
                icon: mdi:car-brake-parking
                style:
                  # Positioning of the element
                  left: 3%
                  top: 15%
                  color: black
                  max-width: 1px
              - type: state-label
                entity: binary_sensor.aa_a_1234e_park_brake_status
                prefix: "Parkbremse: "
                style:
                  # Positioning of the element
                  left: 5%
                  top: 15%
                  color: black
                  max-width: 1px
              - type: icon
                icon: mdi:battery-medium
                style:
                  # Positioning of the element
                  left: 3%
                  top: 75%
                  color: black
                  max-width: 1px
              - type: state-label
                entity: sensor.aa_a_1234e_range_electric
                prefix: "Elektrische Reichweite: "
                style:
                  # Positioning of the element
                  left: 5%
                  top: 75%
                  color: black
                  max-width: 1px
              - type: icon
                icon: mdi:battery-medium
                style:
                  # Positioning of the element
                  left: 3%
                  top: 80%
                  color: black
                  max-width: 1px
              - type: state-label
                entity: sensor.aa_a_1234e_range_electric
                prefix: "Batteriefüllstand: "
                attribute: soc
                suffix: "%"
                style:
                  # Positioning of the element
                  left: 5%
                  top: 80%
                  color: black
                  max-width: 1px
              - type: icon
                icon: mdi:water
                style:
                  # Positioning of the element
                  left: 3%
                  top: 85%
                  color: black
                  max-width: 1px
              - type: state-label
                entity: sensor.aa_a_1234e_odometer
                prefix: "Diesel Reichweite: "
                attribute: rangeliquid
                suffix: " km"
                style:
                  # Positioning of the element
                  left: 5%
                  top: 85%
                  color: black
                  max-width: 1px
              - type: icon
                icon: mdi:water-percent
                style:
                  # Positioning of the element
                  left: 3%
                  top: 90%
                  color: black
                  max-width: 1px
              - type: state-label
                entity: sensor.aa_a_1234e_odometer
                prefix: "Diesel Tank: "
                attribute: tanklevelpercent
                suffix: "%"
                style:
                  # Positioning of the element
                  left: 5%
                  top: 90%
                  color: black
                  max-width: 1px
              - type: icon
                icon: mdi:water-percent
                style:
                  # Positioning of the element
                  left: 3%
                  top: 95%
                  color: black
                  max-width: 1px
              - type: state-label
                entity: sensor.aa_a_1234e_odometer
                prefix: "AdBlue Tank: "
                attribute: tankLevelAdBlue
                suffix: "%"
                style:
                  # Positioning of the element
                  left: 5%
                  top: 95%
                  color: black
                  max-width: 1px
                  
              - type: icon
                icon: mdi:counter
                style:
                  # Positioning of the element
                  left: 73%
                  top: 80%
                  color: black
                  max-width: 1px
              - type: state-label
                entity: sensor.aa_a_1234e_odometer
                prefix: "Gesamt: "
                style:
                  # Positioning of the element
                  left: 75%
                  top: 80%
                  color: black
                  max-width: 1px
              - type: icon
                icon: mdi:car-electric
                style:
                  # Positioning of the element
                  left: 73%
                  top: 85%
                  color: black
                  max-width: 1px
              - type: state-label
                entity: sensor.aa_a_1234e_odometer
                prefix: "Elektrisch: "
                attribute: distanceZEReset
                suffix: " km"
                style:
                  # Positioning of the element
                  left: 75%
                  top: 85%
                  color: black
                  max-width: 1px
              - type: icon
                icon: mdi:water
                style:
                  # Positioning of the element
                  left: 73%
                  top: 90%
                  color: black
                  max-width: 1px
              - type: state-label
                entity: sensor.aa_a_1234e_odometer
                prefix: "Diesel: "
                attribute: liquidconsumptionreset
                suffix: " l/100km"
                style:
                  # Positioning of the element
                  left: 75%
                  top: 90%
                  color: black
                  max-width: 1px
              - type: icon
                icon: mdi:battery-medium
                style:
                  # Positioning of the element
                  left: 73%
                  top: 95%
                  color: black
                  max-width: 1px
              - type: state-label
                entity: sensor.aa_a_1234e_range_electric
                prefix: "Elektrisch: "
                attribute: electricconsumptionreset
                suffix: " kWh/100km"
                style:
                  # Positioning of the element
                  left: 75%
                  top: 95%
                  color: black
                  max-width: 1px
                  
# Start of Charging switch / sensors

              - type: state-icon
                entity: switch.c300de
                icon: mdi:ev-station
                tap_action:
                  action: toggle
                style:
                  # Positioning of the element
                  left: 3%
                  top: 45%
                  color: black
                  max-width: 1px
                  height: 60px
                  width: 60px
                  --mdc-icon-size: 100px

              - type: conditional
                conditions:
                  - entity: switch.c300de
                    state: 'on'
                elements:
                  - type: state-badge
                    entity: sensor.c300de_remaining
                    style:
                      # Positioning of the element
                      left: 9%
                      top: 50%
                      max-width: 1px
                  - type: state-badge
                    entity: sensor.c300de_energy
                    style:
                      # Positioning of the element
                      left: 15%
                      top: 50%
                      max-width: 1px
                  - type: state-badge
                    entity: sensor.c300de_temperature
                    style:
                      # Positioning of the element
                      left: 21%
                      top: 50%
                      max-width: 1px
              - type: conditional
                conditions:
                  - entity: sensor.c300de_energy
                    state_not: '0'
                  - entity: sensor.c300de_energy
                    state_not: '2'
                elements:
                  - type: icon
                    icon: mdi:ev-station
                    style:
                      # Positioning of the element
                      left: 3%
                      top: 70%
                      color: black
                      max-width: 1px
                  - type: state-label
                    entity: sensor.aa_a_1234e_charging
                    style:
                      # Positioning of the element
                      left: 5%
                      top: 70%
                      color: black
                      max-width: 1px
              - type: state-label
                entity: sensor.c300de_lastupdated
                prefix: "Letzte Aktualisierung: "
                style:
                  # Positioning of the element
                  left: 50%
                  top: 2%
                  color: black
                  font-size: 50%

Nodered flow that calculates the charging end time (updates every 15 seconds):

[{"id":"7b313be7.3a45a4","type":"poll-state","z":"ba901ebf.b2a9a","name":"","server":"2b393d9c.07d642","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"updateinterval":"15","updateIntervalUnits":"seconds","outputinitially":true,"outputonchanged":false,"entity_id":"sensor.aa_a_1234e_range_electric","state_type":"str","halt_if":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"x":310,"y":80,"wires":[["8b5e6096.72eba"]]},{"id":"8b5e6096.72eba","type":"function","z":"ba901ebf.b2a9a","name":"","func":"var charge = parseInt(msg.data.attributes.soc);\n\nvar remaining = 100 - charge;\nif(remaining == 0) {\n    msg.payload = \"--:--\";\n    return msg;\n}\n\nvar millis = parseInt(msg.data.attributes.endofchargetime) * 1000;\nvar t = new Date(msg.data.last_updated);\nvar end = new Date(t.getTime()+millis);\n\nvar datetext = end.toTimeString().split(' ')[0].substring(0,5);\nmsg.payload = datetext;\n\nreturn msg;\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":680,"y":120,"wires":[["b277e884.7f1fd8"]]},{"id":"b277e884.7f1fd8","type":"mqtt out","z":"ba901ebf.b2a9a","name":"","topic":"mercedes/remaining","qos":"","retain":"","broker":"abbee078.98f9f","x":1020,"y":180,"wires":[]},{"id":"2b393d9c.07d642","type":"server","name":"Home Assistant","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":false,"cacheJson":true},{"id":"abbee078.98f9f","type":"mqtt-broker","name":"","broker":"192.168.a.b","port":"1883","clientid":"","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]
2 Likes

Dear all,

great stuff this updated Integration!

Does anyone know how to use / start the components

  • Lock
  • Remote Start Switch
  • Aux Heat Switch

???

Thanks a lot for your help!

Hi @jjmkimera,

these functions are not available currently. However I’m working on it, but first I have to fix the websocket stability.

BR
Rene

1 Like

Hello Rene,

I ran the provided image curl (after restarting) and the image.zip file threw an unzip error “End-of-central-directory signature not found”. Thoughts?

Randy