Horaires des services publics smart home integration, free and open source

Opening hours of the public services of your town: open now, today's hours, next opening.
The opening hours of the public services of your French commune (town hall, prefecture and sub-prefecture, gendarmerie, police station, CAF, CPAM, France services, France Travail, tax offices…) from the directory of the French administration of Service-Public.fr (DILA). No account, no key.
Hours are indicative: they are the ones the directory publishes. Check with the service before going, especially on a public holiday or during school holidays.
Unofficial integration, not affiliated with the DILA nor with the services listed. Tested against the real answers of the directory (Toulouse and Fonsorbes, 2026-10-29), not yet on a real Gladys instance: feedback welcome.
What you get
-
A device per service you add: open now or not, today's hours, next opening, the directory's comment ("sur rendez-vous", "fermé le …"), shown as it is.
-
A widget "Public services": your services on one row each, green when open, orange in the last half-hour, red when closed.
-
Three scene triggers: a service opens, a service closes, a service closes in 30 minutes.
-
A scene action "Is it open?": your services in a sentence, with the closing time or the next opening.
-
Real-time waiting times of the town halls that publish them (Strasbourg today): the wait in minutes, open or closed, and a "Short wait" trigger to know when to go.
Requirements
- Gladys Assistant 5.3.0 or later.
- Internet access from Gladys: the directory and geo.api.gouv.fr are public APIs.
- No account, no API key.
Installation
- In Gladys, open Integrations → Install from GitHub.
- Paste
https://github.com/guim31/gladys-services-publicsand confirm. - Open the integration once installed to configure it.
Configuration
Settings
| Setting | Purpose |
|---|---|
| Communes | INSEE codes or names, separated by commas (5 at most): 31555, Fonsorbes. |
| Types of service | The types offered. Default: town hall, prefecture, sub-prefecture, gendarmerie, police station, CAF, CPAM, France services, France Travail, tax office for individuals. |
| Directory read | Every 6 hours, 12 hours (default) or once a day. |
| Language of names and messages | Language of the features, the widget and the scene action (French by default). |
A name shared by several communes means the most populated one: the Status action says so, and the INSEE code (on the commune's page, on the Insee website for instance) settles it.
A postal code typed instead of the INSEE code is also understood, unless it is another commune's INSEE code: the Status action shows the commune used. For Paris, Lyon and Marseille, the services of the arrondissements are searched too.
Adding services
- Type your communes, tick the types of service, save.
- Open the Discover tab of the integration: the services standing in these communes, and the ones whose area covers them (the gendarmerie of the next town, for instance), are listed.
- Add the ones you want to Gladys.
A service added stays watched even if you later remove its commune from the settings. Your CAF or CPAM is in the nearby city? Add that city to the communes.
Checking
The Status action of the integration page shows the communes found, the number of services offered, the last read of the directory and the last error.
Real-time waiting times
Some town halls publish their waiting time live. On 2026-10-29, only Strasbourg does so in open data (administrative centre and district town halls); no other city, prefecture or CAF publishes a live feed. Other cities will be added when they do.
| Setting | Role |
|---|---|
| Places with a waiting time | Part of their names, separated by commas (10 at most): Cronenbourg, Centre administratif. Strasbourg takes them all. Empty: none. |
| Short wait under (minutes) | Threshold of the "Short wait" trigger (10 by default). |
Each place chosen appears in Discover as a device of its own, "Mairie de quartier Cronenbourg - Strasbourg": your directory devices do not change. The Status action says how many places each name picks.
Devices
Every service added becomes a read-only device with four features:
| Feature | Type | Content |
|---|---|---|
| Open now | binary (1 = yes) | Computed every minute. No value when the directory gives no hours. |
| Today's hours | text | 08:30–12:00, 13:30–18:00, "Closed today", "Public holiday: assumed closed"… |
| Next opening | text | "today at 13:30", "tomorrow at 08:30", "Monday at 08:30", "open 24/7". |
| Comment | text | The directory's remarks, as they are (in French). |
Hours are read in the time zone of the service (Paris in mainland France, local time overseas). Feature names follow the language setting.
A place with a waiting time becomes a device with two features: Waiting time (duration in minutes) and Open (real time) (binary, from the city's feed, not from the directory). The wait is published only while the place is open: once it closes, no new wait is sent (never a 0), and Gladys keeps showing the last one until it reopens, so read it together with Open (real time). When the feed has not been updated for 30 minutes, or a place leaves it, nothing new is published for that place.
Dashboard widget
The Public services widget shows one row per watched service (10 at most), under the name you gave it in Gladys: "open until 18:00", "closes in 20 min", "closed · opens Mon 08:30". Settings: the services shown (empty: all of them), and whether to show the times.
A place with a waiting time shows too: "open · 12 min wait", green under the threshold, orange above, red when closed, grey without live data.
Scene triggers
| Trigger | Variables |
|---|---|
| Service opens | service, closing time |
| Service closes | service, next opening |
| Service closes in 30 minutes | service, closing time, minutes before closing |
Each trigger can be limited to some services. They follow the hours of the directory: nothing fires at start, nor after a break of more than five minutes.
Short wait (variables: place, wait in minutes, threshold): the wait of an open place goes under the threshold of the settings between two readings, "time to go". Not at opening (the morning wait is no news), at most once per half-hour for a place, and never after a break of more than ten minutes. Scene filters cannot compare numbers: the threshold is therefore a setting of the integration.
Scene action
Is it open? returns one sentence per chosen service (empty: all of them): "Mairie -
Fonsorbes : ouvert jusqu'à 12:00." in French, "…: closed, opens tomorrow at 08:30." in English.
Outputs: sentence, open_count (services open) and services_count, usable in a "Continue
only if" step.
A place with a waiting time is said too: "Mairie de quartier Cronenbourg - Strasbourg: open,
12 min wait.", and counts in open_count when the feed says it is open.
Scene examples
- Every morning at 8, send "Is it open?" for the town hall and the CAF on Telegram.
- When the CPAM closes in 30 minutes and someone is home, say it on the speaker.
- A "going to the town hall" button: continue only if
open_countequals 1.
Data and refresh
-
Directory of the administration (Service-Public.fr, DILA), public Opendatasoft API, no key, under the Licence Ouverte. The integration only asks for the fields it needs (name, type, commune, hours, comment, address, phone, link): never the names of the heads of services.
-
geo.api.gouv.fr (DINUM) turns a commune name into its INSEE code, once per start.
-
The directory is read every 12 hours by default: one request per commune (two or three for a big city), plus one for the watched services outside your communes. Open or closed is then computed every minute, without any request.
-
After a failure, a new try 15 minutes later; the hours already read stay in use.
-
Waiting times: feed of the City and Eurometropolis of Strasbourg (data.strasbourg.eu, Opendatasoft, no key, Licence Ouverte), read every 2 minutes (720 requests a day), and only when a place is chosen or added.
Troubleshooting
-
No service in Discover: check the Status action (commune not found? no type ticked?). Some small communes only have their town hall in the directory.
-
"No hours in the directory": the service publishes no hours (many gendarmerie brigades), or only in its comment. The open state then stays empty.
-
The wrong commune: type its INSEE code rather than its name.
-
Detailed logs: variable
LOG_LEVEL=debug. -
Short wait never fires: the threshold may be too low, or the place opened with a short wait already (nothing fires at opening).
Limitations
-
Public holidays: the directory says nothing about them. A service that opens on Sundays is assumed open, any other one assumed closed, and the texts say so. The holidays of Alsace-Moselle and of the overseas departments are taken into account.
-
Comments are not interpreted: "fermé le 24 décembre" or "sur rendez-vous" do not change the open state, they are shown in the comment.
-
Slots without usable hours ("00:00 to 00:00") are ignored, never guessed.
-
School holidays and exceptional closures are only known if the directory publishes them.
-
The directory's ranges add up: when it gives two ranges for the same day (walk-in and by appointment, for instance), the service is said open over both.
-
In New Caledonia, French Polynesia and Wallis-et-Futuna, no public holiday is assumed (they have their own); the local time zone is used.
-
The waiting time is the one the city publishes (an average it computes), updated every few minutes. Places are not tied to their directory record: the names differ too much for a safe match.
Credits
- Data: Directory of the administration, Direction de l'information légale et administrative (DILA), Licence Ouverte 2.0.
- Communes: geo.api.gouv.fr, DINUM, Licence Ouverte 2.0.
- Public holidays: same rules as gladys-holidays (date-holidays), rewritten here without a dependency.
- Waiting times: Durée d'attente aux mairies en temps réel, City and Eurometropolis of Strasbourg, Licence Ouverte.
Configuration settings
These are the settings Horaires des services publics asks for in its configuration screen in Gladys.
| Setting | Type | Required | Description |
|---|---|---|---|
| How it works | section | No | Type your commune and tick the services you care about, then save: they appear in the Discover tab. Hours come from the Service-Public.fr directory and are indicative: check with the service. No account, no key. |
| Communes | string | Yes | INSEE codes or names, separated by commas (5 at most). The services standing there or covering them are offered. |
| Types of service | multi_select | No | |
| Directory read | select | No | Open or closed is computed every minute from the hours kept. |
| Real-time waiting times | section | No | Optional. Some town halls publish their waiting time live: today Strasbourg (administrative centre and district town halls). Each place chosen appears in the Discover tab as its own device. |
| Places with a waiting time | string | No | Part of their names, separated by commas (10 at most), or the city name for all its places. Empty: none. |
| Short wait under (minutes) | number | No | The "Short wait" trigger fires when the wait of an open place goes under this value. |
| Language of names and messages | select | No | Feature names are fixed when a device is added. |
How to install Horaires des services publics in Gladys
- In Gladys, open Integrations: Horaires des services publics appears in the catalog, next to the native integrations, with a community badge.
- Click Install. Gladys pulls the Docker image (
ghcr.io/guim31/gladys-services-publics: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/guim31/gladys-services-publics.
Horaires des services publics 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
Horaires des services publics 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 guim31, 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