SEPA (Scottish) data inclusion in the UK Environment Agency Flood Monitoring integration

Currently, the ‘UK Environment Agency Flood Monitoring’ integration only includes data from England.
As the docs page for the integration states; Ireland, Scotland, and Wales have their own agencies with their own corresponding data sources.

As our property was recently damaged by a flood by the river by our property, I’d like to get that data into Hass for various automation and alerts to give us warning in the event it happens again.

There are two ways to get this data, either directly from the sources or via an aggregator:

  • The source data for SEPA is in CSV format and would need to be collected at a set interval, stored, and parsed for use. This is likely a heavier process than using an existing API.
  • An aggregator for River Levels in the UK exists here: https://riverlevels.uk/pages/data-downloads, they provide an API which covers all of Scotland, Northern Ireland, England, and Wales. This is probably the better solution as it wouldn’t involve any re-inventing of the wheel.

I propose switching the current data source for the integration from England’s agency to this aggregator so it can be used across the UK.

I raised a feature issue with the aioeafm library hass makes use of for this integration also, but failing that I could likely develop a new library specifically for the riverlevels.uk API.

It looks like the riverlevels data only gives you max, min and average level for a day and not the current level.

The documentation (River Levels UK - river and sea level monitoring stations, flood alerts, flood warnings and flood forecasts for your local area) says “The download data is updated daily, so there is no point retrieving the same location data more than once a day”

I have just added this post with the details of how to get data the Scottish data into Home Assistant