“Mercedes-Benz” custom component

Mercedes-Benz platform as a Custom Component for Home Assistant.
IMPORTANT:
-
Please login once into the Mercedes-Benz 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, RO, SE, TH, UK, US
-
North America: For Cars built 2019 or newer only
-
Thailand, India: Please use the region “Europe”.
-
Mexico, Brazil,…: Please use the region “APAC”
-
China: Is not working currently (captcha).
-
Smart cars data are not available after 2025-01-06
-
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”.
- Enter your Mercedes-Benz account credentials (username/password) in the integration setup
Important Notes:
- consider using a dedicated Mercedes-Benz account for Home Assistant
- if MFA is enabled on your Mercedes-Benz account, authentication will fail. You must disable MFA or use a separate account without MFA.
How to Prevent Account Blocking
To reduce the risk of your account being blocked, please follow these recommendations:
- Create a separate MB user account for use with this component.
- 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.
- 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
- Flash light
- Sound horn
- Preclimate start
- Preclimate stop
Device Tracker
attributes:
positionHeading
Locks
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
-
Charging Power Limit
attributes:
chargingPowerRestriction
-
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
-
Smart Charging
Four sensors for cars whose charging is managed by a provider. A car without that
setup never sends the data, and the sensors are then not created at all.
Internal Names: smartcharginglocation, smartchargingstation, smartchargingstrategy, smartchargingerror
- Smart Charging Location - the charging location the car reports, e.g.
Home
- Smart Charging Station - the charging station at that location
- Smart Charging Strategy - the charging strategy in use, e.g.
immediate.
Free text set by the backend, so other values can appear at any time.
- Smart Charging Error - the most severe error the car currently reports,
unknown when there is none
Values of Smart Charging Error:
UNKNOWN_CODE
UNAVAILABLE_WITHOUT_OPTIMIZATION
UNAVAILABLE_DIRECT_CHARGING_MODE
UNAVAILABLE_MISSING_VEHICLE_CONNECTION
attributes:
smartChargingErrorList
The car can report more than one error at once. The state names the most severe of them -
MAJOR_ERROR before MINOR_ERROR before WARNING - while smartChargingErrorList keeps all
of them with their severity:
smartChargingErrorList:
- code: UNAVAILABLE_MISSING_VEHICLE_CONNECTION
severity: MAJOR_ERROR
- code: UNAVAILABLE_WITHOUT_OPTIMIZATION
severity: WARNING
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. If no charge program is given, the program the car is currently running is configured.
-
charge_coupler_stop:
Stop the running charging session and release the charge coupler of a car defined by a vin. PIN required.
-
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.
-
preheat_stop_departure_time:
Disable scheduled departure preconditioning of a zero emission car defined by a vin.
-
preconditioning_configure:
Configure the departure time preconditioning mode (disabled, single, or weekly) 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 and/or acoustic signaling of a car defined by a vin. The optional sigpos_type selects the
mode (0=LIGHT_ONLY, 1=HORN_ONLY, 2=LIGHT_AND_HORN, 3=PANIC_ALARM), sigpos_duration the duration in
seconds. Which modes a car accepts is reported by the SIGPOS_TYPE command capability - most cars support
only a subset.
-
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.
-
week_profile_configure:
Add, change or delete one entry of the weekly departure profile of a car defined by a vin. operation is
add, update or delete. add takes no identifier - the car assigns one - and needs a time;
update and delete need the identifier of the entry as the Active weekly profile sensor lists it.
The car replaces its whole profile on every call, so the entries that are not named are re-sent
unchanged - which also means the service needs a full update of the profile first and refuses the call
until it has one. Which options a car accepts differs by model: only some accept charging, precond
and battery_precond per entry or a schedule_type other than no_selection, and the call is rejected
with an explanation when the car does not.
-
windows_close:
Close the windows of a car defined by a vin.
-
windows_move
Move the windows to a given position. PIN required.
-
windows_open:
Open the windows of a car defined by a vin. PIN required.
Switches
- AuxHeat - Start/Stop the auxiliary heating of the car
- Preclimate - Start/Stop the preclimate function 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
Open Items
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.
评论