Enable Debug Logging
masterIf you encounter issues, set the logging level to debug for the mbapi2020 component in your Home Assistant configuration:
logger:
default: warn
logs:
custom_components.mbapi2020: debugrepository·master·Indexed 43 days ago
https://github.com/renenulschde/mbapi2020A custom Home Assistant component for integrating Mercedes-Benz vehicle data. It provides access to sensors (fuel, range, tire pressure, battery state), binary sensors (warning lamps, theft system), locks, and services for remote control of climate, doors, windows, and engine start/stop. Supports real-time updates via WebSocket and requires a Mercedes-Benz account without MFA.
If you encounter issues, set the logging level to debug for the mbapi2020 component in your Home Assistant configuration:
logger:
default: warn
logs:
custom_components.mbapi2020: debugThe MercedesME 2020 component is a Home Assistant custom component, not an Add-On.
custom_component folder and copy it into your Home Assistant config folder.To minimize the risk of your Mercedes-Benz account being blocked by the service, follow these best practices:
Note on Geofencing: Certain features like geofencing data are only available to the primary user. If your Home Assistant setup requires geofencing, you must use the primary user account in HA and use secondary accounts for the official mobile apps.
You can manage optional settings via the Options dialog in Home Assistant under Configuration > Integrations.
Available configuration keys:
Excluded Cars: A comma-separated list of VINs to exclude from integration.PIN: The Security PIN required to execute special services. Set this up using your Mercedes-Benz mobile app.Disable Capability Check: (North America only) When enabled, the component will skip checking the car's capabilities.Debug Save Messages: When enabled, all relevant received messages are saved into the component's messages folder.The Client maintains a dictionary of Car objects, keyed by their VIN or FIN. Data is ingested through _build_car, which handles both full data loads (REST) and incremental updates (WebSocket/Push).
Key behaviors:
excluded_cars, it is ignored.pull (from REST) or push (from WebSocket).CarAttribute objects for various components like Odometer, Tires, Windows, Electric, and Precond.windowStatusOverall is missing, the client creates a synthetic status to ensure entity consistency.The Client uses an on_data handler to process various message types received via WebSocket. When a message arrives, the client identifies the msg_type and performs specific actions, often returning an acknowledgment command to the server.
Supported message types include:
vepUpdates: Triggers _process_vep_updates and returns an acknowledgment with the received sequence_number.vehicle_status_updates: Triggers _process_vehicle_status_updates.apptwin_command_status_updates_by_vin: Processes command status updates.assigned_vehicles: Processes assigned vehicle information.data_change_event: Acknowledges data changes.user_data_update, user_picture_update, user_pin_update, etc.: Various user-related updates that require sequence number acknowledgments.Diagnostic sensors are hidden by default in Home Assistant; check the Devices page to view them.
Car: Monitors API communication. 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: Shows true if extended configuration (like interior lighting) is available. Note: Users on versions < 0.6 may require re-authentication to enable this. Attribute: rcp_supported_settings (List of remote configuration options).A wide range of sensors are available to monitor vehicle telemetry and state.
Fuel Level (%): Attribute tankLevelAdBlue.odometer: Attributes include distanceStart, averageSpeedStart, gasconsumptionstart, gasTankRange, gasTankLevel, tanklevelpercent, etc.Oil Level (%)Range Electric: Attributes include chargingstatus, distanceElectricalStart, maxrange, selectedChargeProgram.Electric consumption start / Electric consumption resetCharging power / Charging Power Limit (Attribute: chargingPowerRestriction)State of Charge (soc): Represents battery charge level (0-100%). Attributes: maxSocLowerLimit, maxSoc.Starter Battery State: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)Ignition state:0: lock1: off2: accessory4: on5: startAux Heat Status: Monitors heating/ventilation state. Attributes: auxheatActive, auxheattimeselection, temperature_points_frontLeft, etc.Departure Time: Planned departure time for preconditioning. Attribute: departureTimeWeekday.tirepressure[RearLeft|RearRight|FrontRight|FrontLeft]Geofencing Violation: Values ENTER or LEAVE. Attribute: Last_event_zone.The integration provides several binary sensors to monitor vehicle status. Note that availability depends on your specific car model or purchased Mercedes-Benz licenses.
warningwashwaterwarningcoolantlevellowwarningbrakefluidwarningenginelight (Attributes: warningbrakefluid, warningwashwater, warningcoolantlevellow, warninglowbattery)parkbrakestatus (Attribute: preWarningBrakeLiningWear)tirewarninglamp (Attributes: tireMarkerFrontRight, tireMarkerFrontLeft, tireMarkerRearLeft, tireMarkerRearRight, tirewarningsrdk, tirewarningsprw, tireTemperatureRearLeft, tireTemperatureFrontRight, tireTemperatureRearRight, tireTemperatureFrontLeft)theftsystemarmed (Attributes: carAlarmLastTime, carAlarmReason, collisionAlarmTimestamp, interiorSensor, interiorProtectionStatus, interiorMonitoringLastEvent, interiorMonitoringStatus, exteriorMonitoringLastEvent, exteriorMonitoringStatus, lastParkEvent, lastTheftWarning, lastTheftWarningReason, parkEventLevel, parkEventType, theftAlarmActive, towProtectionSensorStatus, towSensor)windowsClosed (Attributes: windowstatusrearleft, windowstatusrearright, windowstatusfrontright, windowstatusfrontleft)remoteStartActive (Attribute: remoteStartTemperature)engineStatechargeFlapACStatusPreclimate 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 (Attribute: wiperLifetimeExceeded)The integration provides lock entities.
doorlockstatusvehicle.0: vehicle unlocked1: vehicle internal locked2: vehicle external locked3: vehicle selective unlockedAttributes include: decklidstatus, doorStatusOverall, doorLockStatusOverall, doorlockstatusgas, doorlockstatusvehicle, doorlockstatusfrontleft, doorlockstatusfrontright, doorlockstatusrearright, doorlockstatusrearleft, doorlockstatusdecklid, doorstatusrearleft, doorstatusfrontright, doorstatusrearright, doorstatusfrontleft, rooftopstatus, sunroofstatus, engineHoodStatus.
You can control vehicle functions using the following buttons and switches:
Flash lightPreclimate startPreclimate stopAuxHeat: Start/Stop the auxiliary heating of the car.Preclimate: Start/Stop the preclimate function of the car.