New HACS component: USGS stream sensors

I used to use a REST sensor for this, created an integration (with the help of Claude but thoroughly tested) if anyone else finds it useful

USGS Streamflow for Home Assistant

hacs_badge
GitHub Release
HA Version

A Home Assistant integration that pulls real-time streamflow data from the USGS National Water Information System (NWIS) for any active stream gauge in the United States.

Features

  • Search by name or site number — find any active USGS stream gauge via the setup wizard
  • Up to 3 sensors per gauge — Gauge Height (ft), Discharge (ft³/s), and Water Temperature (°C) where available
  • Station Status sensor — shows Active or Offline so seasonal/winter shutdowns are handled cleanly
  • Proper unavailability handling — sensors mark as Unavailable (not Unknown) when a gauge is seasonally decommissioned
  • Polled every 15 minutes — matches USGS data update frequency
  • Multiple gauges — add as many stations as you want, each becomes its own device

Requirements

  • Home Assistant 2026.3 or newer
  • HACS installed

Installation

Via HACS (recommended)

  1. Open HACS in your Home Assistant instance
  2. Click the three-dot menu → Custom repositories
  3. Add https://github.com/yieldhog/usgs_streamflow as an Integration
  4. Find USGS Streamflow in HACS and click Download
  5. Restart Home Assistant

Manual

  1. Download the latest release zip from the releases page
  2. Extract and copy the custom_components/usgs_streamflow folder into your HA config/custom_components/ directory
  3. Restart Home Assistant

Setup

  1. Go to Settings → Devices & Services → Add Integration
  2. Search for USGS Streamflow
  3. Enter a stream or station name (e.g. Bear Creek) and a two-letter state code (e.g. CO)
  4. Pick your gauge from the results list
  5. Repeat to add additional gauges

Sensors

Each configured gauge creates a device with up to 4 entities:

Entity Unit Notes
Gauge Height ft Water level above the gauge datum
Discharge ft³/s Volumetric flow rate (CFS)
Water Temperature °C Not available at all gauges
Station Status Active or Offline

The Station Status entity stays active even when the gauge is offline for the season, and includes an offline_reason attribute explaining why.

Measurement sensors for parameters a gauge never reports (e.g., Water Temperature at a gauge with no thermistor) will show as Unavailable after the first successful data fetch.

Data Source

All data comes from the USGS NWIS Instantaneous Values API, which is free and requires no API key.

Contributing

Issues and pull requests welcome at github.com/yieldhog/usgs_streamflow.

2 Likes

Thanks for this, I just started pulling the same four USGS params for a Catawba-Wateree (NC) project and should have known to search here first.

It seems like the legacy waterservices.usgs.gov NWIS endpoints are on the way out and USGS is steering everyone to the modernized api.waterdata.usgs.gov OGC API (daily / instantaneous collections). I migrated my puller over recently and it's returning identical numbers to the old endpoint so far. If you want to future-proof this against the decommission I am happy to share exactly what the new request shapes look like.

On top of raw discharge I compute % of long-term average + a short trend and map it to a normalized "stage" so the same number reads as drought / low-flow at the bottom and flood / high-flow at the top, on any gauge. I drive some local water-restriction automations off it in Charlotte (currently stage 2 - residential watering based on odd/even address, no running ornamental water features that dont support aquatic life, etc), but the classification math itself is gauge-agnostic. Would a stats/classification layer that sits on top of (or beside) your sensors be something you would want folded in or would you rather keep this one lean and let it be a separate companion? I would much rather collaborate than fork.

I am in no way an expert in this, just a pet project since I have control of my home sprinkler system. I was halfway expecting to see landscapers, building owners, etc to also be tying into these public reports... I wonder how they do it.

Either way, nice work.

1 Like

Hi, thanks very much for reaching out and the comments, especially around decommissioning of the old API (looks like its good through 1Q27, so I'll have a look and convert over when I have some time).

Tonight I added some functionality in a beta release on HACS (1.1.0b1), including allowing changing the polling interval (minimum of 15 minutes) and it should now pull in every sensor for a specific station, unless you choose not to bring them in. I don't use them for my usage, but they're interesting if someone wants (like water ph, water temp, turbidity).

I now see that USGS provides below ground types (sewer, ground water) that I can incorporate, but they're 15 digit codes, so I'll need to modify some code to incorporate.

For automations/tracking of stats and trends, I didn't want to overly complicate the code, since Home Assistant handles stats very well, I thought it would be best to allow users to setup whatever they want from the raw data. Would be interested in seeing how you're doing it, I'm also in a drought restricted region (Colorado).

I included some template examples to monitor outlier activity, rate of increase, rising/falling above trend etc. you can find here: usgs_streamflow/examples/usgs_streamflow_examples.yaml at 318b789a6bf2d449de48626e4dbc844a14fc96e0 · yieldhog/usgs_streamflow · GitHub

Happy to incorporate or collaborate, feel free to PR.

Updated the code this weekend to add new features, including "trends" in flow rates and gauge depths, as well as moving over to the new modern API, as the legacy system will be decommissioned in 1Q27.

Appears to work well, but, still in beta testing on HACS and can be found in the beta branch on github. GitHub - yieldhog/usgs_streamflow at beta · GitHub, will merge into main in a week or two.