Manual / Automate & connect
Events & automation blueprints
BavarianData streams data in real time, so it’s built for automations that react the instant something changes rather than on a polling cycle.
Device triggers
The easiest way in: create an automation, choose Device as the trigger, pick your car, and choose from the list. No YAML and no entity names needed.
| Trigger | Fires when | Options |
|---|---|---|
| Arrived at a zone | a drive ends inside a zone, once the car has parked (usually 1–3 minutes after it stops) | a zone, or empty for any zone |
| Left a zone | a drive carries the car out of the zone it started in | a zone, or empty for any zone |
| Trip ended (anywhere) | a drive is recorded in the trip journal, wherever it ended | — |
| Parked and left unlocked | the car stands unlocked for the chosen time | how long (default 10 minutes) |
| Parked with a window open | a window or the sunroof stands open, or partly open, for the chosen time | how long (default 10 minutes) |
| Plugged in but not charging | a cable is in, nothing is charging, and the car is below its charging target, for the chosen time | how long (default 15 minutes) |
| Charging started | a charging session begins | — |
| Charging completed (target reached) | a session ends at or above the target | — |
| Charging paused, cable still in | charging stops short of the target with the cable in, for more than 2 minutes | — |
| Charging resumed | a paused charge carries on within 5 minutes, or at any time while the car itself says paused (still the same session) | — |
| Charging stopped before the target, cable still in | a session ends short of the target while the cable is still plugged in | — |
| Preconditioning started | the car starts heating or cooling itself | — |
| Preconditioning finished | the car stops heating or cooling itself | — |
| Alarm went off | the anti-theft alarm starts sounding | — |
| New Check Control message | a warning the car did not show before appears | — |
“Charging completed” is the “target reached” trigger. The car stops at its charging target, and the session ends there. To act at a different level, say 70 % on a wallbox with no limit of its own, use a numeric state trigger on the battery level entity.
When a charge counts as ended. When the car reports the charge as ended, the session closes and its events fire at once. A stop short of the target with the cable still in is first a pause: after 2 minutes (a shorter dip is the data stream, not the car) Charging paused fires, and if it carries on within 5 minutes, Charging resumed. The charging history keeps it as one session. Only after 5 minutes stopped does the session end, as stopped before the target. While the car itself reports the charge as paused (it is waiting for a start time set in the car), the wait has no 5-minute limit: Charging resumed fires whenever it carries on, up to a day later. A stop at the target ends the session after the 2 minutes; unplugging ends it at once.
Only the triggers your car can fire are listed. A car that never sent a lock state gets no Parked and left unlocked; the zone triggers need the car’s position and the trip journal (on by default).
What they deliberately don’t do
These triggers are built to fire exactly once, and never falsely:
- Nothing fires from a restart. After Home Assistant restarts, a situation starts again only once the car reports it anew. A car that was locked while Home Assistant was down never raises “left unlocked” on startup. The price is that a car that was already unlocked before the restart is only noticed at its next report.
- Unlocking to get in is not “left unlocked”. The car unlocks at every arrival and relocks itself about two minutes later if no door is opened. The waiting time exists for that; below about three minutes the trigger fires every day.
- A car that is done charging is not “not charging”. At (or within 1 % of) its target, a plugged-in car that has stopped is finished, not stuck.
- Unplugging early is not an interruption. Charging stopped before the target needs the cable still in five minutes after the stop, so a short pause that resumes on its own, or a driver who unplugs, doesn’t fire it.
- Solar and price-controlled charging pauses on purpose. If a charge controller (evcc, a wallbox’s solar mode) stops and starts the charge, Plugged in but not charging and Charging stopped before the target fire at those pauses too — that is what happened. Add a condition (for example “only after 22:00”) or a longer waiting time.
- Arriving is not crossing the boundary. Arrived at a zone fires when the drive ends, so driving past home doesn’t trigger it, and GPS jitter at the zone edge can’t make it flicker. Home Assistant’s own zone triggers on the car’s location entity still exist if you want the moment of crossing.
- A window open while driving is not “parked with a window open”. The situation starts once the drive is over. A partly open window counts: a window left open a crack lets the rain in too.
- An old value is not news. The alarm and preconditioning triggers fire only on a change the car streams, and only while the car’s own time stamp on it is less than 10 minutes old. Neither the catch-up after a restart (BMW may answer it from its cache) nor the car repeating an old value starts them.
- The first Check Control list only sets the starting point. Warnings the car already showed when you installed the integration are not announced. The car sends these warnings only with the data fetched from BMW, never on the live stream, so a new one shows up at the next fetch (at startup, or when a service fetches), not the moment it appears in the car.
- The alarm is not verified on a real alarm. It is built from BMW’s alarm field and tested against recorded data, but no car with this integration has set its alarm off yet. If yours does and nothing fires, please open an issue.
What the automation gets
Every trigger passes its details as trigger.data:
| Trigger | trigger.data |
|---|---|
| Arrived at a zone | zone, zone_entity_id, from, distance_km, duration_s, energy_kwh, soc, trip_id, trip_start |
| Left a zone | zone, zone_entity_id, soc, trip_start |
| Trip ended | as Arrived at a zone (zone and zone_entity_id are null outside a zone), plus trip_end, to, soc_start, classification, odometer_start_km, odometer_end_km (the odometer when the car set off and stopped; null when the car sent none) |
| Parked and left unlocked | since, zone, zone_entity_id |
| Parked with a window open | since, windows (which ones: front_driver, front_passenger, rear_driver, rear_passenger, sunroof, sunroof_tilt, rear_window), zone, zone_entity_id |
| Plugged in but not charging | since, soc, target_soc, zone, zone_entity_id |
| Charging started / completed | soc, target_soc, status (completed: also energy_kwh, cost, session_id) |
| Charging stopped before the target | as completed, plus reason — BMW’s own word for why, when the car sends one |
| Preconditioning started / finished | activity (heating, cooling, … or inactive), error (BMW’s reason when it could not run, such as lowbattery; ok otherwise), soc, zone, zone_entity_id |
| Alarm went off | zone, zone_entity_id |
| New Check Control message | id, title, text, message_type, message (the whole entry as BMW sends it), zone, zone_entity_id |
Every payload also carries vin, entry_id and vehicle, the car’s name as BMW
reports it (null until it does). An example that warns about a
car left unlocked at home:
triggers:
- trigger: device
domain: bavariandata
device_id: <your car>
type: parked_unlocked
for: { minutes: 10 }
conditions:
- condition: template
value_template: "{{ trigger.data.zone_entity_id == 'zone.home' }}"
actions:
- action: notify.mobile_app_phone
data:
message: "The car has been unlocked in the driveway for 10 minutes."
Events
Everything behind the triggers is also fired on the Home Assistant event
bus, for YAML automations and Node-RED (watch them under Developer Tools →
Events). Each carries vin, entry_id and vehicle (the car’s name).
| Event | Fires when | Data |
|---|---|---|
bavariandata_charging_started | a session begins | soc, target_soc, status |
bavariandata_charging_stopped | a session ends (any reason) | soc, target_soc, status, energy_kwh, cost, session_id, preconditioning_only (true when the car only heated or cooled itself), complete (true when it reached its target) |
bavariandata_charging_complete | a session ends at/above the target SoC, also one that finished while Home Assistant was restarting | as charging_stopped |
bavariandata_charging_interrupted | a session ends short of the target with the cable still in | as charging_stopped, plus reason |
bavariandata_charging_paused | charging stops short of the target with the cable in, for more than 2 minutes | soc, target_soc, status |
bavariandata_charging_resumed | a paused charge carries on (the same session) | soc, target_soc, status |
bavariandata_zone_arrived | a drive ends inside a zone | as the Arrived at a zone trigger |
bavariandata_zone_left | a drive leaves the zone it started in | as the Left a zone trigger |
bavariandata_trip_ended | a drive is recorded, in a zone or not | as the Trip ended trigger |
bavariandata_situation | a situation begins (active: true) or ends (active: false) | situation (parked_unlocked, parked_window_open or plugged_not_charging), active, since, … |
bavariandata_preconditioning | preconditioning starts (active: true) or finishes (active: false) | active, then as the Preconditioning triggers |
bavariandata_alarm | the alarm starts (active: true) or stops (active: false) | active, zone, zone_entity_id |
bavariandata_check_control | a Check Control message appears (active: true) or is gone (active: false) | active, then as the New Check Control message trigger |
bavariandata_vehicle_report | the odometer has a new reading and it has not changed for 5 minutes | timestamp (the car’s own time), odometer_km, previous_odometer_km, previous_timestamp, distance_km, fuel_l, fuel_percent, range_km, soc_percent, latitude, longitude, altitude_m, heading |
bavariandata_situation fires at the moment a situation starts, with no waiting
time — the device triggers add the “for N minutes”. In YAML, the same effect
needs a wait_for_trigger on the matching active: false event.
bavariandata_vehicle_report is made for logbooks, above all on older cars
that send their data in one burst when parked and nothing while driving. It
fires once per new odometer reading, after the reading has held for 5 minutes,
so the burst is complete by then. Things to know:
- It does not fire for a repeated reading. Some cars repeat their unchanged odometer every few minutes; that is not a report. Neither is the catch-up after a restart, which hands back the car’s last values.
- The first reading after installing or updating only sets the starting point. The first event comes with the second new reading.
- On a car that streams while driving it fires at the end of the drive —
and a second time if the car stood still for 5 minutes or more in between,
in a long traffic jam for example. Each event carries its own
distance_km, so the distances still add up. - A reading the car could not have driven is not announced. One that runs backwards, or lies further ahead than 250 km/h would cover since the last report, is set aside. If the next reading follows on from it, it was the earlier one that was wrong, and the reports carry on from there. Either way one drive may go unannounced — a made-up one never is.
- The odometer counts whole kilometres, so a drive shorter than one kilometre may not change it and then fires nothing.
- Fields the car does not send are
null. The position comes with the event, as on the device tracker.
Starter blueprints
Nine starter automations ship with the integration. They’re already installed: find them under Settings → Automations & scenes → Blueprints, pick one and fill in the form. Each update of the integration brings their latest version, and automations made from them pick it up at once. A blueprint you changed by hand is left as it is from then on. One you don’t want, delete from the list: it stays deleted, through updates too. To get it back, copy its link from the list below and paste it under Blueprints → Import blueprint.
The ones that message you take your phones from a list (the devices of the Home Assistant Companion app). A notification service typed in before the list existed stays under Older setting and keeps working.
Before v0.9.25 they had to be imported by URL. Home Assistant keeps those copies in a folder of their own, so each one you imported appears twice in the list. Both are updated. Once no automation uses the older copy, you can delete it; its ⋮ menu in the list shows which automations use it. Removing the integration leaves every copy, so an automation made from one keeps working.
-
Stop charging at target % —
stop_charge_at_target.yaml. Switches off a wallbox / smart-plug the moment a SoC sensor reaches your target. CarData is read-only, so it drives an external switch you already have — it can’t command the car directly. -
Notify when charging completes —
notify_charging_complete.yaml. Sends one message when a session ends, either only when the car reached its target or on any end. The title names the car, and Cars limits it to the ones you pick (empty: every car). With Car picture on, the message carries the car’s picture: small beside the text, whole when you press and hold the message. A car without a picture gets the message without one. A run where the car only heated or cooled itself on the cable sends nothing (preconditioning on the cable). Until v0.9.20 a charge that reached its target sent two messages when Only when target reached was off. -
Charging on the lock screen —
charging_lock_screen.yaml. While the car charges, your phone’s lock screen shows a card: the battery as a bar up to the target, the battery level with the target and the charging power, and a countdown to the target that the phone runs by itself.
On an iPhone with a Dynamic Island, the countdown runs there too; touch and hold it for the whole card.
If the car stops short of the target with the cable still in, the countdown stops at once and the card shows ⏸, since the car may carry on by itself; when it does, the countdown comes back. When the charge ends, the card shows ✓ and the level reached (or, short of the target, both), what went in, how long it took (and the cost, with a tariff set), then clears itself after the minutes you set. It refreshes every 5 minutes (Update every), and sooner when the charging power changes by a tenth or more, but never within 3 minutes of the last refresh: a phone gets at most 500 notifications a day from Home Assistant, and every refresh counts. A stop or a pause shows at once. After a restart it picks up a charge that is still running. The card uses symbols and units rather than words, so it reads the same in every language.
The Dynamic Island keeps the level reached until the card clears.
- Needs the Companion app with Live Activities (iPhone: iOS 17.2 and Home Assistant 2026.7 or later) or Live Updates (Android 16 or later).
- The countdown is the integration’s own time to target, known while charging at home. Away from home the card has no countdown; on an iPhone it then shows the target and the energy so far in its place.
- BMW often sends the car’s charging power late, sometimes not for an hour. Pick your wallbox’s power sensor in Wallbox power, and while the car is at home and the wallbox draws power, the card shows the wallbox’s figure.
- A tap on the card opens Home Assistant’s start page. To open your car’s
dashboard instead, put its path in Open on tap, such as
/dashboard-car: copy it from the browser’s address bar while the dashboard is open (the whole address works too). - An iPhone ends a Live Activity after 8 hours; on a longer charge the next refresh starts a new one.
-
Mirror the charging cable into a switch —
plug_to_switch.yaml. Turns a switch on when the cable goes in at home and off when it comes out. Made for charge planners that need to know the car is connected, such as EV Smart Charging’s EV connected switch; see Smart charging. Plugging in away from home does nothing; a car that sends no position counts as home. -
Car arriving home soon —
arriving_home.yaml. Runs your actions once per drive, when the car gets closer to home than the threshold you set: open the garage, warm the house. It needs a figure that falls as the car comes home, with the car’s location as its origin. Either:- Waze Travel Time or Google Maps Travel Time: minutes to home, with traffic. The blueprint refreshes it at every new position.
- Proximity (built into Home Assistant, no account): the distance to home. Set the threshold in km (mi if it shows feet), even though Proximity shows metres: the blueprint converts.
Things to know:
- It doesn’t know where you’re going. It only sees the car getting closer to home. A drive that passes near home and carries on fires it too. Pick the zones your drives home start from (Only trips that start in, e.g. Work) to count only those.
- A short drive may not fire it. One that never got further away than your threshold never crosses it; leaving home never fires it either.
- Expect it a little after the threshold. BMW sends the position about every one to three minutes while driving.
- The car’s own navigation has a GPS arrival time field. A destination set on the phone through CarPlay or Android Auto is unknown to the car, so the blueprint doesn’t rely on it.
-
Rain coming, a window is open —
rain_window_open.yaml. When a window, the sunroof or the tailgate window has been open for 10 minutes, and every hour after that, it checks your weather forecast. Rain within the hours you set (by probability where your forecast gives one, else any rain amount or a rainy condition) runs your actions, with the open ones named inopen_names. Then it stays quiet until everything is closed. -
Frost tonight, the car isn’t plugged in —
frost_unplugged.yaml. At the time you set (20:00 by default), checks the forecast low until 09:00 the next morning. At or below your frost limit, with the car at home and the cable out, it runs your actions, with the low inlow. Plugged in, an electric car can warm its battery and cabin from the grid before you leave. -
One tire losing pressure —
tire_pressure_imbalance.yaml. Compares the two tires on each axle. Weather and the warmth of driving move both alike, so a gap that holds for an hour (30 kPa, 0.3 bar, by default) means one is losing air, usually well before the car’s own warning. It names the tire inlow_tireand fires again only after the gap has closed. Healthy tires stay within about 20 kPa of each other. -
Car left open at night —
car_left_open.yaml. At the time you set (22:00 by default), checks that the car is locked and its doors, windows, sunroof, tailgate and hood are shut. If anything isn’t, it runs your actions once, with what is open or unlocked inopen_names. You only pick the car (or several): it finds the car’s lock, door, window and lid sensors itself and checks those your car sends. The charge flap and the cable lock are left out, since they are open every night the car charges. To check from your own goodnight routine instead, run the automation from it. The car can’t be locked from Home Assistant (CarData is read-only); lock it in the My BMW app.
Ask Assist about your car
Want to ask “Is the car locked?” or “Do I need to charge before driving to Munich?” instead of building an automation? BavarianData’s tools for Assist and AI agents have their own page: Ask Assist & AI about your car.
Remember: read-only
CarData cannot send commands, so no automation built on this integration can lock, precondition, or otherwise control the car. Automations act on external devices (wallboxes, plugs, notifiers) in response to the car’s data.