Home Assistant projects
All projects

Public Transport

Integration + card · Everyday
v1.1.0 · Nov 13, 2026 HA 2024.12.0+ Marketplace

The next departures at your public transport stops, with traffic alerts.

Lines, direction, minutes left, real time or timetable, and the traffic alerts of your stops, set up in the UI. The first network is STAR, the bus and metro of Rennes Métropole; cards are bundled with the integration.

Highlights

  • Stops set up in the UI: pick the network, search the stop, choose the lines
  • Next departure sensor per stop and a sensor per followed line
  • Real time with its delay, or timetable
  • Traffic alert binary sensor per stop
  • One request per network, whatever the number of stops
  • Card with line badges in their official colours and a live countdown
  • Mini card with the next three departures of each stop

Cards

public-transport-cardpublic-transport-mini-card
type: custom:public-transport-card

Install

  1. 1Open the repository in the Marketplace with the Add to Marketplace button above, or addgithub.com/juju35/ha-public-transport as a custom repository (category Integration).
  2. 2Download it from the Marketplace.
  3. 3Restart Home Assistant and add the integration from Settings → Devices & services.

Documentation

From the README

Features

Features

  • Stops set up in the UI: pick the network, search the stop by name, choose the lines to follow — no YAML, no stop code to look up
  • Next departure sensor per stop (timestamp), with the coming departures, the lines and their colors, and the alerts as attributes
  • Line sensor per followed line: its next departure, destination, real time or not, delay
  • Traffic alert binary sensor per stop, on while an alert concerns one of its lines
  • Real time or timetable, for each departure: real-time times come with their delay to the timetable; timetable-only times are marked like the * of the stop displays
  • Hundreds of networks: a generic GTFS / GTFS-RT provider searches the national catalogue by city or network name, downloads the timetable once a day and corrects it with the real-time feed
  • Network logo in the card header, when the integration ships one
  • One request per network: every stop of a network is updated at once, so following more stops costs no more of the open data quota
  • public_transport.refresh action to update now
  • custom:public-transport-card card, shipped with the integration and loaded automatically: line badges in the official colors, countdown that ticks by itself, real-time indicator, collapsible traffic alerts, and an animated scene of the next departure (the bus or the train drives in when it is close)
  • custom:public-transport-mini-card compact card: the next three departures of each stop, with a button to open the full card
  • Diagnostics download with the API key redacted
  • English, French, German, Spanish, Serbian (Cyrillic and Latin), Italian, Dutch, Portuguese, Polish, Romanian, Danish, Swedish, Bulgarian, Russian, Ukrainian, Hungarian, Slovak, Czech, Slovenian, Latvian and Greek

Supported networks

Supported networks

Network Area Modes Real time Alerts Data
STAR Rennes Métropole (France) Bus, metro (lines a and b) Yes, with the timetable delay (bus) Yes, with their level (information, disruption, major disruption) data.explore.star.fr (ODbL), no key needed
Île-de-France Mobilités Île-de-France Metro, RER, Transilien, tram, bus Yes, with the timetable delay Yes (general messages of the lines followed) PRIM (SIRI Lite) + IDFM open data, free PRIM key required
TCL Lyon Metro, funicular, tram, bus Yes (estimated or timetable) Yes data.grandlyon.com, free account required (key typed as login:password)
CTS Strasbourg Tram, bus Yes (real time or timetable) Yes api.cts-strasbourg.eu (SIRI 2.0), free token required
GTFS-RT Any network of transport.data.gouv.fr with a GTFS-RT feed All (from the GTFS route types) Yes: trip updates (delays, cancelled trips, skipped stops, extra trips) When the network publishes service alerts GTFS + GTFS-RT of the national access point (licences vary by network, mostly ODbL or Licence Ouverte)

