Environment Agency Flood smart home integration, free and open source

River levels and flood warnings in England, from the Environment Agency.
Brings the river, tidal and groundwater levels of England (about 4,000 stations: the Thames, the Severn, the Trent, the coast…) and the flood warnings in force around your house into Gladys, from the real-time flood-monitoring API of the Environment Agency. No account, no key.
This is 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: sign up to the free Environment Agency flood warnings, check Check for flooding or call Floodline on 0345 988 1188; call 999 if lives are at risk. This integration is not affiliated with the Environment Agency.
What you get
- One device per station you follow: the water level in metres, its state compared with the typical range of the station (low, normal, high), the highest recent level, the flow in m³/s when the station measures it, and the date of the last reading.
- A "Flood alerts" device for the area around your house: the level of the most severe warning in force (none, flood alert, flood warning, severe flood warning), the number of warnings in force and the latest one, as text.
- 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.
- Four scene triggers: a flood warning is issued or raised, a flood warning is lifted, the state of a station changes (low, normal, high), a reference level is crossed (typical range, highest recent level, record).
- A dashboard widget: the warnings in force around your house, then your stations, their level, its trend (rising, steady, falling) and their state.
- A "Find stations" button that lists the stations around your house, by name, river or town, or by reference, with their current level.
Requirements
- Gladys Assistant 5.1.0 or later.
- Internet access from Gladys: the integration reads
environment.data.gov.uk. - For the flood warnings and "Stations 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 choose the nearest stations and flood areas: never sent to the Environment Agency, never stored nor logged.
- England only: Wales, Scotland and Northern Ireland have their own services.
Configuration
Settings
| Setting | What it does |
|---|---|
| Stations | Station references or names, separated by commas: 3400TH, Bewdley, E71539. The address of a station page of "Check for flooding" also works. |
| Stations around my house | Also follows the 3 nearest stations that send readings, within 10, 20 or 50 km of your house. |
| Flood warnings around my house | Creates the "Flood alerts" device, for the flood areas whose centre is within 5, 10 (default), 20 or 50 km of your house. "No" removes it from the discovered devices. |
| Refresh interval | 15, 20 or 30 minutes. One request covers every station, one the flood warnings. |
| Language of the feature names | Names of the features of new devices (Water level, Flow…), and language of the texts ("Last reading", "Latest warning") and of the scene variables. |
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 (10 km, or the distance chosen), or type:
- a station name:
Kingston,Bewdley(case and accents are ignored); - a river or a town:
Severn,Shrewsbury(the 10 nearest, or the first 10 by river); - both:
Thames Windsor; - a station reference:
3400TH, or the address of its "Check for flooding" page.
Each line gives the reference, the name, the river and town, the distance from your house and the current level, or "no recent reading". Copy the references into "Stations", then save.
Devices
Stations
| Feature | Type in Gladys | Value |
|---|---|---|
| Water level | Liquid depth (m) | The level of the station, in metres (see below). |
| Water level state (typical range) | Liquid level state | Low below the typical range of the station, High above it, Normal within. |
| Highest recent level | Liquid depth (m) | The highest level of the last years, a reference for the history chart. |
| Flow (m³/s) | Water flow | In m³/s (Gladys has no m³/s unit: the name says it), when the station measures it. |
| Last reading | Text | Date of the last reading, or "No new reading since…". |
A feature only exists when the station provides it. The water level is not a depth: for a
river it is the stage above the gauge datum of the station (mASD), for tidal and groundwater
stations a level above Ordnance Datum (mAOD, sea level): the LEVEL_DATUM parameter of the
device says which. Compare it with the typical range of the same station (visible on its "Check
for flooding" page), not with another station. The device parameters hold the station
reference, its RLOI id (the number of its "Check for flooding" page), its river and its town.
The water level and the flow are numeric features: Gladys scenes can already compare them with any value of your own ("Water level above 4.8 m").
Flood alerts
| Feature | Type in Gladys | Value |
|---|---|---|
| Flood warning level | Risk level | 0 none, 1 flood alert, 2 flood warning, 3 severe flood warning: the most severe in force. |
| Warnings and alerts in force | Counter | The flood alerts and warnings in force around your house. |
| Latest warning | Text | "Flood warning: Lyme Brook at Newcastle under Lyme (23/10, 13:41)", or none in force. |
The Environment Agency issues three levels: flood alert (flooding is possible, be prepared), flood warning (flooding is expected, act now) and severe flood warning (danger to life). A warning is "around your house" when the centre of its flood area is within the distance chosen: a large area can cover your house with a centre further away, choose 20 km if in doubt.
Dashboard widget
Add the England floods widget to a dashboard.
- Without setting: a heading with the most severe warning in force, one line per warning around your house (4 at most, or "None in force"), then one line per followed station with its level and trend, coloured by its state: blue low, green normal, red high, grey without a typical range or without a recent reading.
- With a station chosen: its live level and flow, then its state, highest recent level, trend and last reading, and a link to its "Check for flooding" page.
- With the flood alerts chosen: every warning in force around your house.
Scene triggers
| Trigger | Filters | Variables |
|---|---|---|
| Flood warning issued or raised | Level (severe, warning, alert) | Level and previous level (code and words), area code and name, river or sea, county, message, issued at |
| Flood warning lifted | Level it had | Level (code and words), area code and name, river or sea, county |
| Water level state changes | Station, new state (low, normal, high) | Station name, river, water level, state, previous state (code and words) |
| Reference level crossed | Station, level, direction (rising, falling) | Station name, river, water level, level code and words, its value, direction |
"Issued or raised" fires for a new warning around your house, and for a warning that becomes more severe (a flood alert turned into a flood warning). "Lifted" fires when a warning is no longer in force, or is missing from the feed at two readings in a row (a glitch of the feed lifts nothing); a change of the distance fires nothing. The reference levels offered are the bottom and top of the typical range, the highest recent level and the highest level on record; a station only fires the ones it has. The fall counts once the level is 2 cm below the reference, and only then can a new rise count: a level wobbling around it fires once.
Triggers only fire for a device you created (the station, or "Flood alerts"), on fresh data, and not after a restart longer than a day. The first reading after the installation fires nothing: the warnings already in force are shown by the device and the widget.
Scene examples
- Flood warning at home: "Flood warning issued or raised", levels warning and severe → send a message "{{severity_name}}: {{area_name}}. {{message}}", switch on the hall lights, and switch off the cellar sockets.
- All clear: "Flood warning lifted" → message "Lifted: {{area_name}}".
- The river rises: "Water level state changes", your station, new state High → notify the family to move the car.
- New record: "Reference level crossed", level "Highest recent level", rising → message "{{station_name}}: {{height}} m, above {{mark_name}}".
Data sources, licence and quotas
- Data: Environment Agency, real-time flood-monitoring API, licence Open Government Licence v3.0 ("Contains public sector information licensed under the Open Government Licence v3.0"; the widget names the source).
- Readings are near real time and unchecked: they can be corrected later. Stations send every 15 minutes, some less often; the warnings are updated every 15 minutes.
- No account, no key, no documented quota. The integration stays light: one request per refresh for the latest readings of every followed station and one for the flood warnings in force in England (15 minutes by default, never faster), the details of each station once a day, the station list (about 4 MB) and the flood area list (about 3 MB) once a week and only when needed.
Troubleshooting
- "Unknown station": check the spelling or use "Find stations", then copy the reference.
- "The Environment Agency does not answer": the service or your Internet access is down; the values come back by themselves.
- "Around my house" adds nothing, or no "Flood alerts" device: give your house a location (Settings, Houses), or choose a larger distance.
- No state feature: the station has no typical range. Tidal stations never have one here: the tide crosses it twice a day.
- "No new reading since…": the station sends late or not at all; some send their values in batches, a few hours late.
- A warning I receive is missing: its flood area has its centre further away than the distance chosen: choose a larger one.
- 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.
- England only, and only what the Environment Agency publishes: no forecasts, no surface water or groundwater flood warnings issued by other bodies.
- The distance of a flood warning is measured to the centre of its area, not to its outline.
- 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 Environment Agency Flood asks for in its configuration screen in Gladys.
| Setting | Type | Required | Description |
|---|---|---|---|
| Your stations and flood warnings | section | No | Follow the water levels of the Environment Agency stations in England, by reference, name or near your house, and the flood warnings around your house. "Find stations" below lists them. Save, then create the devices in the Discover tab. |
| Sources and limits | section | No | Data: Environment Agency real-time flood-monitoring API, Open Government Licence v3.0, read without an account. England only. Not a flood warning service: rely on the official warnings (Floodline 0345 988 1188). Not affiliated with the Environment Agency. |
| Stations | string | No | Station references or names, separated by commas. |
| Stations 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. |
| Flood warnings around my house | select | No | A "Flood alerts" device follows the flood alerts and warnings whose area has its centre within this distance of your house. |
| Refresh interval | select | No | Stations send a reading every 15 minutes and the warnings are updated every 15 minutes. 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 Environment Agency Flood in Gladys
- In Gladys, open Integrations: Environment Agency Flood appears in the catalog, next to the native integrations, with a community badge.
- Click Install. Gladys pulls the Docker image (
ghcr.io/guim31/gladys-ea-flood: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-ea-flood.
Environment Agency Flood 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
Environment Agency Flood 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