NWS River Observation and Forecast Integration

I live in a flood plain and watch the NWS River Forecasts pretty intently when storms come through in the Fall and Winter… https://water.weather.gov/

The river data does not appear to appear in the NWS API, but is available in XML format returned by a REST Url … i.e. my favorite for the “pilw1” station: https://water.weather.gov/ahps2/hydrograph_to_xml.php?gage=pilw1&output=xml

I currently rely on a scheduled task written with C# that pulls this data hourly and sends me an email if the the river forecast shows above a certain level… with a critical notification if the current river status is above a different threshold.

Having “Zero” experience with Python, I was hoping I could talk someone else into writing this integration since I think my Home Assistant instance would be the ideal place to configure automations around flood warnings. I don’t even know where to start for handling arrays of data in XML using Python…the XML data includes an array of “observed” data with timestamp, and an array of “forecast” data with timestamp.

Did you ever get anywhere with this? I would also be interested in the same feature.

I’ve been using an RSS reader/parser with poor results as a stop gap.

I did some quick work that ended up easier than expected. Created a .NET Core 6 application that will return some consolidated JSON formatted data from the NWS XML feed. I’ve successfully tested it on a handful of random station ids across the country.

It’s published as a Linux x86 Docker on dockerhub at: Docker Hub

Next I’d like to figure out if I can build this for hosting on supervised home assistant. For now I just have it running as a docker container on my Unraid server and it may stay like that for a while.