This Home Assistant component integrates NSW dam level and capacity data from the WaterNSW WaterInsights API as sensors in the Home Assistant platform.
The simplest method to install this integration is using HACS.
Manual installation can also be performed by:
- Copying the
custom_components/waterinsights
directory of this repository into thecustom_components
directory of your Home Assistant configuration - Restarting Home Assistant
The waterinsights
integration can currently only be configured via Home Assistant's YAML configuration.
To add dam level sensors:
- Obtain an API key/secret
- Visit https://api.nsw.gov.au/Product/Index/26
- CLick the blue Subscribe button
- Log in or create an account
- Create an app that subscribes to the WaterInsights from WaterNSW API
- Your API key and secret will be listed under the details page of your new app
- Find your dam ID(s)
- Visit https://waterinsights.waternsw.com.au/
- Search for a dam in the search box at the top of the page and click on a result in the dropdown that appears
- The number that appears to the left of the dam name in the search bar on the resulting page is the dam ID
- Repeat for any subsequent dams you also want to add sensors for
- Configure Home Assistant
- Create a new entry in your Home Assistant
secrets.yaml
file namedwater_insights_api_secret
who's value is your API secret from step 1 - Add the following lines to your Home Assistant
configuration.yaml
. If thesensor
key already exists, add the- platform: waterinsights
element under the existing key.Thesensor: - platform: waterinsights api_key: /Insert your API key from step 1/ api_secret: !secret water_insights_api_secret dams: - dam_id: /Insert a dam ID/ name: /Insert an optional name/ # For example - dam_id: "212243" name: "Warragamba Dam" - dam_id: "412106"
name
key is optional for each dam. If not specified, the name returned by the API will be used. - Restart Home Assistant. Your new dam sensors should show up as entities in your Home Assistant instance.
- Create a new entry in your Home Assistant