Mercedes Me Component

okay I’ll be patient :slight_smile:

Hi, this weekend i got some time to rework my configuration which wasn’t working at all before I updated to the new variant.

Is there a way to directly use attributes in lovelace picture-element-cards? If no I would strongly recommend to go back to the single sensor elements. Not everybody is using attribute cards. If theres an other way please tell me. For now i will use template sensors and extract the attributes…

1 Like

How did you geth that gauge into the picture element? Would you mind to share your config?

1 Like

The gauge is coming from https://github.com/custom-cards/gauge-card

Edit: (Oh my, you are Manuel82, from which I copied from the start… Seems we did the same thing this weekend: reworking your original config to fit the new sensors/attributes… :wink:

Using template sensors is the way to go.

I have just finished my setup, based on the setup of @Manuel82. I’ll share my config very soon, just need to do some clean-up.

Here are my template sensors to get you started. I’ll try to post the rest of the config in another (decent) way:

    1rtf858_distance_since_start:
      value_template: "{{state_attr('sensor.1rtf858_odometer', 'distanceStart')| float}}"
      friendly_name: 'Distance Since Start'
      unit_of_measurement: 'km'
    1rtf858_average_speed_since_start:
      value_template: "{{state_attr('sensor.1rtf858_odometer', 'averageSpeedStart')| float}}"
      friendly_name: 'Average Speed Since Start'
      unit_of_measurement: 'km/u'
    1rtf858_drive_time_since_start:
       value_template: >-
         {% set time = state_attr('sensor.1rtf858_odometer', 'drivenTimeStart')| float %}
         {% set minutes = (time % 60) | int %}
         {% set hours = (time / 60) | int %}
         {% set days = (time / 86400) | int %}

         {%- if time < 60 -%}
           Less than a minute
         {%- else -%}
           {%- if hours > 0 -%}
             {%- if hours == 1 -%}
               1 hour
             {%- else -%}
               {{ hours }} hours
             {%- endif -%}
           {%- endif -%}
           {%- if minutes > 0 -%}
             {%- if hours > 0 -%}
               {{ ', ' }}
             {%- endif -%}
             {%- if minutes == 1 -%}
               1 minute
             {%- else -%}
               {{ minutes }} minutes
             {%- endif -%}
           {%- endif -%}
         {%- endif -%}
       friendly_name: 'Time Driven Since Start'
       unit_of_measurement: ''
    1rtf858_distance_since_reset:
       value_template: "{{state_attr('sensor.1rtf858_odometer', 'distanceReset')| float}}"
       friendly_name: 'Distance Since Reset'
       unit_of_measurement: 'km' 
    1rtf858_liquid_consumption_start:
       value_template: "{{state_attr('sensor.1rtf858_odometer', 'liquidconsumptionstart')| float}}"
       friendly_name: 'Consumption Since Start'
       unit_of_measurement: 'l/100km' 
    1rtf858_liquid_consumption_reset:
       value_template: "{{state_attr('sensor.1rtf858_odometer', 'liquidconsumptionreset')| float}}"
       friendly_name: 'Consumption Since Reset'
       unit_of_measurement: 'l/100km' 
    1rtf858_liquid_range:
       value_template: "{{state_attr('sensor.1rtf858_odometer', 'rangeliquid')| float}}"
       friendly_name: 'Range Liquid'
       unit_of_measurement: 'km' 
#    1rtf858_tank_level:
#       value_template: "{{state_attr('sensor.1rtf858_odometer', 'tanklevelpercent')| float}}"
#       friendly_name: 'Tank Level'
#       unit_of_measurement: '%'
    1rtf858_tire_pressurebar_front_left:
       value_template: "{{state_attr('binary_sensor.1rtf858_tire_warning', 'tirepressureFrontLeft')| float}}"
       friendly_name: 'Tire Pressure Front Left'
       unit_of_measurement: ''     
    1rtf858_tire_pressurebar_front_right:
       value_template: "{{state_attr('binary_sensor.1rtf858_tire_warning', 'tirepressureFrontRight')| float}}"
       friendly_name: 'Tire Pressure Front Right'
       unit_of_measurement: ''
    1rtf858_tire_pressurebar_rear_left:
       value_template: "{{state_attr('binary_sensor.1rtf858_tire_warning', 'tirepressureRearLeft')| float}}"
       friendly_name: 'Tire Pressure Rear Left'
       unit_of_measurement: ''
    1rtf858_tire_pressurebar_rear_right:
       value_template: "{{state_attr('binary_sensor.1rtf858_tire_warning', 'tirepressureRearRight')| float}}"
       friendly_name: 'Tire Pressure Rear Right'
       unit_of_measurement: ''
    1rtf858_door_front_right:
       value_template: >-
        {% if is_state_attr('sensor.1rtf858_lock', 'doorStateFrontRight', 'DOOR_CLOSED_AND_DOOR_LOCKED')%} 
           Closed
        {% else %}
           Open
        {% endif %}
       friendly_name: 'Door Status Front Right'
    1rtf858_door_front_left:
       value_template: >-
        {% if is_state_attr('sensor.1rtf858_lock', 'doorStateFrontLeft', 'DOOR_CLOSED_AND_DOOR_LOCKED')%} 
           Closed
        {% else %}
           Open
        {% endif %}
       friendly_name: 'Door Status Front Left'
    1rtf858_door_rear_right:
       value_template: >-
        {% if is_state_attr('sensor.1rtf858_lock', 'doorStateRearRight', 'DOOR_CLOSED_AND_DOOR_LOCKED')%} 
           Closed
        {% else %}
           Open
        {% endif %}
       friendly_name: 'Door Status Rear Right'
    1rtf858_door_rear_left:
       value_template: >-
        {% if is_state_attr('sensor.1rtf858_lock', 'doorStateRearLeft', 'DOOR_CLOSED_AND_DOOR_LOCKED')%} 
           Closed
        {% else %}
           Open
        {% endif %}
       friendly_name: 'Door Status Rear Left'
    1rtf858_trunk_status:
       value_template: >-
        {% if is_state_attr('sensor.1rtf858_lock', 'trunkStateRollup', 'CLOSED_AND_LOCKED')%} 
           Closed
        {% else %}
           Open
        {% endif %}
       friendly_name: 'Trunk Status'
    1rtf858_window_front_right:
       value_template: >-
        {% if is_state_attr('binary_sensor.1rtf858_windows_closed', 'windowstatusfrontright', 'CLOSED')%} 
           Closed
        {% else %}
           Open
        {% endif %}
       friendly_name: 'Window Status Front Right'
    1rtf858_window_front_left:
       value_template: >-
        {% if is_state_attr('binary_sensor.1rtf858_windows_closed', 'windowstatusfrontleft', 'CLOSED')%} 
           Closed
        {% else %}
           Open
        {% endif %}
       friendly_name: 'Window Status Front Left'
    1rtf858_window_rear_right:
       value_template: >-
        {% if is_state_attr('binary_sensor.1rtf858_windows_closed', 'windowstatusrearright', 'CLOSED')%} 
           Closed
        {% else %}
           Open
        {% endif %}
       friendly_name: 'Window Status Rear Right'
    1rtf858_window_rear_left:
       value_template: >-
        {% if is_state_attr('binary_sensor.1rtf858_windows_closed', 'windowstatusrearleft', 'CLOSED')%} 
           Closed
        {% else %}
           Open
        {% endif %}
       friendly_name: 'Window Status Rear Left'
    1rtf858_windows_allclosed:
        value_template: >-
         {% if is_state_attr('binary_sensor.1rtf858_windows_closed', 'windowstatusrearleft', 'CLOSED') and is_state_attr('binary_sensor.1rtf858_windows_closed', 'windowstatusrearright', 'CLOSED') and is_state_attr('binary_sensor.1rtf858_windows_closed', 'windowstatusfrontleft', 'CLOSED') and is_state_attr('binary_sensor.1rtf858_windows_closed', 'windowstatusfrontright', 'CLOSED') %} 
            Closed
         {% else %}
            Open
         {% endif %}
        friendly_name: 'All Windows Closed'          
    1rtf858_doors_allclosed:
        value_template: >-
         {% if is_state_attr('sensor.1rtf858_lock', 'doorsClosed', true)%} 
            Closed
         {% else %}
            Open
         {% endif %}
        friendly_name: 'All Doors Closed'  
    1rtf858_warning_washwater:
        value_template: >-
         {% if is_state_attr('binary_sensor.1rtf858_engine_light_warning', 'warningwashwater', false)%} 
            off
         {% else %}
            on
         {% endif %}
        friendly_name: 'Warning WashWater'        
    1rtf858_warning_breakfluid:
        value_template: >-
         {% if is_state_attr('binary_sensor.1rtf858_engine_light_warning', 'warningbrakefluid', false)%} 
            off
         {% else %}
            on
         {% endif %}
        friendly_name: 'Warning BreakFluid'

Sure, here is my config:
I’m using a high res main image to make the panel resizable without loosing the correct positioning of the elements even on 4k display ( https://i.imgur.com/rZLDq7b.png )

resources:
  - type: js
    url: /local/plugins/card-tools.js?v=1
  - type: js
    url: /local/plugins/card-modder.js?v=1
  - type: js
    url: /local/plugins/bar-card.js?v=1
  - type: js
    url: /local/plugins/bignumber-card.js?v=1
  - type: module
    url: /local/plugins/compact-custom-header.js?v=1.2.0
  - type: module
    url: /local/plugins/card-mod.js?v=0.0.1
  - url: /local/plugins/button-card.js?v=1.11.1
    type: module
cch:
  options: clock
  clock_format: 24
  clock_date: true  
title: Casa
views:


##############################################
#########  MACCHINA
##############################################
  - cards:
      - elements:
          - card:
              entity: sensor.livello_serbatoio
              title: Carburante
              type: gauge
              unit: '%'
            style:
              '--base-unit': 2.2vw
              '--paper-card-background-color': '#000000'
              left: 37%
              top: 17.5%
            type: 'custom:card-modder'
          - card:
              entity: sensor.fe270je_odometer
              scale: 1vw
              title: Chilometri percorsi
              type: 'custom:bignumber-card'
            style:
              '--paper-card-background-color': transparent
              left: 56.5%
              top: 19%
            type: 'custom:card-modder'
          - card:
              entity: sensor.consumo_recente
              scale: 1vw
              title: Consumo recente
              type: 'custom:bignumber-card'
            style:
              '--paper-card-background-color': transparent
              left: 45%
              top: 19%
            type: 'custom:card-modder'
          - card:
              entity: sensor.pressione_a_sx
              scale: 0.8vw
              type: 'custom:bignumber-card'
            style:
              '--paper-card-background-color': transparent
              left: 13%
              top: 59.3%
            type: 'custom:card-modder'
          - card:
              entity: sensor.pressione_a_dx
              scale: 0.8vw
              type: 'custom:bignumber-card'
            style:
              '--paper-card-background-color': transparent
              left: 27.2%
              top: 59.5%
            type: 'custom:card-modder'
          - card:
              entity: sensor.pressione_p_sx
              scale: 0.8vw
              type: 'custom:bignumber-card'
            style:
              '--paper-card-background-color': transparent
              left: 13%
              top: 80%
            type: 'custom:card-modder'
          - card:
              entity: sensor.pressione_p_dx
              scale: 0.8vw
              type: 'custom:bignumber-card'
            style:
              '--paper-card-background-color': transparent
              left: 27.2%
              top: 80.2%
            type: 'custom:card-modder'
          - entity: lock.fe270je_lock
            state_image:
              locked: /local/portiere_chiuse.png
              unlocked: /local/portiere_aperte.png
            style:
              left: 83%
              max-width: 3.4%
              top: 30.5%
            tap_action:
              action: none
            type: image
          - entity: sensor.stato_tettuccio
            state_image:
              TILT_SLIDE_SUNROOF_CLOSED: /local/portiere_chiuse.png
              TILT_SLIDE_SUNROOF_OPEN: /local/portiere_aperte.png
            style:
              left: 68.3%
              max-width: 2.5%
              top: 20.5%
            tap_action:
              action: none
            type: image
          - entity: sensor.liquido_freni
            state_image:
              'False': /local/check.png
              'True': /local/warning.png
            style:
              left: 76.8%
              max-width: 2.5%
              top: 20.5%
            tap_action:
              action: none
            type: image
          - entity: sensor.liquido_refrigerante
            state_image:
              'False': /local/check.png
              'True': /local/warning.png
            style:
              left: 81.3%
              max-width: 2.5%
              top: 20.5%
            tap_action:
              action: none
            type: image
          - entity: sensor.liquido_lavavetri
            state_image:
              'False': /local/check.png
              'True': /local/warning.png
            style:
              left: 85.7%
              max-width: 2.5%
              top: 20.5%
            tap_action:
              action: none
            type: image
        image: /local/macchina6.png
        style:
          transform: none
        type: picture-elements
    panel: true
    path: macchina
    title: Macchina
3 Likes

Hi,
I have now spent several hours, coffees and too many ciggies and still stuck.
The component seem to load correctly. HA does not complain. I have enabled the detailed log and messages show that I am connected and that I am getting responses. However, no sensors (binary and otherwise) show up in HA.

Question. Do I need to subscribe to any Mercedes dev API? Or is it a service on the Me-portal. for my MERCEDES-BENZ E-CLASS T-Model (S212) E 200 CDI (212.205) 2013 136Hk - there are no services available on the portal.

I am using the Me-bluetooth adapter connected to my phone. Based in Sweden. Data is visible in the portal.

state_WDXXXXXXXXXXXXX.json shows:

{"dynamic": {}, "aggregated": {"lastJourney": null}}

feat_WDXXXXXXXXXXXXX.json shows:

{"metadata": {"appSections": {"productsEnabled": false, "mobilityEnabled": true, "newsEnabled": true}
"featureEnablements": [{"name": "MYCAR_INFO_BUTTON", "enablement": "INVISIBLE"}, {"name": "EV_CHARGING_POINTS_TOGGLE", "enablement": "ACTIVATED"}, {"name": "CHARGING_CLIMA_CONTROL_DEPARTURETIME_TEMPERATURE_LINKOUT_TOGGLE", "enablement": "ACTIVATED"}, {"name": "CONNECT_SERVICE_MANAGEMENT_TOGGLE", "enablement": "INVISIBLE"}, {"name": "PARKING_OFF_STREET", "enablement": "INVISIBLE"}, {"name": "CHARGING_CLIMA_CONTROL_CHARGING_DEMAND_NOTIFICATION_TOGGLE", "enablement": "ACTIVATED"}, {"name": "ADD_VEHICLE", "enablement": "ACTIVATED"}, {"name": "EMOBILITY_SERVICE_PROVIDER", "enablement": "INVISIBLE"}, {"name": "ENERGIZING_COACH", "enablement": "INVISIBLE"}, {"name": "LEA_ASSISTANT", "enablement": "INVISIBLE"}, {"name": "REMOTE_STATUS_RANGE_CRITICAL_TOGGLE", "enablement": "INVISIBLE"}, {"name": "DOOR_TO_DOOR_NAVIGATION", "enablement": "INVISIBLE"}, {"name": "COLLISION_ALARM", "enablement": "INVISIBLE"}, {"name": "VEHICLE_AUTHORIZATION_CHANGE_EVENT_TOGGLE", "enablement": "INVISIBLE"}, {"name": "REMOTE_ENGINE_START", "enablement": "INVISIBLE"}, {"name": "AUX_HEAT", "enablement": "INVISIBLE"}, {"name": "S2C_MBA", "enablement": "INVISIBLE"}, {"name": "CHARGING_CLIMA_CONTROL_19B_TOGGLE", "enablement": "ACTIVATED"}, {"name": "VALET_PROTECT", "enablement": "INVISIBLE"}, {"name": "CONCIERGE", "enablement": "INVISIBLE"}, {"name": "VEHICLE_SERVICE_DASHBOARD", "enablement": "INVISIBLE"}, {"name": "MYCAR_PHASE_1", "enablement": "INVISIBLE"}, {"name": "PRIVATE_CAR_SHARING", "enablement": "INVISIBLE"}, {"name": "REMOTE_STATUS_RANGE_HIGHLIGHT_TOGGLE", "enablement": "INVISIBLE"}, {"name": "REMOTE_DOUBLE_DOOR_LOCK", "enablement": "INVISIBLE"}, {"name": "CHARGING_CLIMA_CONTROL", "enablement": "INVISIBLE"}, {"name": "REMOTE_STATUS", "enablement": "INVISIBLE"}, {"name": "S2C_RIF", "enablement": "INVISIBLE"}, {"name": "SMART_HOME", "enablement": "INVISIBLE"}, {"name": "CHARGING_CLIMA_CONTROL_TOGGLE", "enablement": "ACTIVATED"}, {"name": "VOICE_ADDRESS_SEARCH", "enablement": "ACTIVATED"}, {"name": "VEHICLE_LOCATOR", "enablement": "INVISIBLE"}, {"name": "REMOTE_STATUS_SUNROOF_LEAF_PAGE_TOGGLE", "enablement": "INVISIBLE"}, {"name": "REMOTE_CONFIGURATION", "enablement": "INVISIBLE"}, {"name": "FIND_VEHICLE", "enablement": "ACTIVATED"}, {"name": "COMMUTE_ALERT", "enablement": "INVISIBLE"}, {"name": "MAXSOC_CONFIGURATION", "enablement": "INVISIBLE"}, {"name": "CHARGING_CLIMA_CONTROL_PRECOND_NOTIFICATION_TOGGLE", "enablement": "ACTIVATED"}, {"name": "DESIGNATED_DRIVER", "enablement": "INVISIBLE"}, {"name": "CHARGING_CLIMA_CONTROL_BATTERY_ANIMATION_TOGGLE", "enablement": "ACTIVATED"}, {"name": "WEEKLY_PROFILE_CONFIGURATION", "enablement": "INVISIBLE"}, {"name": "DAYNIGHT_TARIFF_LINKOUT_TOGGLE", "enablement": "ACTIVATED"}, {"name": "S2C_INFO_TEXT", "enablement": "ACTIVATED"}, {"name": "EV_RANGE_ASSIST", "enablement": "INVISIBLE"}, {"name": "ONEWEB_LINKOUT_TOGGLE", "enablement": "ACTIVATED"}, {"name": "SPEED_ALERT", "enablement": "INVISIBLE"}, {"name": "INBOX", "enablement": "ACTIVATED"}, {"name": "PREDICTIVE_SUGGESTIONS", "enablement": "INVISIBLE"}, {"name": "PROFILE_PICTURE_TOGGLE", "enablement": "INVISIBLE"}, {"name": "PARKING_ON_STREET_PAYMENT", "enablement": "INVISIBLE"}, {"name": "VEHICLE_TRACKING", "enablement": "INVISIBLE"}, {"name": "TRIPS_TOGGLE", "enablement": "INVISIBLE"}, {"name": "EV_CORE_CHARGING_STATION_PROVIDER", "enablement": "INVISIBLE"}, {"name": "CAR_ALARM", "enablement": "INVISIBLE"}, {"name": "INSTANT_CHARGE_PROGRAM", "enablement": "INVISIBLE"}, {"name": "STARTER_BATTERY", "enablement": "INVISIBLE"}, {"name": "IN_CAR_DELIVERY", "enablement": "INVISIBLE"}, {"name": "PARKING_C2C", "enablement": "INVISIBLE"}, {"name": "RANGE_ON_MAP", "enablement": "INVISIBLE"}, {"name": "PARKING_ON_STREET", "enablement": "INVISIBLE"}, {"name": "TRAFFIC_VIOLATION_NOTIFICATION", "enablement": "INVISIBLE"}, {"name": "CHARGING_CLIMA_CONTROL_MAXSOC_TOGGLE", "enablement": "ACTIVATED"}, {"name": "LOCAL_PLATE_RESTRICTION_NOTIFICATION", "enablement": "INVISIBLE"}, {"name": "PARKING", "enablement": "INVISIBLE"}, {"name": "TEMPERATURE_SEAT_CLIMATE_CONTROL", "enablement": "INVISIBLE"}, {"name": "SERVICE_STATUS_CHANGE_EVENT_TOGGLE", "enablement": "INVISIBLE"}, {"name": "QR_CODE", "enablement": "ACTIVATED"}, {"name": "PARKING_REALTIME", "enablement": "INVISIBLE"}, {"name": "CHARGING_CLIMA_CONTROL_CHARGING_NOTIFICATION_TOGGLE", "enablement": "ACTIVATED"}, {"name": "DOOR_STATUS_DETAILS", "enablement": "INVISIBLE"}, {"name": "PARKING_OFF_STREET_BOOKING", "enablement": "INVISIBLE"}, {"name": "CHARGING_CLIMA_CONTROL_SELECTED_SOC_NOTIFICATION_TOGGLE", "enablement": "INVISIBLE"}, {"name": "REMOTE_DOOR_LOCK", "enablement": "INVISIBLE"}, {"name": "MARKET_DISABLED", "enablement": "INVISIBLE"}, {"name": "CONNECTED_CAR", "enablement": "INVISIBLE"}, {"name": "CHARGING_CLIMA_CONTROL_19B_NOTIFICATION_TOGGLE", "enablement": "INVISIBLE"}, {"name": "TRAFFIC_VIOLATION", "enablement": "INVISIBLE"}, {"name": "EV_CHARGING_POINTS", "enablement": "INVISIBLE"}, {"name": "WINDOW_LEAF_PAGE", "enablement": "INVISIBLE"}, {"name": "ANDROID_BLUETOOTH_FEATURES", "enablement": "INVISIBLE"}, {"name": "EV_CHARGING_POINTS_DASHBOARD_SHORTCUT", "enablement": "ACTIVATED"}, {"name": "MYCAR_PHASE_0", "enablement": "INVISIBLE"}, {"name": "LOCAL_PLATE_RESTRICTION", "enablement": "INVISIBLE"}, {"name": "NEWSFEED", "enablement": "ACTIVATED"}, {"name": "PRODUCT_TAB_MBRACE", "enablement": "INVISIBLE"}, {"name": "LIFESTYLE_CONFIGURATOR", "enablement": "INVISIBLE"}, {"name": "PRODUCTION_TRACKER", "enablement": "ACTIVATED"}, {"name": "ME_CLUB", "enablement": "INVISIBLE"}, {"name": "PERSONALIZED_NEWSFEED", "enablement": "ACTIVATED"}, {"name": "APPLY_CREDIT", "enablement": "INVISIBLE"}, {"name": "PHYD_INSURANCE", "enablement": "INVISIBLE"}, {"name": "PRODUCT_FINDER", "enablement": "INVISIBLE"}, {"name": "FINANCIAL_CALCULATOR", "enablement": "INVISIBLE"}, {"name": "MY_ACCOUNT", "enablement": "INVISIBLE"}, {"name": "FINACIAL_CONTRACT_MGMT", "enablement": "INVISIBLE"}, {"name": "ONLINE_OFFLINE_MODE", "enablement": "ACTIVATED"}, {"name": "ENABLED_CAR_IMAGE_CACHE", "enablement": "INVISIBLE"}, {"name": "DISPLAY_LOGIN_REGISTER", "enablement": "INVISIBLE"}, {"name": "UNLIMITED_CONSUMPTION_TOGGLE", "enablement": "ACTIVATED"}, {"name": "DAIVB_EMPTY_ERROR", "enablement": "INVISIBLE"}, {"name": "DISPLAY_SERVICEAGREEMENTS_PROMPT", "enablement": "INVISIBLE"}, {"name": "DISPLAY_ACTIVATE_SERVICE", "enablement": "ACTIVATED"}, {"name": "DISPLAY_EULA_DATA_PROTECTION", "enablement": "ACTIVATED"}, {"name": "VEHICLE_RULES_VALIDATION", "enablement": "INVISIBLE"}, {"name": "DISPLAY_APP_PROVIDER", "enablement": "ACTIVATED"}, {"name": "UNIT_SELECTION", "enablement": "ACTIVATED"}, {"name": "ASK_USER_RATING", "enablement": "INVISIBLE"}, {"name": "DISPLAY_SETTINGS_TOGGLE", "enablement": "ACTIVATED"}, {"name": "CAR2GO", "enablement": "INVISIBLE"}, {"name": "MOOVEL", "enablement": "INVISIBLE"}, {"name": "MYTAXI", "enablement": "ACTIVATED"}, {"name": "MOBILITY_SERVICES", "enablement": "ACTIVATED"}, {"name": "SHOP", "enablement": "INVISIBLE"}, {"name": "ONLINE_BOOKING_REQUEST", "enablement": "ACTIVATED"}, {"name": "DEALER_SEARCH", "enablement": "ACTIVATED"}, {"name": "HOW_TO_VIDEOS", "enablement": "ACTIVATED"}, {"name": "ACCIDENT_CLAIM", "enablement": "INVISIBLE"}, {"name": "DASHBOARD_HELP", "enablement": "ACTIVATED"}], "userVehicleState": "LEGACY"}, "staticVehicleData": {"vin": "WDXXXXXXXXXXXXX", "imageUrl": null, "model": "E 200 CDI BlueEFFICIENCY Estate", "licensePlate": "XYZ123", "initialRegistration": null, "color": "polar white", "equipmentLine": "Classic", "upholstery": "Black ARTICO man-made leather", "displacement": null, "output": "136 PS", "fuel": null, "transmission": "automatic transmission", "modelYear": null, "euroStandard": null, "baumuster": "212205", "specialEquipment": ["P:803"], "geoInfo": null, "unlimitedConsumption": false, "supportsDayNightTariff": false, "vehicleRules": {"overallRangeLiquidAndElectricPercent": "25", "locked": "true"}}}

Thanks for any assistance!! :slight_smile:
/Mikael

Hi @ThePapaMaan,

The Bluetooth adapter will not work with this integration.

The state_WDXXXXXXXXXXXXX.json Is empty, that means the api delivers no data.

Sorry, I can’t help here.

Rene

What a b.mmer. ok. Thanks for your quick response!

Hi @ReneNulschDE
I integrated your old project mercedesmebeta for simulator to HA, and see exception from log:

2019-07-26 10:24:03 ERROR (SyncWorker_3) [mercedesmejsonpy.controller] url: https://api.mercedes-benz.com/experimental/connectedvehicle/v1/vehicles, headers: {'content-type': 'application/json', 'Authorization': 'Bearer d0c68dd4-c939-4a0f-8cf8-xxxxxxxxxxxx'}, proxies: None
NoneType: None
2019-07-26 10:24:09 ERROR (SyncWorker_3) [mercedesmejsonpy.controller] res.json: [{'id': '6DE25C138CECE3B10B', 'licenseplate': 'S-GG-613', 'finorvin': '1HMA8C654H2B0B551'}]
NoneType: None
2019-07-26 10:24:09 ERROR (SyncWorker_3) [mercedesmejsonpy.controller] url: https://api.mercedes-benz.com/experimental/connectedvehicle/v1/vehicles/6DE25C138CECE3B10B, headers: {'content-type': 'application/json', 'Authorization': 'Bearer d0c68dd4-c939-4a0f-8cf8-xxxxxxxxxxxx'}, proxies: None
NoneType: None
2019-07-26 10:24:10 ERROR (SyncWorker_3) [mercedesmejsonpy.controller] res.json: {'id': '6DE25C138CECE3B10B', 'licenseplate': 'S-GG-613', 'salesdesignation': 'E 400 4MATIC Limousine', 'finorvin': '1HMA8C654H2B0B551', 'nickname': 'mmueller', 'modelyear': '2017', 'colorname': 'iridiumsilber metallic', 'fueltype': 'Benzin', 'powerhp': '333', 'powerkw': '245', 'numberofdoors': '5', 'numberofseats': '5'}
NoneType: None
2019-07-26 10:24:10 ERROR (SyncWorker_3) [mercedesmejsonpy.controller] getStateOfCharge for 6DE25C138CECE3B10B called
NoneType: None
2019-07-26 10:24:10 ERROR (SyncWorker_3) [mercedesmejsonpy.controller] API_ENDPOINT: https://api.mercedes-benz.com/experimental/connectedvehicle/v1, APT_VEHICLES: vehicles, car_id: 6DE25C138CECE3B10B, api: stateofcharge
NoneType: None
2019-07-26 10:24:10 ERROR (SyncWorker_3) [mercedesmejsonpy.controller] url: https://api.mercedes-benz.com/experimental/connectedvehicle/v1/vehicles/6DE25C138CECE3B10B/stateofcharge, headers: {'content-type': 'application/json', 'Authorization': 'Bearer d0c68dd4-c939-4a0f-8cf8-xxxxxxxxxxxx'}, proxies: None
NoneType: None
2019-07-26 10:24:12 ERROR (SyncWorker_3) [mercedesmejsonpy.controller] res.json: {'reason': 'Invalid response was retrieved from High Mobility. No state of charge information is available.', 'code': 500}
NoneType: None
2019-07-26 10:24:12 ERROR (SyncWorker_3) [mercedesmejsonpy.controller] Connection failed with http code 500
NoneType: None
2019-07-26 10:24:13 ERROR (MainThread) [homeassistant.setup] Error during setup of component mercedesmebeta
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-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/pi/.homeassistant/custom_components/mercedesmebeta/__init__.py", line 165, in setup
    mercedesme_api = Controller(auth_handler, scan_interval)
  File "/home/pi/.homeassistant/deps/lib/python3.7/site-packages/mercedesmejsonpy/controller.py", line 156, in __init__
    self.load_cars()
  File "/home/pi/.homeassistant/deps/lib/python3.7/site-packages/mercedesmejsonpy/controller.py", line 205, in load_cars
    car.stateofcharge = self.get_state_of_charge(car.id)
  File "/home/pi/.homeassistant/deps/lib/python3.7/site-packages/mercedesmejsonpy/controller.py", line 312, in get_state_of_charge
    result = stateofcharge.get("stateofcharge")
AttributeError: 'NoneType' object has no attribute 'get'

Then I query the data according to the connection API(https://developer.mercedes-benz.com/apis/connected_vehicle_experimental_api/docs), some api response is valid,

$ curl -X GET "https://api.mercedes-benz.com/experimental/connectedvehicle/v1/vehicles" \
>   -H "accept: application/json" \
>   -H "authorization: Bearer 20cf9050-2217-4a89-bcd6-xxxxxxxxxxxx"
[{"id":"6DE25C138CECE3B10B","licenseplate":"S-GG-613","finorvin":"1HMA8C654H2B0B551"}]

$ curl -X GET "https://api.mercedes-benz.com/experimental/connectedvehicle/v1/vehicles/6DE25C138CECE3B10B" \
>   -H "accept: application/json" \
>   -H "authorization: Bearer 20cf9050-2217-4a89-bcd6-xxxxxxxxxxxx"

{"id":"6DE25C138CECE3B10B","licenseplate":"S-GG-613","salesdesignation":"E 400 4MATIC Limousine","finorvin":"1HMA8C654H2B0B551","nickname":"mmueller","modelyear":"2017","colorname":"iridiumsilber metallic","fueltype":"Benzin","powerhp":"333","powerkw":"245","numberofdoors":"5","numberofseats":"5"}

and some api response was invalid, such as stateofcharge and doors, the response was following:

$ curl -X GET "https://api.mercedes-benz.com/experimental/connectedvehicle/v1/vehicles/6DE25C138CECE3B10B/stateofcharge" \
>   -H "accept: application/json" \
>   -H "authorization: Bearer 20cf9050-2217-4a89-bcd6-xxxxxxxxxxxx"
{"reason":"Invalid response was retrieved from High Mobility. No state of charge information is available.","code":500}

$ curl -X GET "https://api.mercedes-benz.com/experimental/connectedvehicle/v1/vehicles/6DE25C138CECE3B10B/doors" \
>   -H "accept: application/json" \
>   -H "authorization: Bearer 20cf9050-2217-4a89-bcd6-xxxxxxxxxxxx"
{"reason":"Invalid response was retrieved from High Mobility. No doors information is available.","code":500}

from the docs I know the code 500 means: An error occurred on the server side, e.g. a required service did not provide a valid response.

Do you know how to get the valid response?
Thanks very much!

Hi @rangerzhou,

Looks like a bug on the server side and you should ask the Mercedes dev team about this. You can find the email address on their developer website.

OK, I have already contact them through the link https://developer.mercedes-benz.com/support, hope they can give me the answer.

Thanks!

Thanks to all who share (part of) their config.

I’m too much of a novice to get it working though. Can someone post clear instructions from a to z on how to add something like this: Mercedes Me Component

I have the mercedesme component already working and the default sensors are present.

@ReneNulschDE

Is it possible to get some additonal attributes for:
supplybatteryvoltage, batteryState

Should be available according to this:

Also warninglowbattery does not appear for me under warningenginelight?

warning

Hi @plantoschka,

please excuse my late response… it’s vacation season :slight_smile:

supplybatteryvoltage and warninglowbattery are attributes of the ‘Range electric’ electric sensor.

I’ll add batteryState.

BR
Rene

2 Likes

Quick question @ReneNulschDE. I have taken a quick look but can’t find the answer

My daughter is in the US and has a Merc - does this component work over there?

No, don’t work.

Thank you.

I’ll just have to get her to move back to the UK :slight_smile: …Though she will probably want to borrow my car if she did that

'Hi, I am really rookie with HA. I set up the card created by Manuel. Everything worked fine. Now I tried o integrate the Mercedesmeapi into my config and I got the message integration not found. Attached my config. I logged out and again in to the Mercedes Me app, tried to set the password/user in the API with secret (as shown in green shot) and gave in the password and user directly. Always the same problem. It would be great if someone has an idea what I can do. Thanks Peter
</>55 !
16

Hello everyone,
I’m new to HA and I’m trying to activate your plugin but I can not. I managed to activate these plugins but this one is a problem!

My HA runs on RPi3 B + with the Hassbian and python 3. My HA tells me he can not activate the plug-in because he encounters an error. I’ve corrected config file :

mercedesmeapi:
  username: !secret mb_username
  password: !secret mb_password
  pin: !secret mb_pin
  country_code: CH               # two digts country code
  accept_lang: ch_FR             # 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 
 #attributes: doorStateFrontLeft, doorStateFrontRight, doorStateRearLeft, doorStateRearRight, frontLeftDoorLocked, frontRightDoorLocked, rearLeftDoorLocked, rearRightDoorLocked, frontLeftDoorClosed, frontRightDoorClosed, rearLeftDoorClosed, rearRightDoorClosed, rearRightDoorClosed, doorsClosed, trunkStateRollup, sunroofstatus

When I look in the log file, here are the errors:

2019-09-03 21:04:18 ERROR (MainThread) [homeassistant.setup] Error during setup of component mercedesmeapi
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/setup.py", line 172, 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 <module>
    import lxml.html
ModuleNotFoundError: No module named 'lxml'

So I noticed that there is a problem with the library lxml. so I installed it but it still does not work!

when I do

pip freeze

i get this:

asn1crypto==0.24.0
backports.functools-lru-cache==1.5
beautifulsoup4==4.7.1
chardet==3.0.4
configparser==3.5.0b2
cryptography==2.6.1
entrypoints==0.3
enum34==1.1.6
html5lib==1.0.1
ipaddress==1.0.17
keyring==17.1.1
keyrings.alt==3.1.1
lxml==4.3.2
pycrypto==2.6.1
PyGObject==3.30.4
pyxdg==0.25
RPi.GPIO==0.7.0
SecretStorage==2.3.1
six==1.12.0
soupsieve==1.8
webencodings==0.5.1

I think my python installation is ok but I do not know why the plugin does not load!

Can someone help me make it work?
Also, as a new user, I confronted some config problems. If someone has a complete and detailed installation manual, I’m interested.
Also, I do not know if you have to activate paid options on the sdk portal of mercedes me for the plugin to work?