A custom Home Assistant Lovelace card for displaying public transport departures. Works with the openpublictransport integration.
- Open HACS in your Home Assistant instance.
- Go to Frontend > + Explore & Download Repositories.
- Search for OpenPublicTransport Card.
- Click Download.
- Restart Home Assistant.
- Download
openpublictransport-card.jsfrom the latest release. - Copy it to
config/www/openpublictransport-card.js. - Add the resource in Settings > Dashboards > Resources:
- URL:
/local/openpublictransport-card.js - Type: JavaScript Module
- URL:
Classic departure board with time, line, destination, and platform columns.
type: custom:openpublictransport-card
entity: sensor.dusseldorf_hbf_departures
layout: table
max_departures: 10
theme: dark
show_header: true
show_platform: true
show_delay: true
show_realtime_indicator: trueSpace-efficient chip-based view — ideal for dashboards with limited space.
type: custom:openpublictransport-card
entity: sensor.dusseldorf_hbf_departures
layout: compact
max_departures: 6
theme: autoSingle large next departure — perfect for a glanceable dashboard widget.
type: custom:openpublictransport-card
entity: sensor.dusseldorf_hbf_departures
layout: next
theme: auto
show_platform: true
show_delay: trueMulti-leg journey view for A→B trip planning sensors.
type: custom:openpublictransport-card
entity: sensor.trip_home_to_work
layout: trip
theme: auto
show_header: true| Option | Type | Default | Description |
|---|---|---|---|
entity |
string | required | Entity ID of the transport sensor |
layout |
string | table |
Card layout: table, compact, next, trip |
max_departures |
number | 10 |
Maximum number of departures to display |
line_filter |
string | "" |
Show only specific lines, comma-separated (e.g. U6, S1, RE5). Empty = all |
destination_filter |
string | "" |
Show only departures heading to matching destinations, comma-separated substring match (e.g. Duisburg, Flughafen). Empty = all |
show_header |
boolean | true |
Show the card header with station name |
show_platform |
boolean | true |
Show platform/track column |
show_delay |
boolean | true |
Show delay badges |
show_realtime_indicator |
boolean | true |
Show green checkmark for on-time realtime |
theme |
string | auto |
Theme: dark, light, auto |
Line badge colors are applied automatically when the provider supplies them (e.g. VBB, BVG in Berlin). No configuration needed — if the integration returns line_color and line_text_color, the badge uses them; otherwise it falls back to the card's accent color.
The line_filter option filters departures directly in the card, independently of the integration's own line_filter setting. Both can be combined:
- Integration filter (
line_filterin HA config): reduces API load, affects all entities using that stop - Card filter (
line_filterin card YAML): visual only, useful when you want different views of the same sensor
type: custom:openpublictransport-card
entity: sensor.dusseldorf_hbf_departures
layout: table
line_filter: "U79, U75" # show only U79 and U75The destination_filter option shows only departures heading toward one or more destinations/directions — handy when a stop is served in both directions and you only care about one. Matching is case-insensitive substring, comma-separated (any match wins):
DuisburgmatchesDuisburg HbfandDuisburg Hbf via StadtmitteDuisburg, Flughafenmatches either destination- Empty = show all destinations
It can be combined freely with line_filter, and like the line filter it works independently of the integration's own filter — point several cards at the same sensor, each showing a different direction:
type: custom:openpublictransport-card
entity: sensor.dusseldorf_hbf_departures
layout: table
destination_filter: "Duisburg" # only departures toward Duisburgnpm install
npm run build
# or for watch mode:
npm run devMIT - Copyright (c) 2026 NerdySoftPaw
