Proposed changes to Environment Agency Flood Gauges integration

I’m proposing to make some changes to the UK Environment Agency Flood Monitoring integration and wanted to get the views of @Jc2k (as the integration owner) and the wider community.

I’ve been using this integration and find it very helpful as a guide to when my town is likely to flood, so I can adjust my route when walking my daughter to/from school and also have configured a derivative helper to show the rate that the river is rising/falling which allows me to make some rough calculations about when the river is likely to flood.

Recent changes to the way that the EA predict flooding has been less than helpful, so I’m looking to push a few more features that would extend the integration and add some new functionality.
Specifically:

  1. Enhancement to the integration configuration/onboarding to make use of the user configured ‘Home’ latitude and longitude co-ordinates within Home Assistant and allow the user to search for monitoring stations with ‘x’ kilometres from those co-ordinates (where ‘x’ is a value entered in the integration configuration).

  2. Add the Lat/Long values as state attributes - this would allow adding the sensor to a map in the future.

  3. Change the labelling of newly configured sensors (and the selection list on the configuration screen) to append the River Name attribute (where available, default to how it currently shows).

  4. Allow selecting rainfall monitoring stations as well as flood monitoring stations. This is quite useful data as, combined with a derivative it can be used to determine potential future flooding.

The first change also requires an enhancement to the underlying aioeafm library to extend the get_stations method to include lat, long and dist as parameters. I’ve already made those changes on a branch and (pending testing them locally) I’ll be raising a PR in the future to merge those.

I’m happy to do the heavy lifting here and make the changes to the integration and consider any more that anybody else would like to see, if people think it’s worthwhile?

This all sounds very good. I use this integration. I look forward to seeing the results. Good luck.

GitHub or discord is the best place to reach me. Time constrained so tend not to check here.

Happy to look at any changes to aioeafm that are backwards compatible.

Very interested in your setup for predicting floods.

For (3), can you look at the “new” entity naming and whether any of it applies to us while you are in there - Adopting a new way to name entities | Home Assistant Developer Docs

For (2), is want to see whether there was a standard in HA for handling this information. It won’t be quick but maybe an arch issue if there isn’t a standard way. Probably do this change last for that reason.

If you can make a nice UX for (1) within the confines of config flow im very excited.

1 Like

Thanks, I’ll reach out on GitHub once I have something more to share on progress with the integration. I’m running through the tests for aioeafm at the moment (or will be once I can get my replacement Mac to place nicely with Python3 again…). The changes I’ve made so far are all backwards compatible.

Hi all,

Just a quick question on whether there have been or are planned any more developments with this integration?

Monitoring the current water levels is brilliant (thank you!) but it looks as though you can pull the following information from Environment Agency via their API as well:

Flood warnings (severity level)
Water Flow ie steady, rising, falling
Water State ie low, high
5 day flood forecast

https://environment.data.gov.uk/flood-monitoring/doc/reference

Any thoughts?