Mercedes Me Component

“Mercedes ME” custom component

HassFest tests Validate with HACS

MercedesME platform as a Custom Component for Home Assistant.

IMPORTANT:

  • Please login once in the MercedesME IOS or Android app before you install this component. (For North America, the app name is Mercedes Me Connect)

  • Tested Countries: AT, AU, BE, CA, CH, CN, DE, DK, ES, FI, FR, IN, IT, IR, NL, NO, NZ, PT, SE, TH, UK, US

  • North America: For Cars 2019 or newer only

  • Thailand, India: Please use region “Europe”.

  • China: support of China is in early stage

  • Discussions, Feature Requests via HA-Community Forum

Installation

  • First: This is not a Home Assistant Add-On. It’s a custom component.
  • There are two ways to install. First you can download the folder custom_component and copy it into your Home-Assistant config folder. Second option is to install HACS (Home Assistant Custom Component Store) and select “MercedesME 2020” from the Integrations catalog.
  • How to install a custom component?
  • How to install HACS?
  • Restart HA after the installation
  • Make sure that you refresh your browser window too
  • Use the “Add Integration” in Home Assistant, Settings, Devices & Services and select “MercedesME 2020”.
  • Use your MB-login email address. Your will receive a 6-digit code via email (valid for 15min).

How to Prevent Account Blocking

To reduce the risk of your account being blocked, please follow these recommendations:

  1. Create a separate MB user account for use with this component.
  2. Invite the new user to the vehicle:
    The primary user of the vehicle can invite the new HA-MB account to access the vehicle. Up to six additional users can be invited to each vehicle.
  3. Use each account in a single environment only:
    Use one account exclusively in HA or in the official MB tools, but never in both simultaneously.

Important Notes

  • Certain features, such as geofencing data, are available only to the primary user.
  • If geofencing is required in your HA environment, use the primary user account in HA and the secondary accounts in the official MB apps.

Optional configuration values

See Options dialog in the Integration under Home-Assistant/Configuration/Integration.

Excluded Cars: comma-separated list of VINs.
PIN: Security PIN to execute special services. Please use your MB mobile app to setup
Disable Capability Check: By default the component checks the capabilities of a car. Active this option to disable the capability check. (For North America)
Debug Save Messages: Enable this option to save all relevant received message into the messages folder of the component

Available components

Depends on your own car or purchased Mercedes Benz licenses.

Binary Sensors

  • warningwashwater

  • warningcoolantlevellow

  • warningbrakefluid

  • warningenginelight

    attributes:
    warningbrakefluid, warningwashwater, warningcoolantlevellow, warninglowbattery
    
  • parkbrakestatus

    attributes:
    preWarningBrakeLiningWear
    
  • theftsystemarmed

    attributes:
    carAlarmLastTime, carAlarmReason, collisionAlarmTimestamp, interiorSensor, interiorProtectionStatus, interiorMonitoringLastEvent, interiorMonitoringStatus, exteriorMonitoringLastEvent, exteriorMonitoringStatus, lastParkEvent, lastTheftWarning, lastTheftWarningReason, parkEventLevel, parkEventType, theftAlarmActive, towProtectionSensorStatus, towSensor,
    
  • tirewarninglamp

    attributes:
    tireMarkerFrontRight, tireMarkerFrontLeft,tireMarkerRearLeft, tireMarkerRearRight, tirewarningsrdk, tirewarningsprw, tireTemperatureRearLeft, tireTemperatureFrontRight,
    tireTemperatureRearRight, tireTemperatureFrontLeft
    
  • windowsClosed

    attributes:
    windowstatusrearleft, windowstatusrearright, windowstatusfrontright, windowstatusfrontleft
    
  • remoteStartActive

    attributes:
    remoteStartTemperature
    
  • engineState

  • chargeFlapACStatus

  • Preclimate Status (Preconditioning)

    attributes:
    precondState, precondActive, precondError, precondNow, precondNowError, precondDuration, precondatdeparture, precondAtDepartureDisable, precondSeatFrontLeft, precondSeatFrontRight, precondSeatRearLeft, precondSeatRearRight, temperature_points_frontLeft, temperature_points_frontRight, temperature_points_rearLeft, temperature_points_rearRight,
    
    
  • wiperHealth

    attributes:
    wiperLifetimeExceeded [EXPERIMENTAL, user feedback wanted]
    

