Integración domótica Rhein-Main Transit (RMV data), gratuita y de código abierto

Unofficial. Next departures and disruptions at your Rhein-Main stops. Data source: RMV.
La documentación de esta integración la escribe su autor y, por ahora, solo está disponible en inglés.
The next departures (S-Bahn, U-Bahn, tram, bus, regional trains) at up to four stops of the Rhein-Main-Verkehrsverbund area (Frankfurt, Wiesbaden, Darmstadt, Mainz and the rest of Hesse served by the RMV), and the disruption messages the RMV attaches to them, in Gladys. Data source: RMV (Rhein-Main-Verkehrsverbund GmbH).
This integration is unofficial: it is not affiliated with, endorsed nor
sponsored by the Rhein-Main-Verkehrsverbund, and it is not an official source.
Check rmv.de or the station displays before you travel. It was never tested
with a real key nor on a real Gladys installation by its author: the RMV API
was simulated from its published schema (rest-2.39.xsd) and from the error
answers it gives without a valid key.
Get started
- Ask for your personal access key on the RMV Open Data page (form, with the intended use, e.g. "home automation, departures at my stops"). The key is free, personal and revocable; the RMV may refuse it. Read its terms of use (German): among others, the key must never be passed on to anyone, the data serve passenger information only, and a key unused for 180 days is deleted. By asking for your key, you accept these terms: their obligations (use, quotas, naming the source, the test version the RMV asks for, etc.) are yours, as the holder of the key (§4 c: one access per user).
- Find the stop ids. An RMV stop id has 6 to 9 digits (e.g. 3000010 for
Frankfurt (Main) Hauptbahnhof). It appears in the address of a stop page of
rmv.de, and the location search of the API (
location.name) gives it. - Install the integration, type the key and the ids in its configuration, and save. Open the Discover tab and press Add on each stop. Its name becomes the RMV name ("Frankfurt (Main) Hauptbahnhof tief (departures)") after the first read, unless you typed one.
One device per stop. A device belongs to a slot and its id: if you type
another id in a slot, the integration offers a new device; the old one is no
longer updated and keeps its last values (the configuration page lists it
under "Not updated any more": delete it in Gladys). Changing the line filter
keeps the device. The filter takes lines as the RMV names them, comma
separated: S8, U4, 51 (a bus line matches by its number or by its name
"Bus 51").
What each device shows
| Feature | Type | Content |
|---|---|---|
| Next departure | text | "S8 → Wiesbaden Hauptbahnhof in 5 min (08:19, +1 min, track 103)"; "now" when it leaves; "timetable, no real-time data" when the RMV has no live time |
| Following departure | text | the same for the next one |
| Departures (30 min) | counter | for scenes, e.g. "more than 0" |
| Departures | text | "08:14 · S8 → Wiesbaden Hauptbahnhof 5, 20 min · U4 → Enkheim 11 min · 1 cancelled" |
| Disruptions | counter | the active disruption messages of the stop and of its departures (after the line filter) |
| Disruption | text | the most important message (lowest RMV priority) and how many more |
The times are Frankfurt times, the real-time ones when the RMV has them. Every
read publishes every value: a departure that is gone becomes "No following
departure (read 08:16)", never a number left behind. A cancelled departure is
not a departure: it is counted apart in the summary. A failed, stale or
unreadable read publishes nothing (no 0): the configuration page says why
and since when. When the real-time data of the RMV has not changed for 15
minutes (planRtTs), or when that stamp is there but cannot be read, nothing is published
either (without any stamp, nothing proves the feed is old: the board is published).
The scene trigger New RMV disruption at a stop fires once for a message seen for the first time at a watched stop, when it started or changed within the last 24 hours (the first read only learns the messages already there; 10 events per read at most).
Requests and quotas
- One request per stop and per read (the disruption messages come in the same answer), one at a time, 2 s apart at least. Read interval: 120 s by default (60 to 900).
- The terms of use of the RMV allow 600 requests an hour and 5,000 a day
per key. The integration keeps a daily budget (4,000 by default, 5,000 at
most, setting "Daily budget", for the case where the same key serves
something else) and a cap of 540 requests per clock hour. It counts the
requests of the Berlin day and hour, writes the counts to
/databefore each request (a restart keeps them), and stretches the read interval when the planned reads would not fit 90 % of the budget (the status says "Reads every N s"). Four stops at 120 s use 2,880 requests a day. - Reading window (optional, settings "Read from" and "Read until", Berlin time, HH:MM): the terms of the RMV ask for timetable information "on request" (§4 e). Outside the window no request is sent; the devices keep their last values with the time of their read, and the status says "Outside the reading window". A read leaves as soon as the window opens (never less than one interval after the previous one). End excluded; a window may pass midnight (22:00 to 01:00); both empty: all day; only one set, an invalid time or two equal times: refused, named in the status, reads all day. The clock changes follow Berlin time (a window starting in the hour skipped in spring opens one hour later that day). With a window, the daily budget is spread over its length only (plus one hour for the days of clock change).
- If the RMV says the quota of the key is spent (
API_QUOTA), the reads pause one hour, then two, up to 6 hours. A 429, a server error or an unexpected answer pauses the reads from 1 or 2 minutes, doubled up to 6 hours. - If the RMV refuses the key (
API_AUTHwith HTTP 401 or 403, or in its answer), nothing is sent with it any more, even after a restart, until you type another key or press Show the last read / retry the key, which sends one request with it (60 s at least after the previous one). A success lifts the refusal. Any other HTTP 401 or 403 is not taken as a refusal: it pauses the reads. - An unknown stop id (
SVC_LOC) is said on the configuration page and asked again after 30 minutes; the other stops go on. - A restart, a reconnection, a saved configuration that did not change and Discovery never read sooner than the interval. The button reads only to retry a refused key, as said above, also outside the reading window.
Your key
The key is kept by Gladys in its database, never shown again, and sent only to
the RMV (in the address of each request, as the API requires). The integration
never writes it to its logs, its status nor /data; the error text of the RMV,
which repeats the key, is never kept nor shown. It keeps in /data two salted 8-bit prints
of a refused key (65,536 possible values, shared by countless keys), enough to
know "another key" after a restart, and a salted 8-bit print of the key beside
the request counts (256 possible values), to start them again for another key.
Troubleshooting
The message at the top of the configuration page tells where each stop stands and how many requests the key used today. Common messages:
- "The RMV does not know this stop id": check the id; asked again after 30 minutes.
- "No departure has confirmed this stop id yet": the board is empty and no departure was ever seen there; nothing is published until one is.
- "Differs from the clock of this machine": set the clock of the machine that runs Gladys.
Terms of use
The data is used under the terms of use of the RMV-Auskunft-API (Rhein-Main-Verkehrsverbund GmbH): free of charge, revocable at any time, without warranty, for passenger information only, through each user's own key from their own Gladys. Each user holds their own key: by asking for it, they accept the RMV Open Data terms, and their obligations are theirs. Data source: RMV (a text mention; no logo of the RMV is used).
Parámetros de configuración
Estos son los parámetros que Rhein-Main Transit (RMV data) te pide en su pantalla de configuración en Gladys.
| Parámetro | Tipo | Obligatorio | Descripción |
|---|---|---|---|
| Rhein-Main trains and buses | section | No | Unofficial, not affiliated with the Rhein-Main-Verkehrsverbund. Data source: RMV (Rhein-Main-Verkehrsverbund GmbH). The next departures (S-Bahn, U-Bahn, tram, bus, regional trains) at up to four stops of the RMV area, and the disruption messages the RMV attaches to them. It needs a free personal access key to the RMV API, asked on the RMV Open Data page (the RMV may refuse or revoke it). The terms of the RMV allow 600 requests an hour and 5000 a day per key: the integration counts its requests and stays within the daily budget below. |
| RMV access key | secret | No | Your personal access key to the RMV API (accessId), kept by Gladys in its database, never shown again, sent only to the RMV. The terms of the RMV forbid passing it on to anyone. |
| Language of the texts | select | No | The language of the device names and the departure texts. |
| Language of the RMV texts | select | No | The language asked of the RMV for its own texts (stop names, disruption messages). Some messages exist in German only. |
| Read interval (s) | number | No | How often the departures are read, in seconds (60 to 900). One request per stop and per read. Stretched when the daily budget would not hold it. |
| Daily budget (requests) | number | No | Requests per Berlin day at most (200 to 5000; the RMV allows 5000 a day and 600 an hour per key, and the same key may serve another application). Each stop costs one request per read. |
| Read from (optional) | string | No | Reading window, Berlin time (HH:MM): outside it, no request is sent and the devices keep their last values with the time of their read. Read at once when the window opens. Both empty: all day. A window may pass midnight (e.g. 22:00 to 01:00). |
| Read until (optional) | string | No | End of the reading window, Berlin time (HH:MM), excluded. |
| Stop 1 | section | No | The RMV id of a stop (6 to 9 digits, e.g. 3000010 for Frankfurt (Main) Hauptbahnhof): shown in the address of the stop page of rmv.de, or asked with the location search of the RMV API. |
| Name (optional) | string | No | |
| RMV stop id | string | No | |
| Lines (optional) | string | No | Only these lines, comma separated (e.g. S8, U4, 51). Empty: every line. |
| Stop 2 | section | No | |
| Name (optional) | string | No | |
| RMV stop id | string | No | |
| Lines (optional) | string | No | Only these lines, comma separated (e.g. S8, U4, 51). Empty: every line. |
| Stop 3 | section | No | |
| Name (optional) | string | No | |
| RMV stop id | string | No | |
| Lines (optional) | string | No | Only these lines, comma separated (e.g. S8, U4, 51). Empty: every line. |
| Stop 4 | section | No | |
| Name (optional) | string | No | |
| RMV stop id | string | No | |
| Lines (optional) | string | No | Only these lines, comma separated (e.g. S8, U4, 51). Empty: every line. |
Cómo instalar Rhein-Main Transit (RMV data) en Gladys
- En Gladys, abre Integraciones: Rhein-Main Transit (RMV data) aparece en el catálogo junto a las integraciones nativas, con una insignia de comunidad.
- Haz clic en Instalar. Gladys descarga la imagen Docker (
ghcr.io/lm1lc3n7/gladys-rhein-main-transit:0.1.1), la ejecuta en un entorno aislado del núcleo y genera la interfaz de la integración (dispositivos, descubrimiento y configuración). - Abre la pantalla de Configuración de la integración, rellena los parámetros y guarda.
- También puedes instalarla directamente desde la URL de su repositorio: https://github.com/LM1LC3N7/gladys-rhein-main-transit.
Rhein-Main Transit (RMV data) requiere Gladys >=5.3.0. El catálogo de Gladys se actualiza cada hora, así que una nueva versión está disponible como máximo una hora después de publicarse.
¿Todavía no usas Gladys? Es gratuito y de código abierto: sigue la guía de instalación para empezar.
Sobre las integraciones externas
Rhein-Main Transit (RMV data) es una integración externa: una integración comunitaria empaquetada como contenedor Docker y publicada en GitHub. Gladys la instala con un clic y la ejecuta en un entorno aislado del núcleo. La publica y mantiene LM1LC3N7, no el equipo principal de Gladys.
- Explorar todas las integraciones, nativas y de la comunidad
- Crear y publicar tu propia integración externa
- Código fuente en GitHub — fuente de esta documentación