Skip to main content

Transports en Commun Lyonnais integration for Gladys Assistant

Transports en Commun Lyonnais integration for Gladys Assistant

Next TCL departures, Vélo'v availability and park & ride occupancy in Lyon.

Bring Lyon's public transport network into Gladys: the next departures at the stops you use, the bikes and free docks at your Vélo'v stations, and the free spaces in the TCL park & ride car parks.

Every device this integration creates is read-only: it publishes what the open data feeds say, and nothing is ever sent back to the network.

What you get

One device per entry you list in the configuration.

Transit stop — for each of the next departures (up to five, your choice):

FeatureWhat it holds
Next departureMinutes to wait (999 when nothing is coming)
Next departure lineT1 → IUT Feyssine (a ~ prefix marks a timetable estimate rather than a real-time one)
Next departuresThe whole board on one line, for a dashboard tile

Vélo'v station

FeatureWhat it holds
Bikes availableBikes ready to rent
Electric bikes availableSubset that is electric, when the feed details it
Docks availableFree stands to return a bike
OccupancyShare of the stands holding a bike, in percent
StatusOK, no bike available, Out of service

Park & ride (P+R)

FeatureWhat it holds
Spaces availableFree car spaces, where SYTRAL counts them live
Accessible spaces availableFree spaces reserved for reduced mobility, when published
Total capacitySpaces the facility holds, from the inventory
OccupancyShare of the capacity taken, in percent
Status120/655 free, Full, No live count (287 spaces)

Not every park & ride is counted in real time: the occupancy dataset covers part of the network only, and the rest is published as an inventory without a live count. Those facilities can still be watched — their capacity and a No live count status are what they publish, and the free spaces fill in by themselves the day SYTRAL starts counting them. Spaces available, Accessible spaces available and Occupancy then stay empty ("no recent value" in Gladys), which is the honest answer: nothing is published for them upstream.

The status says which of the two situations you are in:

  • No live count (287 spaces) — the facility is absent from the real-time dataset. Nothing to fix, it is the open data as SYTRAL publishes it;
  • Live count unreadable (287 spaces) — the facility is in the real-time dataset and its count could not be read (a renamed column, or a -1 meaning "unknown"). Please report it: the columns received are in the container logs.

The List the park & ride facilities button says the same thing for the whole network, so you can tell without reading the logs.

Configuration

1. Data Grand Lyon account (transit stops and park & ride only)

Vélo'v works out of the box: its feed is fully open.

Transit departures and park & ride occupancy come from the TCL real-time datasets hosted on data.grandlyon.com, which require a free account.

The password asked for here is not the one you sign in with. You browse the portal with GrandLyon Connect (the single sign-on shared by every Métropole de Lyon service), but the web service this integration calls only accepts a password specific to the data platform. Entering your GrandLyon Connect password gives "Data Grand Lyon refused the credentials".

  1. Create an account, or sign in, on GrandLyon Connect.

  2. Go to your data platform profile and define the password of the platform. It can — and should — be different from the GrandLyon Connect one.

    That form is titled "Changer votre mot de passe" and asks for an old password. If you only ever signed in through GrandLyon Connect you have none — and the GrandLyon Connect password is not accepted there either. Log out of the portal: the profile page then lands on the data platform's own sign-in form, where the Mot de passe oublié ? (forgotten password) link emails you a link that sets the password without knowing the previous one. The password you set that way is the one to paste into the integration.

  3. In the integration configuration, fill in the login (in general the email address of your account) and that platform password.

  4. Press Test the Data Grand Lyon account — it reports how many park & ride facilities it could read.

Leave both fields empty if you only watch Vélo'v stations.

2. Tell the integration what to watch

The three list fields accept entries separated by commas, semicolons or newlines. You do not need to hunt for identifiers on a website: the buttons at the bottom of the Configuration screen search them for you.

Transit stops<stop id>[@<line>[|<line>…]][:<custom name>]

EntryMeaning
1234Every departure at stop 1234
1234@T1Only line T1
1234@C3|C13Lines C3 and C13
1234@T1:Tram at homeOnly T1, and name the device "Tram at home"

Watching the same stop twice with two different line filters gives you two devices — one per line, which is usually what you want on a dashboard.

Press Find a transit stop and type a name (for example Bellecour) to get the identifiers to paste. Each result also says where its lines go:

1234 — Bellecour (A → Perrache, A → Vaulx-en-Velin La Soie)
5678 — Bellecour (C3 → Gare Saint-Paul)

That is the part you need to choose: the network gives the two sides of the same street two different identifiers under one name, so the terminus — what is written on the front of the tram — is what tells you which one is the platform going your way. The directions come from the departures announced right now, so a stop with nothing running is listed with its lines only; search it again during service hours to see them.