Through GTFS-RT: Toulouse (Tisséo), Montpellier (TaM), Bordeaux (TBM), Nantes (Naolib), Lille (Ilévia), Rouen (Astuce), Nice (Lignes d'Azur), Tours (Fil Bleu), Le Havre (LiA), Angers (Irigo), Brest (Bibus), and many smaller networks — any dataset of the catalogue with both a GTFS file and a GTFS-RT feed. More networks can be added as providers: see Adding a network.

Prerequisites

Prerequisites

  • Home Assistant 2024.12 or later
  • Internet access to the network's open data portal

Configuration

Configuration

Integration#

Add integration

Settings → Devices & services → Add integration → Public Transport, then:

  1. Network: STAR, Île-de-France Mobilités, TCL, CTS, or GTFS-RT for any other network. STAR works without a key; IDFM (PRIM key), TCL (login:password of a data.grandlyon.com account) and CTS (open data token) need their free key.
    • GTFS-RT: type a city or a network name (Toulouse, Tisséo…), choose the network in the list, and wait while its timetable is downloaded and read (up to a minute for a big network).
  2. Stop: type part of its name (Républ, Gares…).
  3. Choose the stop: stops of the same name are the platforms of each direction; the bus lines serving each one and the destinations of its next departures (→) are listed after its name, so you can tell them apart (a metro station has one platform per direction).
  4. Lines: all the lines serving the stop are selected; keep the ones you take.

Add the integration again for each stop. Each stop is a device with its own sensors.

Options (Configure button):

Option Default Description
Lines the lines chosen Lines followed at this stop; each one has its own sensor
Update interval 60 s 30 s to 10 min. All the stops of a network are updated in one request, at the shortest interval of its stops
Departures kept 6 Coming departures in the stop sensor's attributes, which the card shows
API key none Required by IDFM, TCL and CTS; for STAR, it only raises the daily quota of the open data API (free account on data.explore.star.fr)

Entities#

For a stop named République:

Entity State Main attributes
sensor.star_republique_next_departure Next departure on the followed lines (timestamp) departures (line, colors, destination, departure, scheduled, delay, realtime), lines, alerts, stop_name, mode, network, stale, last_error
sensor.star_republique_line_c4 Next departure of line C4 (timestamp) destination, realtime, delay, color, next_departures
binary_sensor.star_republique_traffic_alert on while an alert concerns a followed line level (1 to 3), alerts

The timestamp states work as they are in automations and in the standard cards (Next departure: in 4 minutes):

triggers:
  - trigger: template
    value_template: >
      {{ states('sensor.star_republique_line_c4') not in ['unknown', 'unavailable']
         and (as_datetime(states('sensor.star_republique_line_c4')) - now()).total_seconds() < 300 }}
actions:
  - action: notify.mobile_app_phone
    data:
      message: "C4 to {{ state_attr('sensor.star_republique_line_c4', 'destination') }} in 5 minutes"

Refresh action#

action: public_transport.refresh
data:
  config_entry_id: 01J...   # optional: only the network of this stop

Errors are translated in the Home Assistant language.

Card types#

Type Description
custom:public-transport-card Full card: animated scene of the next departure, departures of each stop, traffic alerts
custom:public-transport-mini-card Compact card: the next three departures of each stop; the button at the top right opens the full card in place, a click outside folds it back

Visual editor#

Add the Public transport card from the card picker: every option is set in the visual editor.

Minimal#

type: custom:public-transport-card

Without entities, the card shows every stop of the integration.

Full options#

type: custom:public-transport-card
entities:
  - sensor.star_republique_metro_next_departure
  - sensor.star_republique_next_departure
title: To work
show_title: true
show_scene: true
show_alerts: true
show_refresh: true
max_departures: 5
time_format: relative
language: en

Options reference#

Option Default Description
entities every stop Stop sensors (sensor.*_next_departure) to show, in this order; line sensors (sensor.*_line_*) work too
title Next departures Card title
show_title true Show the title in the header (e.g. false under a section heading of your own)
show_scene true Show the animated scene of the next departure (first stop)
show_alerts true Show the traffic alerts (and their count in the header)
show_refresh true Show the refresh button
max_departures 5 Departures shown per stop (up to the integration's Departures kept)
time_format relative relative: countdown (4 min, Now), clock time from an hour; absolute: always the clock time
language Auto Force language: en, fr, de, es, sr, sr-Latn, it, nl, pt, pl, ro, da, sv, bg, ru, uk, hu, sk, cs, sl, lv or el (auto-detects from HA settings)

The mini card takes the same options; show_scene and max_departures apply to its full view.

How it works

How it works

Each config entry is one stop. The entries of the same network share one coordinator: it asks the network for the departures of all their stops in a single request (one per mode for STAR, bus and metro being separate datasets), at the shortest update interval among them. Line names and colors are fetched once a day, traffic alerts every 5 minutes.

When an update fails (quota reached, timeout, server error), the sensors keep the last departures — without those already gone — and flag them with their stale (true) and last_error attributes; the card says the network is unreachable. Only a failed first update leaves the stop to be set up again later.

The card reads the stop sensors and counts the minutes down every 15 seconds by itself, between two updates. A departure 2 minutes away or less is approaching: the countdown pulses and the scene shows the vehicle arriving.

STAR open data#

Dataset Used for
tco-bus-circulation-passages-tr, tco-metro-circulation-passages-tr Coming departures, and their destinations in the stop list; precision Temps réel (real time) or Applicable (timetable); the timetable time (delay) for the bus only
tco-bus-topologie-pointsarret-td, tco-metro-topologie-pointsarret-td Stop search
tco-bus-topologie-dessertes-td Lines serving each bus stop
tco-bus-topologie-lignes-td, tco-metro-topologie-lignes-td Line names and official colors
tco-busmetro-trafic-alertes-tr Traffic alerts; their level (Mineure, Bloquante, Majeure) gives 1 to 3

The portal's API works without a key; a key (free account) only raises the daily quota.

GTFS-RT networks#

The catalogue is the transport.data.gouv.fr API: a network is offered when its dataset has a GTFS file and a GTFS-RT feed with trip updates.

  • The GTFS zip is downloaded into .storage/public_transport/ and refreshed once a day (conditional request); it is read in the background, keeping the stops, routes, trips, calendars and only the timetable of the followed stops.
  • Departures are the timetable of the next 3 hours, corrected by the GTFS-RT trip updates: times or delays (propagated to the following stops), cancelled trips and skipped stops removed, extra trips added. When the real-time feed fails, the timetable is still shown, marked as such.
  • Alerts come from the service alerts feed, when there is one; an alert on a stop concerns the lines serving it.
  • The GTFS-RT protocol buffers are read by a small built-in decoder: no extra dependency.

Île-de-France Mobilités, TCL and CTS#

Network Departures Stops and lines Alerts
IDFM PRIM stop-monitoring (one request per stop; 1,000,000 a day) arrets-lignes, referentiel-des-lignes (official colors) PRIM general-message, for the lines seen at the followed stops
TCL tcl_sytral.tclpassagearret (one request per stop) tcl_sytral.tclarret (lines from desserte) tcl_sytral.tclalertetrafic_2
CTS SIRI stop-monitoring (one request per stop) stoppoints-discovery, lines-discovery (official colors) SIRI general-message

Network logos#

The card shows the network's logo in its header when the integration ships frontend/logos/<network>.svg (or .png) (star, idfm, tcl, cts; a GTFS-RT network as gtfs-<dataset>.svg) and every stop of the card belongs to that network; otherwise it keeps its icon. Shipped: STAR, CTS and TCL (Wikimedia Commons), Île-de-France Mobilités (Simple Icons, CC0), Tisséo, TaM, Fil Bleu (Wikimedia Commons, PNG), TBM, Naolib, ilévia, Astuce, Lignes d'Azur, LiA, Irigo (Wikimedia Commons). The logos remain the trademarks of their networks.

Adding a network#

A network is a class of custom_components/public_transport/providers/ deriving from Provider (providers/base.py) and registered in providers/__init__.py. It implements:

Method Returns
search_stops(query) Stops matching a name
lines_at_stop(stop) Lines serving a stop
lines() Every line, with its colors
departures(stops) Coming departures of several stops, in as few requests as the API allows
alerts() Current traffic alerts (optional)

The config flow, sensors and cards then work unchanged. A provider that serves many networks sets needs_network (the config flow asks which one, see providers/gtfs.py); one whose API needs a key sets api_key_mode = "required". Contributions for other networks are welcome.

Support

Support

If you find this project useful, you can support its development:

Buy Me a Coffee

Changelog

CHANGELOG.md

1.1.0Nov 13, 2026Latest

Features

  • GTFS-RT networks: every network of transport.data.gouv.fr with a GTFS timetable and a GTFS-RT feed (Toulouse, Montpellier, Bordeaux, Nantes, Lille, Brest… and hundreds of smaller ones). The network is searched by city or name in the national catalogue; its timetable is downloaded once a day, read in the background and corrected by the trip updates (delays, cancelled trips, skipped stops, extra trips); service alerts when published. Built-in GTFS-RT reader, no new dependency.
  • Île-de-France Mobilités (PRIM key): metro, RER, Transilien, tram and bus, with official line colors and the general messages of the lines followed.
  • TCL (Lyon, data.grandlyon.com account) and CTS (Strasbourg, open data token).
  • Network logo in the card header (logo attribute of the stop sensor), when the integration ships one.
  • The config flow asks for the key of the networks that need one.

Fixes

  • biome.json schema aligned with the Biome version of the pre-commit hook.

1.0.0Nov 13, 2026

Features

  • Public Transport integration (public_transport): next departures at your stops, one config entry per stop, set up in the UI (network, stop search, lines to follow) with options for the lines, the update interval, the departures kept and an optional API key.
  • First network: STAR (bus and metro of Rennes Métropole) through its open data portal — real-time departures with their delay to the timetable, timetable-only departures marked as such, official line colors and traffic alerts.
  • Networks are providers (providers/): one coordinator per network asks for every stop of that network in one request.
  • Sensors: next departure per stop (with the coming departures, lines and alerts as attributes) and per followed line; traffic alert binary sensor per stop.
  • public_transport.refresh action; diagnostics with the API key redacted.
  • custom:public-transport-card, shipped with the integration: line badges, ticking countdown, real-time indicator, collapsible traffic alerts and an animated scene of the next departure (vehicle arriving, idling, real-time waves).
  • custom:public-transport-mini-card: the next three departures of each stop, with a button to open the full card.
  • 22 languages; in the release zip, the card keeps English and loads the other languages on demand.