Swiss Public Transport Card

Hi there,

Recent days I worked on a Swiss Public Transport Card for the Home Assistant Lovelace UI. The card currently can display departures in a stationboard style:

To make this work I also had to work on the swiss public transport integration. At this stage this changes are still under review (, so this card cannot readily be used. However, if you are willing to update the component manually, I made the card available on Github and added a

At this point the card pretty much does what I wanted it to do. I am not entirely happy with the styling yet (e.g. the platform looks somewhat lost on the left corner). Ideas/feedback welcome!

There is some unique behavior with the backend/API: Zürich Hardbrücke (like most train station) are two stations in the API, one for the Bus/Tram stop and one for the train stop. That is why I had to add stationboard as a list, so one can add both stations. The HA integration makes for each station an API request, combines the departures and sorts them by time. For each station the next 5 (or whatever limit is configured) departures get fetched. The problem with that approach is if the two stations have departures at different intervals it leads to a bit uneven stationboard (e.g. buses of the next 5 minutes are displayed but trains of the next 30 minutes…). It’s not a huge issue, just somewhat unfortunate.

I was also thinking to add support for the connection mode (maybe displaying similar to how Google Maps Direction mode does). Let me know what you think.



This looks very good! Will try this as soon as the other commits are merged. Currently the Swiss Transport API skips the next train even though the departure time has not passed yet, should be in 0.104.

seems like the MR has not been merged yet. Was there any progress?

I did some effort to simplify the installation:

  • Removed the dependency of moment.js as it seem to cause problems
  • HACS installation possible


  • localize some strings
  • test delay visualization (doesn’t work?)

The final goal should be a proper update of the current swiss_public_transport sensor. So feel free to do a merge request again or to improve your own implementation.

Hallo. Nice integration

Does anyone have a problem aswell with the lovlace showing (+1) on every Scheduled train?
It hits red and changes if the train is delayed, but if a train isnt. i have on every line this (+1).

Hi Reto
I had implemented it like this:
Trains are really always 1 minute late according to Opendata API. See also the stationboard example from opendata:

Opendata uses as underlying API. See also here:ĂĽpfen..Bern?now=17.04.2023+09.46&toggle=v1

Since virtually every train (yes, there are exceptions) is delayed by one minute, I have only applied the red coloring starting at 2 minutes.