Based on @agners lovelace card:
Extends the swiss_public_transport sensor by a few features required to visualize a proper stationboard:
stationboard
propertylimit
property
@agners implementation depends upon a pull-request which was never merged. To simplify the installation of this sensor, I created two HACS repositories (this one and one for the lovelace-card).
Note: You can use the data of this sensor on its own or use the custom lovelace-card to visualize a stationboard.
- Got to HACS
- Add a custom repo: https://github.com/neuhausf/swiss-public-transport-mod
- Install it
Add a new sensor to your configuration.yaml
:
sensor:
- platform: swiss_public_transport_mod
name: Schüpfen
limit: 4
stationboard:
- Schüpfen
Note that you can aggregate multiple starting stations into the same sensor. For example, if multiple, surrounding bus/tram stations are to be included. For each station a limit
maximum number of connections is fetched:
sensor:
- platform: swiss_public_transport_mod
name: Bern
limit: 4
stationboard:
- Bern
- Bern, Hirschengraben
In this example, limit
equals 4, so 4 connections are fetched starting from Bern and 4 connections starting from Bern, Hirschengraben (total 8):
Multiple sensors with completely different output locations are also possible. To do this, simply duplicate the configuration:
sensor:
- platform: swiss_public_transport_mod
name: Schüpfen
limit: 4
stationboard:
- Schüpfen
- platform: swiss_public_transport_mod
name: Langenthal
limit: 4
stationboard:
- Langenthal
... this will lead to:
This integration uses :
- the changes made in the pull request by @agners: home-assistant/core#30715
- and some own code to make it work with never home assistant versions