Québec 511 Smart-Home-Integration, kostenlos und Open Source

Unofficial. Road works and winter road conditions in Québec (MTMD open data).
Die Dokumentation dieser Integration wird von ihrem Autor geschrieben und ist bisher nur auf Englisch verfügbar.
Unofficial integration. It reads two open datasets of the Ministère des Transports et de la Mobilité durable du
Québec (MTMD), published on Données Québec: road works (with their
restrictions) and winter road conditions of the provincial network. It reads them from the ministry's public WFS
service (ws.mapserver.transports.gouv.qc.ca), the source of both datasets. No account, no API key.
This integration is not an official source. Before you drive, check Québec 511 itself. The data may lag behind the road, and the integration may miss road works or a change of conditions.
Source: Ministère des Transports et de la Mobilité durable du Québec, datasets "Travaux routiers" and "Condition routière hivernale du réseau routier", Données Québec, licensed under CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). The integration does not change the data; it filters it by zone and sums it up. It is not endorsed by the ministry.
What you get
Up to three watch zones, each one a Gladys device. A zone is a circle around a point (1 to 300 km), optionally limited to some route numbers ("20, 40, 117").
Each zone device has:
| Feature | Type | Meaning |
|---|---|---|
| Road works in effect | counter | Road works whose period covers the current time, inside the zone |
| Major road works | counter | Those whose restriction is "major" (Majeure) in the data |
| Segments in winter conditions | counter | Road segments inside the zone whose surface is snowy, snow packed or icy |
| Summary | text | The road works (major first, then by distance), then the winter segments |
The summary is written in the language chosen in the configuration (French by default, or English): the works titles come in both languages from the ministry; place names stay as the ministry writes them.
In effect means: the start of the works is past and their end is not, compared with the time of the ministry's
server (Date header of its answer). The dates of the data have no time zone: they are read as Québec time
(Eastern, daylight saving time included). Road works planned for later are not counted until they start. The data
gives a period, not daily hours: works "during the week" or "at night" count for their whole period. A work whose
start or end cannot be read counts as in effect; when more than half of the works have such dates (in an answer of 3 works or more), the dataset is
refused (its format changed) and nothing is counted. Without a Date header, the clock of Gladys is used, when it is
plausible. A Date more than a day away from the clock of Gladys (one of the two is wrong), or no Date with an
implausible clock: the road works are not counted at all (never every listed work), and the status says so.
Winter conditions: the road surface codes of the ministry's data dictionary. "Bare and dry" and "Bare and wet" are not winter conditions; partly snow covered, snow covered, partly snow packed, snow packed, partly ice covered and ice covered are. An unknown code is counted neither way. The ministry publishes this layer during the winter season; out of season, or where no segment is covered, the count is 0 and the summary says "No winter condition segment in the zone". Reduced or no visibility is written in the summary next to a segment in winter conditions (not for a bare road).
Nothing rather than 0: an answer that is not a full list (an error page, a list cut short, a list where more
than half of the entries cannot be read) is never published as 0. Each of the two datasets stands alone: when one
fails, its own features keep their last value, the status says why, and the other one is still published. The
summary follows the datasets read: it says "Road works not read" or "Winter conditions not read" for the one that
failed. A list without the count the service always sends (numberMatched) is taken as cut, never as 0.
Scene trigger: "New road works in a zone"
Fired when road works in effect appear in a zone for the first time and started or were updated within the last 24 hours (server time). Filters: zone, restriction (major, minor). Variables: route number (empty when none), works title (French and English), location, restriction, direction and restriction type (French), major (yes/no), start and end (UTC, ISO 8601), distance from the zone center (km), ministry works id.
It is not fired by the first read of a zone, nor after you move a zone (new center, radius or routes): that read only learns what is already there. It is not fired when no time can be believed (see above). At most 20 events per zone and per read: the others come with the next read (when still within 24 hours).
Configuration
- Language of the summary: French or English.
- Read interval: 15 to 120 minutes (15 by default).
- Zone 1 (required), zones 2 and 3 (optional, left empty to turn them off): a name, the latitude and longitude of the center (decimal degrees, inside Québec), the radius in km (20 by default), and optionally the routes to keep, as numbers separated by commas ("20, 40, 117"; "A-20", "R-117", "autoroute 20" or "route 117" work too). With routes set, works and segments without a route number (local streets, some bridges) are left out.
A refused field is named in the status (the value you typed is not repeated there).
The button Show the last read tells what the last read of each zone gave and when the next comes. It does not read the ministry service.
Pace and courtesy toward the ministry service
- Two requests per round (road works, then winter conditions), whatever the number of zones: each asks only for the box holding every zone. One request at a time, 5 seconds at least between the starts of two requests.
- A round every interval, 15 minutes at least, measured from the start of the previous round.
- No read sooner after a restart, a reconnection to Gladys, a configuration saved unchanged, a Discovery or the
test button (the time of the last attempt is kept in
/data, and in memory); moving a zone reads at once, 5 seconds after the last request. - When
/datacannot tell the last attempt (unreadable file, a date in the future, a/datathat cannot be written or does not answer within 2 seconds), the first read waits 15 minutes after the start, and the status says so; an unreadable/datais read again every 10 seconds, and what it holds (pause, works already seen) comes back once it reads; a/datathat stops being writable later is said in the status too: a restart may then read sooner. - After a 429 ("too many requests"), every read pauses for 15 minutes, then 30, 60… up to 6 hours; after a
server error (5xx) or another unexpected status (400, 403, 404…), for 5 minutes, then 10, 20… up to 6 hours;
a
Retry-Afterlonger than that is honored, up to 6 hours. A refusal that arrives while the configuration is being saved, or Gladys reconnects, still starts the pause. The pause is kept in/dataacross restarts; the doubling starts over after a successful read. - User-Agent
gladys-quebec-511/<version> (+https://github.com/LM1LC3N7/gladys-quebec-511). - An answer is cut after 30 seconds or 8 MB (the whole province is about 1.3 MB).
The service offers neither ETag nor Last-Modified: every round reads the data again. The datasets are updated
continuously; reading more often than every 15 minutes would bring nothing.
Status
The Configuration screen shows, for each zone, the counts of the last read and its time (Eastern time), or, for each dataset that failed, why and the time of its last data. Data older than 2 hours is said stale. The integration is shown connected when the last read of at least one dataset of one zone succeeded, less than 2 hours ago.
Privacy
The coordinates of your zones stay in the Gladys configuration. The ministry service receives the box around your
zones (their circles fit in it). The /data file holds the time of the last attempt, the pause, and per zone the
ids of the road works already seen with a salted fingerprint of the zone, not its coordinates.
Limits
- Québec only (the zone center must be in Québec; data near the borders is included).
- Tested against the real ministry service on 2026-11-15 (Montréal, Québec City, Laurentides); never tested by a user in Québec, nor during a snow storm (on that day every segment around Montréal was bare).
- Road warnings (incidents, closures announced on Québec 511) are not part of these open datasets and are not read.
- quebec511.info itself is not read (it refuses automated clients); only the open data service is.
Konfigurationseinstellungen
Diese Einstellungen fragt Québec 511 in seinem Konfigurationsbildschirm in Gladys ab.
| Einstellung | Typ | Pflichtfeld | Beschreibung |
|---|---|---|---|
| Québec 511 road works and winter conditions | section | Nein | Road works in effect and winter road conditions on the network of the Ministère des Transports et de la Mobilité durable du Québec, read from its open data (Données Québec, CC BY 4.0): no account, no key. Up to three zones, each one a device. Check Québec 511 before you drive: this integration is not an official source. |
| Language of the summary | select | Nein | Language of the device names and of the summary text (place names stay as the ministry writes them). |
| Read interval (minutes) | number | Nein | From 15 to 120 minutes. Each read asks the ministry service twice (road works, then winter conditions), whatever the number of zones. |
| Zone 1 | section | Nein | A circle around a point: the road works in effect and the winter condition segments inside it are counted. Required. |
| Name | string | Nein | Name of the device in Gladys (60 characters at most). |
| Latitude | number | Ja | Center of the zone, in Québec (decimal degrees). |
| Longitude | number | Ja | Center of the zone (decimal degrees, negative: west). |
| Radius (km) | number | Nein | From 1 to 300 km. |
| Only these routes | string | Nein | Optional: route numbers separated by commas ("20, 40, 117"; "A-20" or "R-117" work too). Works and segments without a route number are then left out. Empty: every road of the zone. |
| Zone 2 (optional) | section | Nein | A circle around a point: the road works in effect and the winter condition segments inside it are counted. Leave the latitude and longitude empty to turn it off. |
| Name | string | Nein | Name of the device in Gladys (60 characters at most). |
| Latitude | number | Nein | Center of the zone, in Québec (decimal degrees). |
| Longitude | number | Nein | Center of the zone (decimal degrees, negative: west). |
| Radius (km) | number | Nein | From 1 to 300 km. |
| Only these routes | string | Nein | Optional: route numbers separated by commas ("20, 40, 117"; "A-20" or "R-117" work too). Works and segments without a route number are then left out. Empty: every road of the zone. |
| Zone 3 (optional) | section | Nein | A circle around a point: the road works in effect and the winter condition segments inside it are counted. Leave the latitude and longitude empty to turn it off. |
| Name | string | Nein | Name of the device in Gladys (60 characters at most). |
| Latitude | number | Nein | Center of the zone, in Québec (decimal degrees). |
| Longitude | number | Nein | Center of the zone (decimal degrees, negative: west). |
| Radius (km) | number | Nein | From 1 to 300 km. |
| Only these routes | string | Nein | Optional: route numbers separated by commas ("20, 40, 117"; "A-20" or "R-117" work too). Works and segments without a route number are then left out. Empty: every road of the zone. |
So installierst du Québec 511 in Gladys
- Öffne in Gladys Integrationen: Québec 511 erscheint im Katalog neben den nativen Integrationen, mit einem Community-Badge.
- Klicke auf Installieren. Gladys lädt das Docker-Image (
ghcr.io/lm1lc3n7/gladys-quebec-511:0.1.1) herunter, startet es in einer vom Kern isolierten Sandbox und erzeugt die Oberfläche der Integration (Geräte, Erkennung und Konfiguration). - Öffne den Bildschirm Konfiguration der Integration, fülle die Einstellungen aus und speichere.
- Du kannst sie auch direkt über die URL ihres Repositorys installieren: https://github.com/LM1LC3N7/gladys-quebec-511.
Québec 511 benötigt Gladys >=5.3.0. Der Katalog in Gladys wird stündlich aktualisiert, eine neue Version ist also spätestens eine Stunde nach ihrer Veröffentlichung verfügbar.
Du nutzt Gladys noch nicht? Es ist kostenlos und Open Source: folge der Installationsanleitung, um loszulegen.
Über externe Integrationen
Québec 511 ist eine externe Integration: eine Community-Integration, die als Docker-Container verpackt und auf GitHub veröffentlicht wird. Gladys installiert sie mit einem Klick und führt sie in einer vom Kern isolierten Sandbox aus. Sie wird von LM1LC3N7 veröffentlicht und gepflegt, nicht vom Gladys-Kernteam.
- Alle Integrationen durchsuchen, native und aus der Community
- Deine eigene externe Integration bauen und veröffentlichen
- Quellcode auf GitHub — Quelle dieser Dokumentation