STAS Saint-Étienne smart home integration, free and open source

Next tram and bus departures in Saint-Étienne
The next STAS tram and bus departures (Saint-Étienne Métropole) in Gladys: one device per followed stop, scene triggers (departure soon, delay, cancellation), a "next departure" scene action and a dashboard widget.
The data comes from the open data of Saint-Étienne Métropole: the theoretical timetable of the network (GTFS), corrected in real time (GTFS-RT) when the STAS publishes delays or cancellations. No account, no API key: Gladys only needs Internet access.
Installation
- In Gladys, open Integrations, then the external integrations store.
- Search for STAS Saint-Étienne and click Install.
- Wait for the container to start: the integration appears in the list.
Configuration
Open the Configuration tab of the integration:
| Field | Purpose |
|---|---|
| Stops | The stops to follow, separated by commas, e.g. Bellevue, Hôtel de Ville. Accents and case are ignored. A name follows the stop in both directions; the id of a boarding point (e.g. 27GA41) follows one direction only. |
| Lines | Optional: only keep these lines (T1, T3, M3). Empty = every line. |
| Departures listed | Number of departures in the "Next departures" text of each stop (3 by default). |
| Use real-time data | Corrects the timetable with the delays and cancellations the STAS publishes. Off, only the theoretical times are used. |
| "Departure soon" notice | The "Departure soon" trigger fires this many minutes before each departure (5 by default, 0 disables it). |
| Delay threshold | The "Departure delayed" trigger fires for a delay of at least this many minutes (5 by default). |
| Refresh interval | How often the stops are updated, in seconds (60 by default, one minute minimum). |
Not sure of a stop name? The Search a stop button gives, for part of a name (chateaucreux), the exact name, the lines serving it and the ids of its boarding points. The Download the timetable again button forces a new download of the timetable (otherwise refreshed once a day).
Save, then add the stops from the Discovery tab. An unknown stop is reported in the connection status of the integration.
Usage
Each followed stop becomes a STAS <stop name> device with:
- Next departure and Following departure: the minutes before the next two departures, usable in scene conditions ("if the next tram leaves in less than 5 minutes");
- Next departure line and Following departure line: e.g.
T1 → SOLAURE · 18:42; - Next departures: e.g.
3 min T1 → SOLAURE | 8 min M3 → COTONNE.
The time shown is the real-time one when the STAS publishes it, the theoretical one otherwise. When nothing leaves any more (end of service, line filter), the texts show —.
Scenes and dashboards
Scene triggers (filtered by stop and line):
- Departure soon: a tram or bus leaves a followed stop within the notice. Variables: stop, line, destination, time, minutes before departure, delay, real-time.
- Departure delayed: the real-time data announces a delay of at least the threshold.
- Departure cancelled: the real-time data announces that an upcoming departure is cancelled.
Each trigger fires once per departure.
Scene actions:
- Get the next departure: from a stop, optionally of some lines or towards a destination. Outputs: departure found, stop, line, destination, time, minutes, delay, real-time — e.g. for a message "The next T1 leaves in {{minutes}} min".
- Refresh the departures: updates every stop right now.
"STAS departures" widget: the departure board of a stop (the chosen one, else the first followed) with the next three departures in minutes, the following ones with their time, delays and cancellations, where the times come from and a Refresh button.
Help
A question or a problem? Ask on the Gladys community forum or open an issue on the GitHub repository.
Configuration settings
These are the settings STAS Saint-Étienne asks for in its configuration screen in Gladys.
| Setting | Type | Required | Description |
|---|---|---|---|
| Getting started | section | No | The departures come from the open data of Saint-Étienne Métropole: the STAS timetable, corrected in real time when the network publishes delays. No account, no API key. Type the stops to follow, then add their devices from the Discovery tab. Not sure of a stop name? Use the "Search a stop" action below. |
| Stops | string | Yes | Stops to follow, separated by commas. A name follows the stop in both directions; the id of a boarding point (e.g. 27GA41) follows one direction only. |
| Lines | string | No | Only keep these lines, separated by commas. Leave empty for every line. |
| Departures listed | number | No | Number of departures in the "Next departures" text of each stop. |
| Use real-time data | boolean | No | Correct the timetable with the delays and cancellations the STAS publishes. Without it, only the theoretical times are shown. |
| "Departure soon" notice (min) | number | No | The "Departure soon" scene trigger fires this many minutes before each departure. 0 disables it. |
| Delay threshold (min) | number | No | The "Departure delayed" scene trigger fires for a departure late by at least this many minutes. |
| Refresh interval (s) | number | No | How often the stops are refreshed, in seconds (one minute minimum). |
How to install STAS Saint-Étienne in Gladys
- In Gladys, open Integrations: STAS Saint-Étienne appears in the catalog, next to the native integrations, with a community badge.
- Click Install. Gladys pulls the Docker image (
ghcr.io/prohand/gladys-stas-saint-etienne:1.1.0), starts it in a sandbox isolated from the core, and generates the integration's interface (devices, discovery and configuration). - Open the Configuration screen of the integration, fill in the settings, and save.
- You can also install it directly from its repository URL: https://github.com/prohand/gladys-stas-saint-etienne.
STAS Saint-Étienne 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
STAS Saint-Étienne 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.
- Browse all integrations, native and community
- Build and publish your own external integration
- Source code on GitHub — source of this documentation