Skip to main content

Bibus Brest smart home integration, free and open source

Bibus Brest integration for Gladys Assistant

Brest trams, cable car and buses (Bibus): real-time departures, delays, traffic.

Overview​

This integration brings the Bibus network into Gladys: the two tram lines (A and B), the cable car (C) and the buses of Brest métropole. It gives the next departures, corrected in real time, with their delay, at the stops you choose (three in the form, up to 10 more with a button), filtered by line and direction. It also follows the traffic of up to six lines (normal, traffic information, disrupted, heavily disrupted), from the alerts of Bibus: diversions, stops not served, works, the lifting of the Recouvrance bridge. Each stop and each line becomes a device to show on a dashboard and to use in scenes.

The data come from the official open data of Bibus, published on transport.data.gouv.fr under the Licence Ouverte 2.0 (Etalab): no account, no key. The timetable (GTFS) is downloaded once a day when it changed, and kept by the integration. The real time (GTFS-RT) of the whole network is read in one single request for every followed stop, every minute by default (every 10 minutes while no stop announces anything in the next half hour, at night). The alerts are read every 5 minutes.

A departure is followed in real time a little before it leaves its terminus: its estimated time and its delay are given. Before, it is the timetable, marked "(timetable)". The cable car C has no real time: its timetable only. Cancelled trips and stops not served (diversions) are shown; a tram or a bus that has already left the stop is no longer announced, even when it was early.

This is a cloud integration: it contacts www.data.gouv.fr and the file storage of RATP Dev (timetable), proxy.transport.data.gouv.fr (real time, relayed by the national access point) and notify.ratpdev.com (alerts, the server of RATP Dev, whose RD Brest runs the network). Nothing else leaves your network.

Requirements​

  • Gladys Assistant 5.3.0 or later.
  • Nothing else: the open data of Bibus need no account and no key.

Configuration​

FieldWhat to enter
Stop 1, 2, 3The name of the stop as written on it ("Liberté", "Jean Moulin") or the id of a platform ("LIBE_TA").
LineOnly this line: "A", "tram B", "2" or "téléphérique". Empty: every line of the stop.
DirectionOnly the destinations holding these words: "Plouzané", "Gouesnou | Guipavas". Empty: both directions.
Followed linesThe lines whose traffic you follow, six at most: "A, B, C, 2".
Real-time readingEvery 30 seconds, every minute, every 2 minutes or every 5 minutes.
Language of textsNames of the devices, summaries and outputs of the scenes. Stop names and traffic messages stay in French.

A stop gathers the platforms of one name in one place: "Liberté" gives both directions of the trams calling there. When the same name exists in two places ("Brasserie"), they are two stops: then type the id of one of its platforms. The Find a stop button gives the stops holding a few words, with the ids of their platforms and their lines ("Jean Moulin [J.MOULIN, MOULIN_1, MOULIN_2] → C, 2, 25, N1, N2"). A few words are enough when one stop only holds them. The tram stations have their own platforms ("LIBE_TA", "LIBE_TR"); the cable car links "Jean Moulin" and "Ateliers". Test the connection asks for the timetable again and reads each stop and each line at once.

A line is written as on the vehicle: "A", "B" ("tram A" works too), "D", "2" (or "02"), "N1", "S40"… The cable car is "C" ("téléphérique" or "cable car" work too). The school lines ("S40"…) are kept. The lines on demand (91 to 97) are not offered, and the stops served on booking only (TAD Bibus) are not announced: nothing says the bus will come.

More stops than the three of the form (home, work, school…): Add a stop takes the same three fields — stop, line, direction — and follows up to 10 more stops. List the stops shows every followed stop, numbered; Remove a stop takes that number (or the name). The added stops are kept in the configuration of Gladys, so in its backups.

Usage​

Devices​

