Skip to main content

Naolib Nantes smart home integration, free and open source

Naolib Nantes integration for Gladys Assistant

Nantes trams and buses (Naolib): real-time departures, delays, line traffic.

Overview​

This integration brings Naolib, the trams, busways, Chronobus, buses and Navibus of Nantes Métropole, into Gladys. 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), with the alerts of Naolib: diversions, stops moved, works. 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 Naolib (Nantes Métropole), under the ODbL licence: no account, no key. The timetable (GTFS, published on data.nantesmetropole.fr) is downloaded only when a new file is published, and kept by the integration. The real time (GTFS-RT) of the whole network is read through transport.data.gouv.fr, the national access point, in one 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 once its trip is under way: its estimated time and its delay are given. Before that it is the timetable, marked "(timetable)". Cancelled trips and stops not served are shown.

The source of the real time answers once every 30 seconds for everyone: when it is busy, the integration asks again a few seconds later and, meanwhile, uses its last reading (less than 3 minutes old).

This is a cloud integration: it contacts data.nantesmetropole.fr and proxy.transport.data.gouv.fr. Nothing else leaves your network.

Requirements​

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

Configuration​

FieldWhat to type
Stop 1, 2, 3The name of the stop as written on it: "Commerce", "Gare Nord - Jardin des Plantes".
LineOnly this line: "1", "C1", "4", "N1". Empty: every line of the stop.
DirectionOnly the destinations holding these words: "Beaujoire", "Beaujoire | Ranzay". Empty: both directions.
Followed linesThe lines whose traffic you follow, six at most: "1, 2, C1, 4".
Reading of the real timeEvery 30 seconds, minute, 2 minutes or 5 minutes.
Language of the textsNames of the devices, summaries and outputs of the scenes. Stop names and traffic messages stay in French.

A stop gathers every platform of its stop place, trams and buses: "Commerce" gives both directions of the trams 1, 2 and 3 and the buses calling there. A name used in two towns ("Poitou") gives two stops: the second one is written with "-2" by Find a stop. The Find a stop button gives the stops holding a few words, with their lines ("Commerce → 1, 2, 3…"). A few words are enough when only one stop holds them ("haluch" → Haluchère - Batignolles). Test the connection asks for the timetable again and reads each stop and each line right away.

A line is written as on the vehicle: "1" to "3" for the trams, "4" and "5" for the busways, "C1" to "C20" for the Chronobus, "N1" to "N3" for the Navibus, "26", "NS" (Nuit Sud)…

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 they follow its backups.

The timetable of Naolib is a big file: the first reading, and the one of each new file, takes some 20 seconds.

Usage​

Devices​

In the Discover tab, create the devices you want:

  • Naolib <stop>: the next departure as text ("1 → Beaujoire · 3 min (+2 min late)"), the wait of the next departure and of the one after (minutes), and the delay of the next one (minutes, published only when it is followed in real time);
  • Naolib tram 1, Naolib line C1…: the traffic as text ("Disrupted traffic: Travaux boulevard de l'Estuaire") and the number of traffic messages under way.

At night, without any departure in the next three hours, the device shows the first departure of the morning.

Traffic​

Naolib publishes alerts: a text, the lines (or the stops) concerned and their periods. The state of a line comes from its heaviest alert under way: heavily disrupted for an interruption, disrupted for a diversion, stops moved or not served, delays, traffic information otherwise; normal without an alert. An alert starting in the next three days is shown as coming. The link to the map of a diversion, when given, opens from the card of the alert.

Dashboard widgets​

The Naolib departures widget at Pirmil and the Naolib traffic widget of the trams and of bus lines (generated illustration, not a screenshot)

  • Naolib departures: the next departures of a stop, compact. One row per line and destination, with its next departures in a row ("2 · 17 min"). A cancelled trip is shown ("cancelled 22:48") and turns the row orange, like a delay of 5 minutes or more. 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, one widget shows several stop devices: the devices of one stop are merged under its name; for different stops, each stop opens with a row of its own.
  • Naolib traffic: the state of each line, then the alerts under way and those 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 three tram lines when you follow none.

Scenes​

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

  • Naolib: departure soon: a departure at a followed stop leaves in 2, 3, 5, 10, 15 or 20 minutes, counted on its real-time estimate.
  • Naolib: departure cancelled: a trip of the next hour at a followed stop is cancelled, or does not serve the stop.
  • Naolib: line disrupted: a followed line becomes disrupted or heavily disrupted.
  • Naolib: back to normal: no disruption under way on the line any more.
  • Naolib: new traffic message: Naolib 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 Naolib: next departures and Naolib: traffic of a line return the same kind of values, to put in a message or to test in a condition.

Examples:

  • When tram 1 towards Beaujoire leaves Commerce in 5 minutes → turn the hall lamp green.
  • When a departure of your stop is cancelled, or the C1 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 when a new file is published, 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 (with its "-2" for the second stop of a name); for a line, its name as on the vehicle ("1", "C1", "4").
  • "(timetable)" after a departure: its trip is not under way yet, or Naolib does not follow it; the time is the one of the timetable.
  • No departure in the direction typed: the destinations are the ones written on the vehicles ("Beaujoire", "François Mitterrand"); empty the direction to see them all.
  • "The open data of Naolib do not answer": the integration tries again at each reading; meanwhile the departures come from the timetable kept. A short refusal of the real time (its source answers once every 30 seconds) goes unnoticed: the last reading is used.
  • To report a problem: press Diagnostic, then copy the lines starting with "Naolib 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 Naolib Nantes asks for in its configuration screen in Gladys.

SettingTypeRequiredDescription
Naolib open datasectionNoThe departures and the traffic come from the official open data of Naolib, the trams and buses of Nantes Métropole: the timetable (GTFS) and the real time (GTFS-RT) of the whole network (trams, busways, Chronobus, buses, Navibus). 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 or the bus: its next departures, from the timetable corrected in real time, with their delay. Type its name as written on the stop ("Commerce", "Gare Nord - Jardin des Plantes"): the "Find a stop" button gives them. The line keeps only its departures ("1", "C1", "4"). The direction keeps only the destinations holding these words ("Gare Sud", "Beaujoire | Ranzay").
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 Naolib, 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 Naolib widget has been shown. Stop names and traffic messages stay in French.

How to install Naolib Nantes in Gladys​

  1. In Gladys, open Integrations: Naolib Nantes 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-naolib: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-naolib.

Naolib Nantes 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​

Naolib Nantes 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 🙂