Integración domótica OC Transpo Ottawa, gratuita y de código abierto

Next OC Transpo bus and O-Train departures in Ottawa, with real time.
La documentación de esta integración la escribe su autor y, por ahora, solo está disponible en inglés.
The next OC Transpo bus and O-Train departures near your home, in Gladys.
This integration is not affiliated with OC Transpo nor with the City of Ottawa.
Get started in 3 steps
No technical knowledge is needed, and no account to begin with.
- 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.
- 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.
- Open the Discover tab of the integration. The 3 stops closest to your home are offered there, with their name and the direction of their routes, e.g. "OC Transpo – Rideau / King Edward (6 → Greenboro)". Press Add on each one you want.
That's it. You now get the next departures at each stop, most of them in real time.
The message at the top of the configuration page always tells you what to do next. For example: "Ready: 3 stops to add. Open the Discover tab…".
Device names start with OC Transpo –. You can rename them freely in Gladys.
An O-Train station (Rideau, Lyon, Hurdman…) is a single stop, for all its platforms: trains and buses.
Showing the departures on the dashboard
- Open the dashboard, then press Edit.
- Add a widget and choose OC Transpo departures.
- Choose the stop, then save.
Departures tracked in real time are green. Scheduled times are grey and carry a ~: "~12 min" means "scheduled in 12 minutes".
Official real time (optional)
Without a key, the departures come from Transitous, a free community service that already receives the OC Transpo real time for most buses. They are read every 2 minutes.
With a free, personal OC Transpo API key, the departures come straight from the OC Transpo real-time feed, read every minute.
Getting the OC Transpo API key (5 minutes)
- Go to the OC Transpo developers page and follow the link to the developer portal. Create an account, then activate it with the email you receive.
- Sign in to the portal, open Products and subscribe to the GTFS-RT product.
- Open your profile: the subscription shows a primary key. Copy it.
- In Gladys, open the configuration of the integration. Paste the key in OC Transpo API key, then press Save.
- Press Test the OC Transpo API key: the line must show ✔.
The labels of the portal may differ slightly: the OC Transpo real-time feed is still labelled "beta".
Requests. One read of the OC Transpo feed serves all your stops: with the default settings the integration makes about 1,400 requests a day, whatever the number of stops.
Watching other stops (work, school…)
For a stop far from home:
- At the bottom of the configuration page, press Find a stop. Type a street, a station or the stop number, e.g. "Rideau" or "Bank Somerset".
- The answer lists the stops with their number and the direction of their
routes, e.g.
1658 — Rideau / King Edward (6 → Greenboro). - Copy the number (
1658) in Stops, save, then add the stop in the Discover tab.
The number is the 4-digit one written on every OC Transpo stop sign (the one you text to 560560).
Going further
The Stops field accepts several numbers separated by commas, a route
filter after @ and a name after :.
| Entry | Meaning |
|---|---|
1658 | every route calling at stop 1658 |
3009@1 | O-Train Line 1 only, at Rideau |
3009@6|7 | routes 6 and 7 |
3009@7:Bus to work | route 7, displayed as "Bus to work" |
What each device holds
- Next departure, Departure 2…: the minutes to wait. 999 means no departure is scheduled.
- Next departure route…: the route ("7", "1" for O-Train Line 1).
- Next departures: a summary, e.g.
7 3 min · 6 ~11 min.
Scenes
Trigger: Departure approaching: a departure gets under 1, 2, 3, 5, 10 or 15 minutes. Example: "when the 7 is 5 minutes away, turn the hall light on".
Action: Read the next departures: e.g. a message every morning "Your 7 comes in {{minutes}} minutes".
Troubleshooting
| Message or symptom | What 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 tab | Read the message of the configuration page: it says what is missing. |
| "OC Transpo refused the API key" | Check that you pasted the primary key of the GTFS-RT subscription, and that the subscription is active. |
| "Stop … is not in the OC Transpo stop list" | Check the number on the sign. A brand new stop comes with the next version of the integration. |
| A stop stays at 999 | No 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 OC Transpo GTFS, shipped with the integration (updated with every version).
- Departures without a key: Transitous, a free community service, from the OC Transpo data.
- Real time: OC Transpo and City of Ottawa open data, under the terms of use.
- Integration code: Apache 2.0 licence.
Parámetros de configuración
Estos son los parámetros que OC Transpo Ottawa te pide en su pantalla de configuración en Gladys.
| Parámetro | Tipo | Obligatorio | Descripción |
|---|---|---|---|
| Get started in 2 minutes | section | No | 1. 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 near your home. That's it: you get the next departures right away. A OC Transpo key (optional, free) adds the official real time. |
| Near my home | section | No | How many of the closest stops (within 600 m) are proposed in the “Discover” tab. 0 turns the suggestion off. |
| Stops near my home | number | No | |
| Official real time (optional) | section | No | Without a key you get the departures of the free Transitous service: the timetable, and the real time where Transitous has it. With a free OC Transpo key you get the official real-time predictions. Getting one takes 5 minutes: follow the step-by-step guide. |
| OC Transpo API key | secret | No | The primary key of your subscription on the OC Transpo developer portal. |
| Departures without a key | boolean | No | Without a key, show the departures of the free Transitous service. |
| Other stops (optional) | section | No | To 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. |
| Stops | string | No | Stop numbers. Optional route filter after @ and custom name after : — e.g. "1658, 3009@7:Bus to work". |
| Advanced | section | No | The defaults suit almost everyone. With a OC Transpo key, one read of the real-time feed serves every stop. |
| Departures refresh interval (s) | number | No | How often the departures are refreshed, in seconds. |
| Departures per stop | number | No | How many upcoming departures each stop device exposes as features. |
| Language of the values | select | No | Language of the feature names and of the texts published. |
Cómo instalar OC Transpo Ottawa en Gladys
- En Gladys, abre Integraciones: OC Transpo Ottawa aparece en el catálogo junto a las integraciones nativas, con una insignia de comunidad.
- Haz clic en Instalar. Gladys descarga la imagen Docker (
ghcr.io/lm1lc3n7/gladys-octranspo: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). - Abre la pantalla de Configuración de la integración, rellena los parámetros y guarda.
- También puedes instalarla directamente desde la URL de su repositorio: https://github.com/LM1LC3N7/gladys-octranspo.
OC Transpo Ottawa 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
OC Transpo Ottawa 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.
- Explorar todas las integraciones externas
- Descubrir las integraciones nativas incluidas en Gladys
- Crear y publicar tu propia integración externa
- Código fuente en GitHub — fuente de esta documentación