OC Transpo Ottawa Smart-Home-Integration, kostenlos und Open Source

Next OC Transpo bus and O-Train departures in Ottawa, with real time.
Die Dokumentation dieser Integration wird von ihrem Autor geschrieben und ist bisher nur auf Englisch verfügbar.
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.
Konfigurationseinstellungen
Diese Einstellungen fragt OC Transpo Ottawa in seinem Konfigurationsbildschirm in Gladys ab.
| Einstellung | Typ | Pflichtfeld | Beschreibung |
|---|---|---|---|
| Get started in 2 minutes | section | Nein | 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 | Nein | 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 | Nein | |
| Official real time (optional) | section | Nein | 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 | Nein | The primary key of your subscription on the OC Transpo developer portal. |
| Departures without a key | boolean | Nein | Without a key, show the departures of the free Transitous service. |
| Other stops (optional) | section | Nein | 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 | Nein | Stop numbers. Optional route filter after @ and custom name after : — e.g. "1658, 3009@7:Bus to work". |
| Advanced | section | Nein | 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 | Nein | How often the departures are refreshed, in seconds. |
| Departures per stop | number | Nein | How many upcoming departures each stop device exposes as features. |
| Language of the values | select | Nein | Language of the feature names and of the texts published. |
So installierst du OC Transpo Ottawa in Gladys
- Öffne in Gladys Integrationen: OC Transpo Ottawa erscheint im Katalog neben den nativen Integrationen, mit einem Community-Badge.
- Klicke auf Installieren. Gladys lädt das Docker-Image (
ghcr.io/lm1lc3n7/gladys-octranspo:0.1.1) herunter, startet es in einer vom Kern isolierten Sandbox und erzeugt die Oberfläche der Integration (Geräte, Erkennung und Konfiguration). - Öffne den Bildschirm Konfiguration der Integration, fülle die Einstellungen aus und speichere.
- Du kannst sie auch direkt über die URL ihres Repositorys installieren: https://github.com/LM1LC3N7/gladys-octranspo.
OC Transpo Ottawa benötigt Gladys >=5.1.0. Der Katalog in Gladys wird stündlich aktualisiert, eine neue Version ist also spätestens eine Stunde nach ihrer Veröffentlichung verfügbar.
Du nutzt Gladys noch nicht? Es ist kostenlos und Open Source: folge der Installationsanleitung, um loszulegen.
Über externe Integrationen
OC Transpo Ottawa ist eine externe Integration: eine Community-Integration, die als Docker-Container verpackt und auf GitHub veröffentlicht wird. Gladys installiert sie mit einem Klick und führt sie in einer vom Kern isolierten Sandbox aus. Sie wird von LM1LC3N7 veröffentlicht und gepflegt, nicht vom Gladys-Kernteam.
- Alle externen Integrationen durchsuchen
- Die nativen Integrationen entdecken, die in Gladys eingebaut sind
- Deine eigene externe Integration bauen und veröffentlichen
- Quellcode auf GitHub — Quelle dieser Dokumentation