I’m trying to test the General Transit Feed Specification (GTFS) - Home Assistant integration to explore what it offers. I use this data available publicly Inicia sessió , and after setting up a start and stop ID, i don’t get any entity data. I know setup seems fine, as attributes are populated, but sensor does nothing.
Am I doing something wrong?
Is this specific dataset having some issues that won’t make this work?
Hi,
I’m also working on a gtfs integration, with real time updates for my local transportation company. Will have a look at yours.
I’m more interested in next passages for the stops around me, but still useful for later passages as real time is limited to 2 passages.
Thanks
Dan
Real time I have already working for public stuff , nothing professional
GTFS current setup is point to point …can you briefly explain a use case on next-passages-around-me?
I am happy to continue to think on enhancing it
One thing I noticed though is that the gtfs zip files provided by public transporters are not always in line with the pygtfs library that unpacks them… so I may need to include that too…
In fact I use only the data for the origin stop for the next passages.
I use GTFS to get stop_ids from a list of stop_names and some other attributes:
SELECT DISTINCT trips.route_id, trips.direction_id,
stops.stop_id, stops.stop_name, stop_lat, stop_lon, route_long_name, route_short_name,
route_type, route_color, route_text_color
FROM trips
INNER JOIN stop_times
ON stop_times.trip_id = trips.trip_id
INNER JOIN stops
ON stops.stop_id = stop_times.stop_id
INNER JOIN routes
ON routes.route_id = trips.route_id
WHERE stop_name like "SAINT-DENIS" OR stop_name like "MAX WALLER" OR stop_name like "FOREST CENTRE"
ORDER BY stops.stop_name, stops.stop_id, route_short_name;
Then I use this data to get real time waiting times from their API. Idea is to get real time data for the next passages and for the next 5 from GTFS (or next day if the line is end_of_service).
For now I use this in a python script with paho-mqtt using HA autodiscover which then creates an entity for each {route_type}{route_short_name}at{stop_name}{direction_id}. State : {expectedArrivalTime[0]}
Ah, ok…I first thought you were selectin the stops via their lat/lon
You uses case however only works if the provider actually has an real-time api and this is likely not very common plus (!) they may all behave a bit different. For my integration I downloaded 6 gtfs files, 3 were incompatible with the pygtfs and for 2 of them there is no real-time.
The challenge with ‘my’ integration was to get the data selected in a readable format and then re-use it. id/name/long name, they alll differ between gtfs sources
But this is a interesting aproach on the same data, I may try to add this as a ‘feature’