Montreal Metro
nips1900 opened this issue · comments
Hi,
i'm using your application for Montreal Bus & Metro. For buses it is working perfetly, but i have hard time with metro. I can't get any information.
please find my config below:
sensor:
- platform: gtfs_rt
trip_update_url: 'https://api.stm.info/pub/od/gtfs-rt/ic/v2/tripUpdates'
vehicle_position_url: 'https://api.stm.info/pub/od/gtfs-rt/ic/v2/vehiclePositions'
apikey: 'l7xx12345678912346764564564'
departures:-
name: 'Bus 178'
route: 168
stopid: 56698 -
name: 'STM Ligne Verte'
route: 1
stopid: 36
-
could you please let me know what i'm doing wrong?
thank you,
Laurent
First, you shouldn't put your api key in here, and even in the HA config file you should use secrets: https://www.home-assistant.io/docs/configuration/secrets/
Your key is currently invalid, I know I had to recreate my account but I don't know when the STM site changed. I had to fiddle with my keys, don't even bother with homeassistant until you get a response on the STM specs page.
I THINK the issue with the metro is that the stopid
is the station and doesn't include direction. I suspect that the STM doesn't have v2 info for the metro.
I just noticed Berri-UQAM has this for Stop IDs (from their static gtfs.zip):
STATION_M146,10146,STATION BERRI-UQAM,45.515226,-73.561082,,1,,1
9999111,10146,Station Berri-UQAM 1,45.515226,-73.561082,http://www.stm.info/fr/infos/reseaux/metro/berri-uqam,0,STATION_M146,1
9999112,10146,Station Berri-UQAM 2,45.515212,-73.561051,http://www.stm.info/fr/infos/reseaux/metro/berri-uqam,0,STATION_M146,1
9999114,10146,Station Berri-UQAM 4,45.515191,-73.561013,http://www.stm.info/fr/infos/reseaux/metro/berri-uqam,0,STATION_M146,2
And my theory is that 999911X, where X is the line number (1, green; 2, orange; 4, yellow) but that still doesn't have direction.
Anyways, all I really want is metro status and I need a line to go down to find out where that data is.
I know it has been a while, but if anyone else sees this thread - it's in STM's license agreement that this will not work:
4. Metro schedules are for information purposes only and are essentially used to determine the duration of a trip and cannot be used to develop an application on metro schedules.