neuhausf / swiss-public-transport-mod

Simplify the integration of the stationboard by @agners

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

hacs_badge

swiss-public-transport-mod

Based on @agners lovelace card:

Extends the swiss_public_transport sensor by a few features required to visualize a proper stationboard:

  • stationboard property
  • limit 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).

Information

Note: You can use the data of this sensor on its own or use the custom lovelace-card to visualize a stationboard.

Configuration

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):

(note that you need the [lovelace-card](https://github.com/neuhausf/lovelace-swiss-stationboard "lovelace-card") to visualize the sensor)

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:

Privacy

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

About

Simplify the integration of the stationboard by @agners

License:MIT License


Languages

Language:Python 100.0%