Public Transport Departures Card - silviokennecke/ha-public-transport-connection-card GitHub Wiki
This card displays the next departures, provided by a sensor.
This card is designed and tested to work with the sensors provided by the Faser/ha-db_infoscreen integration. However, it should also work with other integrations providing similar data. If you would like to provide a default configuration for other integrations, feel free to contribute.
This card is available from version 3.0.0.
This card provides different layouts to suite different purposes.
This layout is suggested for departures with varying connections (platforms, trains, etc.). It shows the first connection with all the details and later connections below.

This layout works like the departure boards on tram and bus stops. It just shows the line, direction and the departure time in minutes.

This layout is meant if you already filtered for the correct destination. It is nearly the same as station_departures with the only difference that it's not showing the destination. I decided for this card to remove the destination but show the next stops to quickly get an overview, if the train is a regional train or an "express" train.

The card automatically searches for sensors that probably are compatible with this card. This way, you can simply use the card selector in the Home Assistant UI. In case you use the automatically detected sensor, most of the configuration should already been done.
Configuration for ha-db_infoscreen
type: custom:public-transport-departures-card
title: Abfahrten via Altona
entity: sensor.hamburg_hbf_departures
layout: station_departures
departures_attribute: next_departures
departure_properties:
time: scheduledDeparture
delay: delayDeparture
cancelled: isCancelled
train: train
direction: destination
platform: platform
next_stations: via
displayed_departures: 5
destination_filter: AltonaAll configuration options are available using the Home Assistant UI.
| key | required | type (or of attribute value) | description | |
|---|---|---|---|---|
| title | N | string |
a title that is shown in the card | |
| theme | N | string |
the theme to use; currently supported: deutsche-bahn, homeassistant
|
|
| entity | Y | string |
entity id of the sensor providing the departures | |
| tap_action | N | Action |
an action to be executed when the card is tapped (default: more-info) | |
| layout | N | string |
the layout how the card should be displayed; currently supported: station_departures, platform_departures, fixed_destination
|
|
| departures_attribute | Y | string |
the attribute containing an array of departure objects | |
| departure_properties | Y | object |
contains information about the property names, with more information about the departures; | |
| time | Y | string|time |
the departure time | |
| delay | N | number |
the current delay | |
| cancelled | N | boolean |
if the connection got cancelled | |
| train | N | string |
the train number | |
| direction | Y | string |
the direction (in most cases the final station) | |
| platform | N | string |
the platform fron which the connection departs | |
| next_stations | N | Array<string> |
the next stations the connection will stop at | |
| destination_filter | N | string|string[] |
In case you want to only display connections heading to a specific station, you can enter a search term here. You can enter multiple terms, when configuring via the UI you can split them using a semicolon ;. The direction and next_stations are searched for the configured terms (contains, case-insensitive). |
|
| displayed_departures | Y | number |
the maximum number of departures to be shown; minimum 1 |