Skip to main content

Aix en bus smart home integration, free and open source

Aix en bus integration for Gladys Assistant

Next Aix en bus departures at your stops, from the official timetable.

The next departures of the Aix en bus network (Aix-en-Provence, France) at your stops, right in Gladys: on your dashboards, in your scenes and in your messages.

The integration downloads the network's official timetable, published as open data by the Métropole Aix-Marseille-Provence on transport.data.gouv.fr (Licence Ouverte v2.0). It then computes the next departures on your Gladys, with no account and no API key. The file (about 2 MB) is checked once a day and downloaded again only when it changed. When the internet is down, the cached copy keeps working.

These are the scheduled times, the ones on the network's timetables. Real time (delays) is not supported yet.

Installation​

  1. In Gladys, open Integrations, then the external integrations store.
  2. Search for Aix en bus and click Install.
  3. Wait for the container to start: the integration shows up in the list.

Configuration​

Open the Configuration tab of the integration:

  • Stops: the stops to follow, separated by commas, as written at the bus stop (Rotonde, Gare RoutiĂšre). Case and accents are ignored. The stop code works too (roto).
  • Lines (optional): keep only some lines (4, 5, A). Leave empty for every line of the stops.
  • “Bus soon” alert: how many minutes before a departure the “Bus departing soon” trigger fires (5 by default).
  • “Last bus” alert: how many minutes before the last bus of the day the “Last bus of the day soon” trigger fires (30 by default).
  • Refresh interval: how often the next departures are recomputed (60 seconds by default). Computed locally: no network call.

Two buttons help:

  • Search a stop: type part of the name (gare) to get the exact stop names and the lines departing from each.
  • Refresh the timetable: downloads the latest published timetable now, instead of waiting for the daily check.

Usage​

Open the Discovery tab: every line departing from a followed stop, in each direction, is offered as a device, such as “Rotonde · Bus 4 → PĂŽle d'ActivitĂ©s”. Add the ones you need. Each device has three features:

  • Next departure: minutes before the next departure;
  • Following departure: minutes before the one after;
  • Next times: the next three departure times (17:55 · 18:09 · 18:22).

The value 1440 (24 h) means “no departure within 24 hours”, for instance for a line that does not run on Sundays. A terminus is never offered as a departure.

Scenes and dashboards​

Scene triggers:

  • Bus departing soon: the next bus of a followed line leaves within the configured number of minutes. It fires once per departure. Filter: the line at a stop. Variables: line, stop, destination, minutes left, departure time.
  • Last bus of the day soon: the same, for the last bus of the day only, with its own delay.
  • New timetable published: the network published a new timetable (new season, holidays, works). Variables: version, start and end of validity.

Scene actions:

  • Get the next buses: reads the next departures of a line at a stop. Outputs: a bus within 24 h (yes/no), minutes and time of the next and of the following bus, last bus of the day (yes/no), line, stop, destination. For instance a message “The 4 leaves in 7 minutes”, or a condition “if less than 10 minutes are left”.
  • Refresh the timetable: downloads the latest timetable. Outputs: new timetable (yes/no), version, end of validity.

“Next buses” dashboard widget: the board of your stops. It has one row per followed bus line, soonest first, with the destination, the stop, the next times and a badge with the minutes left (orange under the alert delay, red when the bus is imminent). Below: the validity of the timetable and a Refresh button. The widget shows the devices you added. Until you add one, it shows the lines of the configuration.

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 Aix en bus asks for in its configuration screen in Gladys.

SettingTypeRequiredDescription
Getting startedsectionNoThe integration downloads the official Aix en bus timetable, published as open data by the MĂ©tropole Aix-Marseille-Provence, and computes the next departures of your stops on your Gladys. No account, no API key. Type the stops as written at the bus stop; the “Search a stop” button below lists the exact names.
StopsstringYesStops to follow, separated by commas. Each line departing from them becomes a device.
LinesstringNoKeep only these lines, separated by commas. Leave empty for every line of the stops.
“Bus soon” alert (min)numberNoThe “Bus departing soon” scene trigger fires when a bus is this many minutes away.
“Last bus” alert (min)numberNoThe “Last bus of the day soon” scene trigger fires this many minutes before the last bus.
Refresh interval (s)numberNoHow often the next departures are recomputed, in seconds (one minute minimum). Computed locally: no network call.

How to install Aix en bus in Gladys​

  1. In Gladys, open Integrations: Aix en bus 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-aix-en-bus:1.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/prohand/gladys-aix-en-bus.

Aix en bus 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​

Aix en bus 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 🙂