Skip to content

A Home Assistant integration to fetch NSW dam level and capacity data from the WaterNSW WaterInsights API

Notifications You must be signed in to change notification settings

battlemoose/waternsw-waterinsights-ha

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WaterNSW WaterInsights for Home Assistant

Dam level sensor dashboard example

This Home Assistant component integrates NSW dam level and capacity data from the WaterNSW WaterInsights API as sensors in the Home Assistant platform.

Installation

The simplest method to install this integration is using HACS.

Manual installation can also be performed by:

  1. Copying the custom_components/waterinsights directory of this repository into the custom_components directory of your Home Assistant configuration
  2. Restarting Home Assistant

Usage

The waterinsights integration can currently only be configured via Home Assistant's YAML configuration.

To add dam level sensors:

  1. Obtain an API key/secret
    1. Visit https://api.nsw.gov.au/Product/Index/26
    2. CLick the blue Subscribe button
    3. Log in or create an account
    4. Create an app that subscribes to the WaterInsights from WaterNSW API
    5. Your API key and secret will be listed under the details page of your new app
  2. Find your dam ID(s)
    1. Visit https://waterinsights.waternsw.com.au/
    2. Search for a dam in the search box at the top of the page and click on a result in the dropdown that appears
    3. The number that appears to the left of the dam name in the search bar on the resulting page is the dam ID
    4. Repeat for any subsequent dams you also want to add sensors for
  3. Configure Home Assistant
    1. Create a new entry in your Home Assistant secrets.yaml file named water_insights_api_secret who's value is your API secret from step 1
    2. Add the following lines to your Home Assistant configuration.yaml. If the sensor key already exists, add the - platform: waterinsights element under the existing key.
      sensor:
        - 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"
      The name key is optional for each dam. If not specified, the name returned by the API will be used.
    3. Restart Home Assistant. Your new dam sensors should show up as entities in your Home Assistant instance.

About

A Home Assistant integration to fetch NSW dam level and capacity data from the WaterNSW WaterInsights API

Topics

Resources

Stars

Watchers

Forks

Languages