Vélo'v stations<station id or name>[:<custom name>]

10063, Hotel de Ville, or 10063:Work. Press Find a Vélo'v station to search by name.

Park & ride<P+R id or name>[:<custom name>]

Gorge de Loup, SOI, or Parilly:Commute. Identifiers are short upper-case codes (SOI, BON, GREY…), and the name works just as well. Press List the park & ride facilities to see every facility with its identifier and current occupancy — all 22 of them, including the ones SYTRAL does not count in real time, which are listed with ? free spaces. Those still make a usable device: their capacity is published, their free-space count is not.

3. Refresh intervals

Each data source has its own interval, because they do not move at the same speed:

SettingDefaultWhat it drives
Departures refresh interval60 sThe countdowns at each watched stop
Vélo'v refresh interval120 sBike and dock availability
Park & ride refresh interval300 sFree spaces in each watched car park

All three accept 30 s to 3600 s. Going below 60 s buys you nothing: the upstream feeds are themselves recomputed about once a minute, so a faster poll returns the same numbers while consuming your Data Grand Lyon quota. Gladys itself never ticks slower than once a minute, so an interval above 60 s is honored by the integration, which simply skips the ticks in between.

The integration also batches its requests: watching ten Vélo'v stations costs two HTTP requests per cycle, not twenty, and watching five park & ride facilities costs two.

What it stores. A fast refresh interval is a fast-growing database if every reading is written down, so the integration only sends Gladys the values that actually changed since the last read: a car park whose free spaces do not move all night is recorded once, not three hundred times. Departure countdowns go one step further and keep no history at all — "7 minutes, then 6, then 5, then 12 again" is the shape of every timetable and nothing reads it back, while it would be by far the biggest writer of the three. They are still live on your dashboard; it is their past that is not kept. Vélo'v availability and park & ride occupancy do keep theirs: those charts are worth something, and one point per change draws the same curve as one point per poll.

4. Save

Save the configuration, then open the Discovery tab: your stops, stations and car parks are there, ready to be added to Gladys.

Ideas for automations

  • Notify me at 8:00 on weekdays with the next departures at my stop.
  • If the Vélo'v station near work has fewer than 3 free docks when I leave, send me a warning.
  • If my usual park & ride is more than 90% full at 7:30, remind me to take the tram instead.

Troubleshooting

"Transit stops and park & ride need a Data Grand Lyon account" — the integration status stays red because you listed a stop or a car park without filling in the credentials. Add them, or remove the entries.

The profile page asks for an old password I never set — that form changes an existing password, and an account created through GrandLyon Connect has none. Log out of the portal, go back to data.grandlyon.com/onegeo-login/fr/profile/ — you land on the data platform sign-in form — and use Mot de passe oublié ? with the email address of the account. The emailed link sets the platform password with no old password required.

"Data Grand Lyon refused the credentials" — nine times out of ten, the password entered is the GrandLyon Connect one. The web service wants the password you define on data.grandlyon.com/onegeo-login/fr/profile/, with the email address of your account as the login. Set it there, paste it here, and press Test the Data Grand Lyon account. If it still fails, the account may not have confirmed its email address yet.

"Data Grand Lyon answered HTTP 404" — your account is fine: the dataset itself is not published under the name the integration asked for. The Métropole renames its TCL layers when the network changes (that is what the _2_0_0 suffix in the message means). The integration tries every name it knows, then asks the platform's own catalogue what the dataset is called today and uses that name, so most renames now heal themselves without an update. When even the catalogue has nothing, the message lists what was tried and the closest names the platform does publish: open an issue with it, and updating the integration is all it will take.

"Test the Data Grand Lyon account" reports a dataset as unreadable — the button probes the three datasets separately, and its first line is the one that matters: if it says your account was accepted, your credentials are right. A single line means that one dataset was retired (see above); the features built on the other two keep working.

"Data Grand Lyon did not answer within ..." — the platform took too long, usually while downloading the whole stop directory for Find a transit stop. Press the button again: the first successful download is kept in memory for an hour, so the following searches answer instantly. Typing a stop name in full (Bellecour rather than belle) skips the download altogether.

A stop always shows 999999 means "no departure announced". Outside service hours that is normal. If it persists during the day, the stop id is probably wrong (or the line filter never matches, e.g. @T1 on a bus-only stop): re-run Find a transit stop.

A Vélo'v station or a park & ride errors on every poll — the identifier is not in the feed. Re-run the matching search button and paste the id it returns; the park & ride error also names a few of the identifiers the dataset does hold.

