Saltar al contenido principal

Integración domótica TransLink Vancouver, gratuita y de código abierto

Integración TransLink Vancouver para Gladys Assistant

Next TransLink departures, SkyTrain line status and Mobi bike stations in Metro Vancouver.

info

La documentación de esta integración la escribe su autor y, por ahora, solo está disponible en inglés.

The next TransLink departures (bus, SkyTrain, SeaBus), the SkyTrain line status and the Mobi bikes near your home, in Gladys.

This integration is not affiliated with TransLink nor with Mobi by Rogers.

Get started in 3 steps​

No technical knowledge is needed, and no account to begin with.

  1. Check the address of your house in Gladys: Settings → Houses. The house must have a position on the map. The integration uses it to find the stops near you. The position stays in your Gladys.
  2. Install the integration from the integration catalog, and accept the access to the house location. Open its configuration page and press Save, without filling anything in.
  3. Open the Discover tab of the integration. The 3 stops and 2 Mobi stations closest to your home are offered there, with their name and the direction of their routes, e.g. "TransLink – Waterfront Station @ Bay 2 (50 → False Creek South)". Press Add on each one you want.

That's it. You now get the next departures at each stop, and the bikes and free docks of each Mobi station.

The message at the top of the configuration page always tells you what to do next. For example: "Ready: 3 stops and 2 Mobi stations to add. Open the Discover tab…".

Device names start with TransLink – or Mobi –, so they are easy to tell apart in the device list of Gladys. You can rename them freely in Gladys.

A SkyTrain station is offered once, for all its platforms. Its bus bays ("Bay 1", "Bay 2"…) are stops of their own.

Showing the departures on the dashboard​

  1. Open the dashboard, then press Edit.
  2. Add a widget and choose TransLink departures.
  3. Choose the stop, then save.

The Mobi station widget is added the same way. The TransLink line status widget needs a TransLink key (see below).

Without a key, scheduled times carry a ~ and are grey: "~12 min" means "scheduled in 12 minutes". Departures tracked in real time are green, without a ~.

Going official real time and adding the lines (optional)​

Without a key, the departures come from Transitous, a free community service: the timetable, and the real time where Transitous has it.

With a free, personal TransLink API key:

  • the departures come straight from the TransLink real-time feed, updated every minute;
  • the TransLink – SkyTrain and SeaBus device appears, with the status of the Expo, Millennium and Canada lines, the SeaBus and the West Coast Express.
  1. Go to the TransLink developer portal and create an account (Register). Confirm the email you receive.
  2. Log in: the page of your account shows your API key. Copy it.
  3. In Gladys, open the configuration of the integration. Paste the key in TransLink API key, then press Save.
  4. Press Test the TransLink API key. Both lines must show ✔.
  5. Go back to the Discover tab and add the TransLink – SkyTrain and SeaBus device.

The labels of the portal may differ slightly.

Requests. One read of the TransLink feed serves all your stops: with the default settings the integration makes about 2,200 requests a day, whatever the number of stops. The message of the configuration page shows the estimate for your setup.

Watching other stops (work, school…)​

For a stop far from home:

  1. At the bottom of the configuration page, press Find a stop. Type a street, a station or the stop number, e.g. "Granville Station" or "Davie Bidwell".
  2. The answer lists the stops with their number and the direction of their routes, e.g. 50040 — Waterfront Station @ Bay 2 (50 → False Creek South).
  3. Copy the number (50040) in Stops, save, then add the stop in the Discover tab.

The number is also the one written on every TransLink stop sign ("Stop #50040").

For Mobi stations, the Find a Mobi station button works the same way.

Going further​

The Stops field accepts several numbers separated by commas, a route filter after @ and a name after :.

EntryMeaning
50040every route calling at stop 50040
61935@99route 99 only
61935@99|14routes 99 and 14
61935@99:Bus to workroute 99, displayed as "Bus to work"

What each device holds​

Stop:

  • Next departure, Departure 2…: the minutes to wait. 999 means no departure is scheduled.
  • Next departure route…: the route ("99", "Canada Line").
  • Next departures: a summary, e.g. 99 3 min · 14 ~11 min.

SkyTrain and SeaBus (with a key): for each line, a status (Normal, Disrupted, Notice or Unknown) and the message of the TransLink alert. An alert about a single station (an elevator, an entrance, a bus bay) does not change the status of the line.

Mobi station: the bikes (e-bikes included), the e-bikes, the free docks and the state of the station.

A station that leaves the Mobi network shows 0 bikes, 0 docks and the state "Removed from the Mobi network (seasonal?)", with an orange dot on the device. It resumes by itself when it comes back.

Scenes​

Triggers:

  • Departure approaching: a departure gets under 1, 2, 3, 5, 10 or 15 minutes. Example: "when the 99 is 5 minutes away, turn the hall light on".
  • Line status changed: a line is disrupted, gets back to normal, or receives a notice. Example: "if the Expo Line is disrupted, send me a message".
  • Mobi station changed: the station runs out of bikes or docks, or gets some back.

