IMGW-PIB smart home integration, free and open source

Water levels, flows and alert levels of Polish rivers and lakes (IMGW-PIB).
Brings the water levels of Polish rivers and lakes (Wisła, Odra, Warta, Bug, the lakes of Masuria and Pomerania, the coast: about 900 stations) into Gladys, with their warning and alarm levels, from the public data of IMGW-PIB, the Polish Institute of Meteorology and Water Management. No account, no key.
Raw values, not a flood warning service. Data can be late, missing or wrong, and the integration depends on your Gladys, your Internet access and a public service. In a flood, follow the official warnings (IMGW-PIB, your municipality, 112). This integration is not affiliated with IMGW-PIB.
What you get
- One device per station you follow: the water level (in cm, as on the IMGW-PIB map), the flow in m³/s and the water temperature when the station provides them, the alert level (0 normal, 1 warning level reached, 2 alarm level reached) when IMGW-PIB gives its thresholds, and the date of the last reading.
- A station that stops sending is shown as such ("No new reading since…"): an old value is never sent again as if it were fresh.
- Three scene triggers: the warning or alarm level is reached or left, a station stops sending readings, a silent station sends again.
- A dashboard widget: your stations, their level, its trend (rising, steady, falling) and their alert level.
- A "Find stations" button that lists the stations around your house, by name, by river, by province or by id, with their current level.
Requirements
- Gladys Assistant 5.1.0 or later.
- Internet access from Gladys: the integration reads
danepubliczne.imgw.pl. - For "around my house": the location of your house in Gladys (Settings, Houses). The integration asks for it at installation (the "location" permission). It is only used inside the container to find the nearest stations: never sent to IMGW-PIB (the integration downloads the whole list), never stored nor logged.
- Poland only.
Configuration
Settings
| Setting | What it does |
|---|---|
| Stations | Station ids or names, separated by commas: 152210170, Trestno. A name shared by several stations takes its river: Krosno Wisłok. |
| Around my house | Also follows the 3 nearest stations that send readings, within 10, 20 or 50 km of your house. |
| Refresh interval | 20, 30 (default) or 60 minutes. One request covers every station. |
| Language of the feature names | Names of the features of new devices (Water level, Flow…), and language of the "Last reading" text and of the scene variables. French by default. |
Save, then open the Discover tab of the integration and create the devices you want. A followed station stays followed as long as its device exists, even if you remove it from the configuration.
Finding your stations
Click "Find stations" in the configuration. Leave the field empty to list the stations around your house (20 km, or the distance chosen), or type:
- a station name:
Głogów,glogoworGLOGOW(case and Polish letters are ignored); - a river or a lake:
Wisła,Odra,Drużno(the 10 nearest, or the first 10 by river); - both:
Odra Słubice; - a province:
dolnośląskie; - a station id:
152210170.
Each line gives the id, the name, the river, the distance from your house and the current level (with the alert level when reached), or "no recent reading". Copy the ids into "Stations", then save.
Devices
| Feature | Type in Gladys | Value |
|---|---|---|
| Water level | Liquid depth (cm) | Level above the gauge zero, in cm (stan wody). |
| Flow (m³/s) | Water flow | In m³/s (Gladys has no m³/s unit: the name says it). Computed by IMGW-PIB, at some stations hours later. |
| Water temperature | Temperature (°C) | About a hundred stations, read once a day (06:00 UTC). |
| Alert level (0 to 2) | Risk level | 0 below the warning level (stan ostrzegawczy), 1 at or above it, 2 at or above the alarm level (stan alarmowy). |
| Last reading | Text | Date of the last water level, or "No new reading since…". |
A feature only exists when the station provides it: about 600 stations have warning and alarm levels, lake stations often have none. The water level is not a depth: it is the reading of the gauge staff, above its own zero. Compare it with the thresholds of the same station (shown in the widget), not with another station. The device parameters hold the station id, its name, its river and its province.
When a station goes silent, Gladys keeps showing its last values, the alert level included: the "Last reading" feature and the widget say since when.
The water level, flow and temperature are numeric features: Gladys scenes can already compare them with any value of your own ("Water level above 650 cm").
Dashboard widget
Add the IMGW-PIB widget to a dashboard.
- Without setting: one line per followed station (10 at most) with its level and trend, coloured by its alert level: green below the warning level, orange at the warning level, red at the alarm level, grey without thresholds or without a recent reading. A heading lists the stations at or above their warning level.
- With a station chosen: its live level, flow and water temperature, then its alert state, its warning and alarm levels, trend and last reading, and a link to the IMGW-PIB map.
Scene triggers
| Trigger | Filters | Variables |
|---|---|---|
| Warning or alarm level crossed | Station, level (warning, alarm), direction (reached, falling back below) | Station name, river or lake, water level (cm), level code and words, its value (cm), direction |
| Station stopped sending readings | Station | Station name, river or lake, date of the last reading |
| Station sends readings again | Station | Station name, river or lake, date of the last reading |
The levels are those IMGW-PIB publishes for each station. A level counts as reached as soon as the water level equals it; the fall counts once the level is 2 cm below it, and only then can a new rise count: a level wobbling around a threshold fires once. A station is silent after 6 hours without a new water level (30 hours without a water temperature for the few lake stations that only send that). An outage of IMGW-PIB or of your Internet access fires nothing: a station is only silent while the others send.
Triggers only fire for a device you created, on a fresh reading, and not after a restart longer than a day. A threshold changed by IMGW-PIB is taken without firing.
Scene examples
- Wisła in Warsaw: "Warning or alarm level crossed", station Warszawa-Bulwary, level "Warning level", reached → send a message: "{{station_name}}: {{height}} cm, warning level ({{threshold_value}} cm) reached".
- Cellar watch: "Warning or alarm level crossed", your station, level "Alarm level", reached → switch on the pump socket and notify the family; the same trigger with "falling back below" → "{{station_name}}: back below the alarm level".
- Station watch: "Station stopped sending readings" → a reminder to check the IMGW-PIB map ("{{station_name}} silent since {{last_reading}}").
Data sources, licence and quotas
- „Źródłem pochodzenia danych jest Instytut Meteorologii i Gospodarki Wodnej – Państwowy Instytut Badawczy” (the source of the data is IMGW-PIB). „Dane Instytutu Meteorologii i Gospodarki Wodnej – Państwowego Instytutu Badawczego zostały przetworzone”: the integration computes the alert level and the trend from them. Terms of use: regulamin, free of charge for private use.
- Values are operational data, not checked by IMGW-PIB: they can be corrected later.
- No account, no key, no documented quota. The integration stays light: one request per refresh (30 minutes by default) for every followed station, about 550 kB. Stations send a water level every 10 to 60 minutes; IMGW-PIB publishes them about half an hour later.
Troubleshooting
- "Unknown station": check the spelling or use "Find stations", then copy the id.
- "Several stations are named…": add the river (
Krosno Wisłok) or use the id. - "IMGW-PIB does not answer": the service or your Internet access is down; the values come back by themselves.
- "Around my house" adds nothing: give your house a location (Settings, Houses), or choose a larger distance. About 30 stations have no coordinates in the data and are never chosen that way: add them by id.
- No alert level feature: IMGW-PIB gives no warning and alarm levels for this station (many lakes and reservoirs).
- No water temperature: only about a hundred stations measure it, once a day.
- "No new reading since…": the station sends late or not at all (failure, maintenance, ice).
- Logs: in Gladys, the integration logs; set
LOG_LEVEL=debugfor every cycle.
Limits
- No hardware needed; tested against the live service and against recorded answers, but not yet in a real Gladys installation: feedback welcome.
- No hydrological warnings of IMGW-PIB (they are given by catchment area, not by station), no forecasts, no ice phenomena: measurements and thresholds only.
- 20 stations at most from the configuration (plus the ones whose device you created).
- The feature names are frozen when the device is created: changing the language later only changes the texts sent afterwards.
Configuration settings
These are the settings IMGW-PIB asks for in its configuration screen in Gladys.
| Setting | Type | Required | Description |
|---|---|---|---|
| Your stations | section | No | Follow hydrological stations of Poland: by id or name, or the nearest ones to your house. "Find stations" below lists them with their river and current level. Save, then create the devices in the Discover tab. |
| Sources and limits | section | No | „Źródłem pochodzenia danych jest Instytut Meteorologii i Gospodarki Wodnej – Państwowy Instytut Badawczy”, data processed (alert level, trend). Free for private use, no account. Raw values, not a flood warning service: official warnings prevail. Not affiliated with IMGW-PIB. |
| Stations | string | No | Station ids (152210170) or station names, separated by commas. A name shared by several stations takes its river: Krosno Wisłok. |
| Around my house | select | No | Also follow the 3 nearest stations that send readings, within this distance of the location of your house in Gladys. |
| Refresh interval | select | No | Stations send a water level every 10 to 60 minutes, published by IMGW-PIB about half an hour later. One request covers every station. |
| Language of the feature names | select | No | Names given to the features of new devices (Water level, Flow…), and language of their texts and of the scene variables. |
How to install IMGW-PIB in Gladys
- In Gladys, open Integrations: IMGW-PIB appears in the catalog, next to the native integrations, with a community badge.
- Click Install. Gladys pulls the Docker image (
ghcr.io/guim31/gladys-imgw:1.0.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-imgw.
IMGW-PIB requires Gladys >=5.1.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
IMGW-PIB 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