Skip to content
Arjan edited this page Jul 21, 2026 · 151 revisions

Overview

The GTFS2 project adds supports for GTFS public transit feeds (both static and real-time) to Home Assistant. You can use this Home Assistant integration to see when the next train or bus to your destination is departing, etc. The integration creates HA entities such as sensors for the next departure time of a trip (a start stop + end stop) that you configure. For example, you can configure a trip that represents your home-to-work commute, and add a dashboard card that displays much time you have until the next train or bus on that commute trip departs.

This project combines and improves on the work of others, and verifies functionality with multiple GTFS data providers. This is ongoing work but has proven to work well.

Features

  • Configuration is done via the HA web UI. You do not need to edit configuration.yaml!
  • Allows loading, updating, and deleting GTFS datasources directly in the HA web UI. You can directly use the filesystem for GTFS data too, if you want to.
  • Allows adding sensors that track departures from stops around a configured location (zone or person), including using real-time data. In other words, you can create sensors whose values update as you move around, reflecting the transit options where you currently are.
  • Has translations for English, French, German, Spanish, Portuguese

GTFS static schedule features

  • Supports importing static GTFS schedule files, e.g. via a zip file from the transit provider.
  • Uses the route information in the GTFS schedule to help select start/end stops.
  • Shows next 10 arrivals on configured start/end stop, including via alternative transport lines if applicable.
  • Creates a service to update the GTFS static datasource, e.g. for updating the static datasource via automation.

GTFS real-time features

  • Supports adding GTFS real-time sources via a URL.
  • Supports using GTFS real-time vehicle location. You can track a vehicle (train, bus, etc.) on a dashboard map card.
  • Supports adding GTFS real-time service alerts via a URL.
  • Creates a service to add/update GTFS real-time locally, e.g. to reduce multiple calls for the same data externally

Screenshots

image image

Sources of GTFS feed data

Useful sites for finding GTFS data sources:

  • Busmaps (aka GTFS.pro). Busmaps also has 'improved' datasets, probably cleaned and consistency-checked, often much smaller zip and thus quicker in unpacking. Busmaps seems to have become more commercial and visibility to the GTFS files is less transparent, one needs to search more than before. Use the provided link and change the country to yours. That works...for now.
  • Mobility Database

Note

There are often multiple GTFS data sources that cover the same transport provider or geographical area. The background for that is unclear but there are known issues between them as inconsistent data, lack of updates, etc. Always verify the individual data sources, as quite a few of them have proven to be incomplete or incorrect. This is not the responsibility of the above sites, but I found busmaps/gtfs.pro provides better data.

Sources working/tested with GTFS2

These lists are non-exhaustive. Links may change over time, so please open an issue if you find missing or erroneous information.

Types: B(us) T(ram), R(ail), S(ubway), F(erry). A GTFS data source may cover other types as cable cars, gondola, stairs, taxi, etc., but those types are not verified working.

Extraction time (in hours): Indicates roughly how long it takes GTFS2 to extract the static GTFS data from the provider's zip file. Use it as an esitmate for how long to expect to wait for the process of adding it as data source will take to complete.

Tested: Indicates the Year-Month of initial testing with the release/version avaialable at that time. These are not part of any planned regression testing with new releases. The ones I use myself will show updates, and you can submit updates of your experience,

Europe

Provider Geo-covering Type Static RT Trip RT Veh. Pos. RT Alert Link Extraction time (in hours) Comment Tested
Zou 06 Region B x x link 0.25 2024-04
PalmBus Cannes City B x x x x link 0.5 issue with feed_info.txt in zip, use the Service call 2024-04
Metz City B x link 0.25 2023-12
Orleans City B x x link 0.25 2023-12
Bibus Brest City B x x x x link 0.1 2023-12
Lille Ilevia City B, T, S x x link 0.5 2024-01
Lyon City B, T x link 0.4 requires user/pwd so manual download of zip, use lower-case for zip-name 2024-04
Toulon City B x link 0.05 2024-02
Strassbourg City B, T x - link 0.1 RT only in SIRI format 2025-02
TER France Country R x x link 0.5 2024-03
Brussels City B x link 0.25 2023-12
TEC Wallonia Region B x link 1 2024-02
Vilnius City B x link 0.5 2023-12
Germany Country, Region, Local B, T, R, S x x link 0.5 - 2.5 2023-12
Sweden Country B x x link 1 use API key in url to get zip 2023-12
Skånetrafiken Regional B, T, R x ? link 0.2 use API key in url to get zip 2024-04
Finland Country B x x link 2 2023-12
Netherlands Country B, T, R, S x x x x link 2.5 2024-01
Switzerland Country B, T, R x x link GTFS_RT 3 2023-12
Hungary (Volan) Country B x link 0.3 2024-01
Budapest BKK City B, T x x x x link 0.75 RT not confirmed (yet) 2024-01
London City B x link 2.5 2024-01
UK Country B - - - - link - zip too large to handle 2024-01
EastYorkshire Region B x link 0.3 2024-03
Krakow City B, T x x x x link 0.2 for T(rams) issue with feed_info.txt in zip, use the Service call 2024-02
Dublin City B x x link 0.3 2024-02
Bizkaia Region B x x x ? link 0.1 2024-02
Zagreb City B, T x link 0.4 2024-02
Austria Vienna City B, T x link 0.3 2024-03
Austria ÖBB Country R x link 0.3 2024-03
Rome City B,T x x link 1 2025-02
Turin City B x x link 1 2024-12

North America

Provider Geo-covering Type Static RT Trip RT Veh. Pos. RT Alert Link Extraction time (in hours) Comment Tested
Washington WMATA City B, T x x ? ? link 0.6 for static: append api_key to static url works, although it throws an error (ignore) 2024-02
Spokane City B, T x x x x link 0.2 2024-04
New York MTA City B, T, R x x - ? static and RT ? tested for Long Island RR only 2024-02
San Fransisco Bay City B, T x link 0.5 2023-12
Philadelhia (SEPTA) City B, T, S x x x link and RT 0.5 zip file contains bus/subway and rail, needs manual intervention 2024-12
Montreal (stm) City B, S x x x link and RTrip 1 2025-01
Vancouver (translink) City B, S x x x link and RTrip 0.5 2025-01

Oceania

Provider Geo-covering Type Static RT Trip RT Veh. Pos. RT Alert Link Extraction time (in hours) Comment Tested
NSW (greater Sydney area) Region B, T, R, S, F x link 1 2023-12
Adelaide Metro Region B, T, R x link and RTrip 1 2023-12

Challenges

  • Some providers claim to offer GTFS real-time data, but are not in the protobuf GTFS format. GTFS2 relies on the pygtfs library, which only supports the protobuf format for real-time data. Known examples of this are Brussels, San Francisco Bay, Krakow. It will not be possible to build individual solutions for these deviating providers.
  • Some GTFS data sources have multiple stop_id values for the same stop, depending on vehicle (i.e. Type) or even line (CH, NL). That means you might have to configure multiple times.
  • GTFS real-time data may be provided along a route/trip, but not all stops are always covered.

See also Issues, Challenges, & Workarounds

Clone this wiki locally