Device Tracker

attributes:
positionHeading

Locks

  • lock

    PIN setup in MB App is required. If the pin is not set in the integration options then the lock asks for the PIN.

Sensors

  • lock

    attributes:
    decklidstatus, doorStatusOverall, doorLockStatusOverall, doorlockstatusgas, doorlockstatusvehicle, doorlockstatusfrontleft,doorlockstatusfrontright, doorlockstatusrearright, doorlockstatusrearleft, doorlockstatusdecklid, doorstatusrearleft, doorstatusfrontright, doorstatusrearright, doorstatusfrontleft, rooftopstatus, sunroofstatus, engineHoodStatus
    

    Internal value: doorlockstatusvehicle

    Values:
    0: vehicle unlocked
    1: vehicle internal locked
    2: vehicle external locked
    3: vehicle selective unlocked

  • Fuel Level (%)

    attributes:
    tankLevelAdBlue
    
  • Geofencing Violation

    attributes:
    Last_event_zone
    

    Values:
    ENTER
    LEAVE

  • odometer

    attributes:
    distanceReset, distanceStart, averageSpeedReset, averageSpeedStart, distanceZEReset, drivenTimeZEReset, drivenTimeReset, drivenTimeStart, ecoscoretotal, ecoscorefreewhl, ecoscorebonusrange, ecoscoreconst, ecoscoreaccel, gasconsumptionstart, gasconsumptionreset, gasTankRange, gasTankLevel, liquidconsumptionstart, liquidconsumptionreset, liquidRangeSkipIndication, rangeliquid, serviceintervaldays, tanklevelpercent, tankReserveLamp, batteryState, tankLevelAdBlue
    
  • Oil Level (%)

  • Range Electric

    attributes:
    chargingstatus, distanceElectricalReset, distanceElectricalStart, ecoElectricBatteryTemperature, endofchargetime, maxrange, selectedChargeProgram, precondActive [DEPRECATED], precondNow [DEPRECATED], precondDuration [DEPRECATED]
    
    
  • Electric consumption start

  • Electric consumption reset

  • Charging power

  • Starter Battery State

    Internal Name: starterBatteryState
    
    Values     Description_short     Description_long
    "0"        "green"               "Vehicle ok"
    "1"        "yellow"              "Battery partly charged"
    "2"        "red"                 "Vehicle not available"
    "3"        "serviceDisabled"     "Remote service disabled"
    "4"        "vehicleNotAvalable"  "Vehicle no longer available"
    
  • tirepressureRearLeft

  • tirepressureRearRight

  • tirepressureFrontRight

  • tirepressureFrontLeft

  • State of Charge (soc)

    Internal Name: soc
    
    State of charge (SoC) is the level of charge of an electric battery relative to its capacity. The units of SoC are percentage points (0% = empty; 100% = full).
    
    attributes:
    maxSocLowerLimit, maxSoc
    
    
  • Ignition state

    Internal Name: ignitionstate
    
    Values     Description_short     Description_long
    "0"        "lock"                "Ignition lock"
    "1"        "off"                 "Ignition off"
    "2"        "accessory"           "Ignition accessory"
    "4"        "on"                  "Ignition on"
    "5"        "start"               "Ignition start"
    
  • Aux Heat Status

    Internal Name: auxheatstatus
    
    Values    Description
    "0"       inactive
    "1"       normal heating
    "2"       normal ventilation
    "3"       manual heating
    "4"       post heating
    "5"       post ventilation
    "6"       auto heating
    
    attributes:
    auxheattime1, auxheattime2, auxheattime3, auxheattimeselection, auxheatActive, auxheatwarnings, auxheattime2, temperature_points_frontLeft, temperature_points_frontRight
    
    
  • Departure Time

    Internal Name: departuretime
    
    Planned departure time to initiate preclimate functions
    
    attributes:
    departureTimeWeekday
    
    

