A card to display departure times provided by Departures custom integration.
- Download from last release
dist/ha-departures-car.js
file. - Switch on
advanced mode
- Open
settings -> Dashboards
and click on tree dots in right upper corner - Click on
Ressourcen
and then onAdd Ressource
button - Add
local/ha-departures-card.js
as JS module - Refresh the page
Ongoing
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:
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 |
You may give your card a meaningsful name. It's done by setting title
attribute:
type: custom:departures-card
title: Frankenstr.
Optionaly we can set an icon for the card with icon
attribute:
type: custom:departures-card
...
icon: mdi:bus-articulated-front
Result:
type: custom:departures-card
...
entities:
- entity: sensor.nurnberg_frankenstr_bus_45_ziegelstein_u_mogeldorf
- entity: sensor.nurnberg_frankenstr_tram_5_tiergarten
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 |
---|---|
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 |
---|---|
!!! 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 |
---|---|
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 |
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" |
---|---|
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" |
---|---|
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" |
---|---|