In the Discover tab, create the devices you want:

  • Bibus <stop>: the next departure as text ("A → Porte Gouesnou · 3 min (+2 min late)"), the wait of the next departure and of the following one (minutes), and the delay of the next one (minutes, published only when it is followed in real time);
  • Bibus tram A, Bibus cable car C, Bibus line 2…: the traffic as text ("Disrupted traffic: Ligne 2 - Déviation rue Anatole France") and the number of traffic messages under way.

At night, without a departure in the next three hours, the device gives the first departure of the morning.

Traffic​

Bibus publishes alerts: a title, a text, the lines concerned, their periods and often the map of the diversion (a PDF on bibus.fr). The emojis of the titles are removed; the ones of the text stay (❌ stops not served, ✅ stops instead). The state of a line comes from its heaviest alert under way: heavily disrupted for an interruption or a closing, disrupted for a diversion, stops not served or delays, traffic information otherwise (holiday timetables, the lifting of the Recouvrance bridge announced over two days for a one-hour break); normal without an alert. An alert starting in the next three days is shown as "coming". The periods are the ones Bibus publishes: an alert "the nights of Wednesday 2, Thursday 3 and Monday 7 December" counts over its whole span.

Dashboard widgets​

The Bibus departures widget at Jean Moulin and the Bibus traffic widget of the trams, the cable car and bus lines (generated illustration, not a screenshot)

  • Bibus departures: the next departures of a stop, compact. One row per line and destination, with its next two departures, each with its unit ("2 min · 17 min"; the time beyond an hour of wait: "23:55 · 00:05"). A departure of another day gives its day ("tomorrow 05:30") and is then shown alone. The trips cancelled in the next hour and the stops not served are shown ("7 min · cancelled 22:58 · 22 min") and turn the row orange, like a delay of 5 minutes or more. When a row is too long, the departure after goes first, then the cancellations: the next departure always stays. The Routes shown setting sets the number of rows. Choose a followed stop, or type any stop (and a line) in the widget settings. With Several stops, a widget shows several stop devices: the ones of one stop are merged under its name; for different stops, each stop starts with a row of its name.
  • Bibus traffic: the state of each line, then the alerts under way and the ones of the next three days, with their period. Tap a card for the full text. The followed lines, the ones typed in the settings, or the trams and the cable car when you follow none.

Scenes​

Triggers, once per change (the first reading is only a baseline):

  • Bibus: departure soon: a departure of a followed stop leaves in 2, 3, 5, 10, 15 or 20 minutes, counted on its real-time estimate.
  • Bibus: departure cancelled: a trip of the next hour at a followed stop is cancelled, or does not serve the stop.
  • Bibus: line disrupted: a followed line becomes disrupted or heavily disrupted.
  • Bibus: back to normal: no disruption under way on the line any more.
  • Bibus: new traffic message: Bibus publishes an alert about a followed line, under way or coming.

Each gives a ready-made sentence, {{triggerEvent.data.summary}}, and its values (line, destination, time, delay, title, text, start and end…). The actions Bibus: next departures and Bibus: traffic of a line return the same kind of values, to put in a message or to test in a condition.

Examples:

  • When tram A towards Porte Plouzané leaves Liberté in 10 minutes → turn the hall lamp green.
  • When a departure of your stop is cancelled, or line 2 is diverted → send the summary to your phone before you leave.
  • Every weekday at 7:30 → read the next departures of your stop and have the kitchen speaker announce them.

Transport​

Cloud only: the data come from the internet. The timetable once a day, the real time of the whole network in one request, the alerts every 5 minutes.

Troubleshooting​

  • "Unknown or ambiguous": use Find a stop, then copy the exact name or a platform id (a name found in two places needs a platform id); for a line, its name as on the vehicle ("A", "2", "N1").
  • "(timetable)" after a departure: the trip is not followed in real time yet, or Bibus does not follow it (the cable car C, some bus lines); the time is the one of the timetable.
  • No departure in the typed direction: the destinations are the ones written on the vehicles ("Porte Plouzané", "Technopôle", "P de Commerce via Liberté"); empty the direction to see them all.
  • A line on demand is missing: the lines 91 to 97 and the stops served on booking (TAD Bibus, +33 2 98 34 42 22) are not followed.
  • "The open data of Bibus do not answer": the integration tries again at each reading; meanwhile, the departures come from the timetable kept.
  • To report a problem: press Diagnostic, then copy the lines starting with "Bibus diagnostic" from the Logs tab into a GitHub issue or a reply on the forum, with the versions of Gladys and of the integration.