Actions:

  • Read the next departures: e.g. a message every morning "Your 99 comes in {{minutes}} minutes".
  • Read a line status: returns the status, the TransLink message and normal (true or false).

Troubleshooting​

Message or symptomWhat to do
"set the address of your house"Settings → Houses: place the house on the map, then save the configuration of the integration again.
"Gladys did not share the location of your house"Reinstall the integration and accept the location access, or type stop numbers.
Nothing in the Discover tabRead the message of the configuration page: it says what is missing.
"TransLink refused the API key"Check the key on the developer portal, then paste it again.
"Stop … is not in the TransLink stop list"Check the number on the sign. A brand new stop comes with the next version of the integration.
Station "Removed from the Mobi network"The station left the Mobi network: it will come back by itself. To follow another one, see "Find a Mobi station".
A stop stays at 999No departure scheduled (at night), or a route filter matching no route of the stop.

Privacy, data and licences​

  • The house location is only used to look the nearby stops up, in the stop list shipped with the integration: it is sent nowhere.
  • Stop list: the TransLink GTFS, shipped with the integration (updated with every version).
  • Departures without a key: Transitous, a free community service, from the TransLink data.
  • Real time and alerts: TransLink open data, under the TransLink terms of use.
  • Bikes: public GBFS feed of Mobi by Rogers.
  • Integration code: Apache 2.0 licence.

Parámetros de configuración​

Estos son los parámetros que TransLink Vancouver te pide en su pantalla de configuración en Gladys.

ParámetroTipoObligatorioDescripción
Get started in 2 minutessectionNo1. Check that your house has an address in Gladys (Settings → Houses). 2. Save this page. 3. Open the “Discover” tab of this integration and press “Add” on the stops and Mobi stations near your home. That's it: you get the next departures and the Mobi bikes right away. A TransLink key (optional, free) adds the official real time and the line status.
Near my homesectionNoHow many of the closest stops (within 600 m) and Mobi stations (within 1 km) are proposed in the “Discover” tab. 0 turns the suggestion off.
Stops near my homenumberNo
Mobi stations near my homenumberNo
Real time and lines (optional)sectionNoWithout a key you get the departures of the free Transitous service: the timetable, and the real time where Transitous has it. With a free TransLink key you get the official real-time predictions and the status of the SkyTrain lines. Getting one takes 5 minutes: follow the step-by-step guide.
TransLink API keysecretNoThe API key of your account on the TransLink developer portal.
Watch the linesbooleanNoCreates a "TransLink – SkyTrain and SeaBus" device with the status of the Expo, Millennium and Canada lines, the SeaBus and the West Coast Express.
Departures without a keybooleanNoWithout a key, show the departures of the free Transitous service.
Other stops and stations (optional)sectionNoTo watch a stop that is not near your home (work, school…): type its number, written on the stop sign, or find it with the “Find a stop” button at the bottom of this page.
StopsstringNoStop numbers. Optional route filter after @ and custom name after : — e.g. "50040, 61935@99:Bus to work".
Mobi stationsstringNoMobi station ids, with an optional custom name after : — e.g. "0201:Station at home".
AdvancedsectionNoThe defaults suit almost everyone. With a TransLink key, one read of the real-time feed serves every stop.
Departures refresh interval (s)numberNoHow often the departures are refreshed, in seconds.
Lines refresh interval (s)numberNoHow often the line status is refreshed, in seconds.
Mobi refresh interval (s)numberNoHow often the Mobi stations are refreshed, in seconds.
Departures per stopnumberNoHow many upcoming departures each stop device exposes as features.
Language of the valuesselectNoLanguage of the feature names and of the texts published.
  1. En Gladys, abre Integraciones: TransLink Vancouver aparece en el catálogo junto a las integraciones nativas, con una insignia de comunidad.
  2. Haz clic en Instalar. Gladys descarga la imagen Docker (ghcr.io/lm1lc3n7/gladys-translink:0.1.1), la ejecuta en un entorno aislado del núcleo y genera la interfaz de la integración (dispositivos, descubrimiento y configuración).
  3. Abre la pantalla de Configuración de la integración, rellena los parámetros y guarda.
  4. También puedes instalarla directamente desde la URL de su repositorio: https://github.com/LM1LC3N7/gladys-translink.

TransLink Vancouver requiere Gladys >=5.1.0. El catálogo de Gladys se actualiza cada hora, así que una nueva versión está disponible como máximo una hora después de publicarse.

¿Todavía no usas Gladys? Es gratuito y de código abierto: sigue la guía de instalación para empezar.

Sobre las integraciones externas​

TransLink Vancouver es una integración externa: una integración comunitaria empaquetada como contenedor Docker y publicada en GitHub. Gladys la instala con un clic y la ejecuta en un entorno aislado del núcleo. La publica y mantiene LM1LC3N7, no el equipo principal de Gladys.

Suscríbete a la newsletter de Gladys Assistant

Unos pocos correos al mes sobre nuevas versiones y novedades del proyecto. Enviados por Pierre-Gilles Leymarie, fundador del proyecto. Puedes darte de baja cuando quieras 🙂