Skip to content

Home Assistant Dashboard card to show departure time of public transports.

License

Notifications You must be signed in to change notification settings

alex-jung/ha-departures-card

Repository files navigation

Departures Card

A card to display departure times provided by Departures custom integration.

Installation

Manual

  1. Download from last release dist/ha-departures-car.js file.
  2. Switch on advanced mode
  3. Open settings -> Dashboards and click on tree dots in right upper corner
  4. Click on Ressourcen and then on Add Ressource button
  5. Add local/ha-departures-card.js as JS module
  6. Refresh the page

HACS

Ongoing

Using

Let's start adding a new card to dashboard.

type: custom:departures-card

The result should be an empty card in preview window like this:

card

Card configuration

yaml attribute type required default value
type string Required custom:departures-card
title string Optional empty
icon string Optional mdi:bus
showTransportIcon boolean Optional false
showTimestamp boolean Optional false
showDelay boolean Optional false

Card title

You may give your card a meaningsful name. It's done by setting title attribute:

type: custom:departures-card
title: Frankenstr.

card

Card icon

Optionaly we can set an icon for the card with icon attribute:

type: custom:departures-card
...
icon: mdi:bus-articulated-front

Result:

card

Entities

type: custom:departures-card
...
entities:
  - entity: sensor.nurnberg_frankenstr_bus_45_ziegelstein_u_mogeldorf
  - entity: sensor.nurnberg_frankenstr_tram_5_tiergarten

card

Show transport icon

With this attribute you can configure, whether the transpor icon is shown in line column or not

type: custom:departures-card
...
showTransportIcon: true
...
showTransportIcon: true showTransportIcon: false
card card

Show timestamp

The card currently supports two modes of showing the departure times.

  • Show timestamp of next departure (showTimestamp: true)
  • Show time delta to next departure (showTimestamp: false)
type: custom:departures-card
...
showTimestamp: true
...
showTimestamp: true showTimestamp: false
card card

Show delay

!!! warning This option will work only if endpoint provides real time information. Please s. table

type: custom:departures-card
...
showDelay: true
...
showDelay: true showDelay: false
card card

Entity configuration

Each entity can be configured individually with following attributes:

yaml attribute type required default value
entity string Required empty
destination_name string Optional empty
line_name string Optional empty
line_color boolean Optional emtpy

Destination name

Per default the card uses name of departure provided by departures integration. This name can be overwritten by attribute destination_name

type: custom:departures-card
...
entities:
  - entity: sensor.nurnberg_frankenstr_bus_45_ziegelstein_u_mogeldorf
    destination_name: "Ziegelstein"
destination_name: empty destination_name: "Ziegelstein"
card card

Line name

The name of line can be configured as well:

type: custom:departures-card
...
entities:
  - entity: sensor.nurnberg_frankenstr_bus_45_ziegelstein_u_mogeldorf
    line_name: "45"
line_name: empty line_name: "45"
card card

Line color

The attribute will change the background color of line:

type: custom:departures-card
...
entities:
  - entity: sensor.nurnberg_frankenstr_bus_45_ziegelstein_u_mogeldorf
    line_color: "#EB5A3C"
line_color: empty line_name: "#EB5A3C"
card card

About

Home Assistant Dashboard card to show departure time of public transports.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published