Configuration settings​

These are the settings Bibus Brest asks for in its configuration screen in Gladys.

SettingTypeRequiredDescription
Bibus open datasectionNoThe departures and the traffic come from the official open data of Bibus, the trams, cable car and buses of Brest métropole: the timetable (GTFS), the real time and the traffic alerts (GTFS-RT). The cable car C has no real time (its timetable only), and the lines on demand (91 to 97) are not offered. No account and no key: fill in your stops and lines below, then press "Test the connection".
Stop 1sectionNoThe stop where you take the tram, the cable car or the bus: its next departures, from the timetable corrected in real time, with their delay. Type its name as written on the stop ("Liberté", "Jean Moulin") or the id of one of its platforms ("LIBE_TA"): the "Find a stop" button gives them. The line keeps only its departures ("A", "tram B", "2" or "téléphérique"). The direction keeps only the destinations holding these words ("Plouzané", "Porte Gouesnou | Porte Guipavas").
StopstringNo
LinestringNoEmpty for every line.
DirectionstringNoWords of the destination. Empty for both directions.
Stop 2sectionNo
StopstringNo
LinestringNoEmpty for every line.
DirectionstringNoWords of the destination. Empty for both directions.
Stop 3sectionNoMore stops (a home, a workplace, a school…): the "Add a stop" button, under the form, follows up to 10 more, "List the stops" shows them all, numbered, and "Remove a stop" stops following one. The real time of every stop comes in one request.
StopstringNo
LinestringNoEmpty for every line.
DirectionstringNoWords of the destination. Empty for both directions.
Traffic of the linessectionNoThe lines whose traffic you follow: a device per line, with its state (normal, traffic information, disrupted, heavily disrupted) worked out from the alerts of Bibus, and its traffic messages (works, diversions, stops not served), read every 5 minutes.
Followed linesstringNoUp to 6, separated by commas.
OptionssectionNo
Reading of the real timeselectNoHow often the real time of the network is read: one request for every followed stop. While no stop announces anything in the next half hour (at night), every 10 minutes. The timetable is read once a day.
Language of the textsselectNoNames of the devices, summaries and outputs of the scenes. Automatic: the language of your dashboard, as soon as a Bibus widget has been shown. Stop names and traffic messages stay in French.

How to install Bibus Brest in Gladys​

  1. In Gladys, open Integrations: Bibus Brest appears in the catalog, next to the native integrations, with a community badge.
  2. Click Install. Gladys pulls the Docker image (ghcr.io/william-de71/gladys-bibus-brest:0.1.0), starts it in a sandbox isolated from the core, and generates the integration's interface (devices, discovery and configuration).
  3. Open the Configuration screen of the integration, fill in the settings, and save.
  4. You can also install it directly from its repository URL: https://github.com/William-De71/gladys-bibus-brest.

Bibus Brest requires Gladys >=5.3.0. The catalog inside Gladys refreshes every hour, so a new version becomes available at most one hour after its release.

Not running Gladys yet? It is free and open source: follow the installation guide to get started.

About external integrations​

Bibus Brest is an external integration: a community integration packaged as a Docker container and published on GitHub, that Gladys installs in one click and runs in a sandbox isolated from its core. It is published and maintained by William-De71, not by the Gladys core team.

Subscribe to the Gladys Assistant newsletter

A few emails per month about new releases and project news. Sent by Pierre-Gilles Leymarie, founder of the project. Unsubscribe anytime 🙂