A park & ride shows a status and a capacity, but no free spaces — SYTRAL does not count that facility live, and the integration will not invent a number: List the park & ride facilities shows the same ? next to it. This is the open data, not the configuration.

A device records nothing since the integration was updated — Gladys keeps the features a device was created with, and a container cannot add one to a device that already exists: re-publishing a discovery only refreshes its parameters. So a version that adds a feature publishes values that have nowhere to land. A park & ride nobody counts live is the clearest case: its only two values, Total capacity and Status, are exactly the features an older device does not have, and the car park stays empty while the logs only mention the thin feed. The integration now says so instead: the device carries an orange dot in the device list, whose tooltip names what is missing, and the logs spell it out once (… does not have the feature(s) capacity, status in Gladys …). The fix is in the Discovery screen: press Update on the device ( deleting it and adding it again works too), and the values arrive on the next read.

A device I added stays empty — features showing no value at all mean the device is never read. Older versions published their devices without the flag Gladys reads to schedule them, so the core never polled them and no error was raised anywhere. The integration now refreshes its own devices as well, so an empty device fills in shortly after the container restarts, without having to be deleted and added again. If it is still empty after that, the read itself is failing: the integration logs every failed read with its reason.

I pasted an identifier and the Discovery screen stays empty — the Discovery screen only lists what the integration published, and it publishes when the configuration is saved, not when a field is edited. Save the configuration, then read the integration status just above: it now spells out what is being watched ("Connected. Watching 1 stop — they appear in the Discovery screen"). If it says something else, or your entry is missing from the count, the value did not reach the integration — check that the field was saved, then press the scan button of the Discovery screen. The integration logs the same thing on every publication: Publishing 1 device(s): Bellecour.

The integration logs everything it does: read the integration logs from the Gladys UI, with LOG_LEVEL=debug for the full detail (every outgoing request is logged at that level).

Data sources and credits

This is an unofficial integration. It is not affiliated with SYTRAL Mobilités, Keolis Lyon or JCDecaux.

Configuration settings

These are the settings Transports en Commun Lyonnais asks for in its configuration screen in Gladys.

SettingTypeRequiredDescription
How it workssectionNoThis integration creates one read-only device per transit stop, Vélo'v station and park & ride you list below. Vélo'v works out of the box (open GBFS feed). Transit stops and park & ride read the TCL real-time datasets on Data Grand Lyon, which need a free account.
Data Grand Lyon accountsectionNoYou sign in on data.grandlyon.com with GrandLyon Connect, but the API needs a separate password that you set on the data platform itself. If its profile page asks for an old password you never had, log out of the portal and use its forgotten-password link. Leave both fields empty if you only watch Vélo'v stations.
Data Grand Lyon loginstringNoThe login of your data platform account — in general the email address of your GrandLyon Connect account.
Data platform passwordsecretNoThe password you defined on data.grandlyon.com/onegeo-login/fr/profile/, NOT your GrandLyon Connect password.
What to watchsectionNoSeparate entries with commas or newlines. Use the buttons at the bottom of this screen to look up the identifiers without leaving Gladys.
Transit stopsstringNoStop identifiers. Optional line filter after @ and custom name after : — e.g. "1234, 5678@T1:Tram at home, 4321@C3|C13".
Vélo'v stationsstringNoStation identifiers or names, with an optional custom name after : — e.g. "10063, Hotel de Ville:Work".
Park & ride (P+R)stringNoPark & ride identifiers or names, with an optional custom name after : — e.g. "Gorge de Loup, Parilly:Commute".
Refresh intervalssectionNoEach device is refreshed by Gladys at its own interval. The upstream feeds are recomputed about once a minute, so polling faster only costs requests.
Departures refresh interval (s)numberNoHow often the next departures of each watched stop are refreshed, in seconds.
Vélo'v refresh interval (s)numberNoHow often bike and dock availability is refreshed, in seconds.
Park & ride refresh interval (s)numberNoHow often park & ride occupancy is refreshed, in seconds.
Departures per stopnumberNoHow many upcoming departures each stop device exposes as features.

How to install Transports en Commun Lyonnais in Gladys

  1. In Gladys, open Integrations: Transports en Commun Lyonnais appears in the catalog, next to the native integrations, with a community badge.
  2. Click Install. Gladys pulls the Docker image (ghcr.io/prohand/gladys-transport-commun-lyonnais:1.0.4), 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/prohand/gladys-transport-commun-lyonnais.

Transports en Commun Lyonnais requires Gladys >=4.86.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

Transports en Commun Lyonnais 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 prohand, 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 🙂