Diagnostic Sensors

Diagnostic sensors are hidden by default, check the devices page to see the current values

  • Car

    attributes:
    full_update_messages_received, partital_update_messages_received, last_message_received, last_command_type, last_command_state, last_command_error_code, last_command_error_message
    
  • RCP_Features

    Sensor shows true if extended configuration like interior lighting is available. This feature requires a reauthentication in case you used a version <0.6 before (We need some more permissions…). Shows False in case reauthentication has not happened or the feature is not available for your car.

    attributes:
    rcp_supported_settings (List of all remote configuration options, I'll implement them step by step as services or buttons)
    

Services

Some services require that the security PIN is created in your mobile Android/IOS app. Please store the pin to the options-dialog of the integration

  • refresh_access_token:
    Refresh the API access token

  • auxheat_start:
    Start the auxiliary heating of a car defined by a vin.

  • auxheat_stop:
    Stop the auxiliary heating of a car defined by a vin.

  • battery_max_soc_configure:
    Configure the maximum value for the state of charge of the HV battery of a car defined by a vin.

  • doors_unlock:
    Unlock a car defined by a vin. PIN required.

  • doors_lock:
    Lock a car defined by a vin.

  • engine_start:
    Start the engine of a car defined by a vin. PIN required.

  • engine_stop:
    Stop the engine of a car defined by a vin.

  • preconditioning_configure_seats:
    Configure which seats should be preconditioned of a car defined by a vin.

  • preheat_start:
    Start the preheating of a zero emission car defined by a vin.

  • preheat_start_departure_time:
    Start the preheating of a zero emission car defined by a vin and the departure time in minutes since midnight

  • preheat_stop:
    Stop the preheating of a zero emission car defined by a vin.

  • send_route:
    Send a route to a car defined by a vin.

  • sigpos_start:
    Start light signaling of a car defined by a vin.

  • sunroof_open:
    Open the sunroof of a car defined by a vin. PIN required.

  • sunroof_tilt:
    Tilt the sunroof of a car defined by a vin. PIN required.

  • sunroof_close:
    Close the sunroof of a car defined by a vin.

  • temperature_configure:
    Configure the target preconditioning/auxheat temperatures for zones in a car defined by a VIN.

  • windows_open:
    Open the windows of a car defined by a vin. PIN required.

  • windows_close:
    Close the windows of a car defined by a vin.

Switches

  • AuxHeat - Start/Stop the auxiliary heating of the car

Logging

Set the logging to debug with the following settings in case of problems.

logger:
  default: warn
  logs:
    custom_components.mbapi2020: debug

Useful links

Custom Lovelace Card

Enhance your experience with this integration by using VEHICLE INFO CARD. This card is designed to work seamlessly with the integration, providing a beautiful and intuitive interface to display the data in your Home Assistant dashboard.

Key Features

  • Seamless Integration: Automatically pulls in data from the integration.
  • Customizable: Easily modify the card’s appearance to fit your theme.
  • Interactive: Includes controls to interact with the data directly from your dashboard.
  • Multilingual Support: The card includes various translations, making it accessible in multiple languages.

Check out the Custom Lovelace Card for more details and installation instructions.

18 Likes

My wife’s Benz should support this but I’m not sure she enabled it yet. I’ll check this out and let you know.

1 Like

I have 4 cars active on mercedesme and i am very interested in getting this running. I would be happy to help

Thank you! Please let me know if you are ready.

Hi,

thank you, this sounds great. Are you registered in the US portal?

I could prepare some test scripts to check if my idea works in your region.

Thx

Yes, I am registered in the us portal and use it almost daily

Great, I’ll prepare some URLs to check the results tomorrow. Thx

Could you call this URL in a browser? You should be redirected to the login page, please use your normal mbme account data. After a successful login, you should get a JSON document starting with something like {"response":{"errors":[],"status":"OK",

Please replace the details like VIN, location, license plate. It will be great if you could send me the output via PM.

Hi @krsandvik,

let us discuss your ODB-adapter problem here. It’s easier to handle.

Please give me some details about the app that you use. Do you see results in the mercedes me portal?

Thx

I use this app: https://play.google.com/store/apps/details?id=com.daimler.mbfa.android

In the mercedes me portal I see odometer and fuel level, not trips or battery level

Hi,

looks like that the adapter is using a completely different implementation and I’m not sure if this can be implemented without direct access.

Sorry, but please do not expect any fast solution here. Maybe there is someone who will share the direct access with me so that I can take a direct look.

Mercedes is working on a new API interface also, maybe the adapter will be integrated.

ok, so first, clicking on that link does not prompt me to log in…but if I do log in and then click it again it gives me the output.

With that said, I have the data but there does not seem to be a way to PM you. Is this perhaps a restriction due to how new my account is? is there another way i can get this to you?

Hi! And many thanks for the Mercedes component, works brilliantly in my HA.

I have a hybrid MB with the normal pre-heating system. One great use case to me would be ability to start the pre-heating using HA (temperature, time, scheduled…). The mobile app only allows starting pre-heating instantly and for duration of 15min.

Additionally the mobile app shows the hybrid car battery level, which is a nice-to-know (but could have some relevancy, “don’t pre-heat if battery level <X”). Definitely secondary priority though.

Do you @ReneNulschDE know if this preheating is possible to integrate to HA?

hi Jake, thank you for testing the component.

Yes, this should be possible. I have access to a car with preheating since yesterday and I’m playing with the API currently. Unfortunately, the car is not a hybrid. Would you like to share your config with me via PM? (Delete private details please.)

Please do not expect a solution in the next 2 weeks (I’m on holidays :-)). But you can be sure that I’ll try to add this. I have first to solve the ugly multi-car handling.

Hi, and thanks for extremely quick reply. Just like the previous guy, I don’t see a way to PM here (unless I just did by pressing this “other” reply button in the chain…).

I’ll be happy to share the config with you, it’s ready and waiting now :slight_smile:. Do you want it as from the url you provided (single string), or somewhat organized (tried to split fields to rows and use intend)?

…and when looking at the config details, there is also details such as “electricConsumptionReset”, I wonder if it’s possible to see the kWh consumption if this is activated (the car doesn’t report that anywhere).

Hi, send you a message. the complete file is fine.

I see the following options currently:

electricRangeKm
electricChargePercent
electricChargingStatus
electricConsumptionReset
electricConsumptionStart
distanceElectricalStart
distanceElectricalReset

You can click on my name and then the message icon.

Hi,

I’ve created a beta version of the Mercedes Me connector as a custom component. So its easier to show/test upcomming changes.

If you would like to test/use, the code is published here on Github

Whats new?

- new sensors
    electricRangeKm
    electricChargePercent
    electricChargingStatus
    electricConsumptionReset
    electricConsumptionStart
    distanceElectricalStart
    distanceElectricalReset

- new binary sensors
    warningWashWater
    warningBrakeFluid
    warningEngineLight

Configuration:

mercedesmebeta:
  username: email
  password: password
1 Like

Installed the beta version successfully no issue to report so far.
would it be possible to add name to the main sensor to easily identify/group them

sensor.mycar.xxxx

mercedesmebeta:
name: mycar
username: email
password: password

Can you also add the following sensor if possible:
“trunkClosed”: true
“trunkLocked”: true
“fuelLidClosed”: true
“warningBrakeLineWear”: false
“warningCoolantLevelLow”: false
“tireWarningLight”: “INACTIVE”,
“parkingBrakeStatus”: true
“lightSwitchPosition”: “AUTO”,
“tankReserveLamp”: false,

Hi,

I’m very intrested in this feature:

Example: select state, attributes, last_changed from states where entity_id = 'sensor.latest_trip' group by state

The idea for the future is:
  •     Have an automation that fires an event after a trip has completed.
    
  •     Collect the GPS information out of the database for the start and end time
    
  •     reverse lookup the address for start and end
    
  •     take the information and add a line in a google sheet
    

Are you running a sql database to your HA since you are using sql to pull the data?