Home Assistant

Bring your Aotea battery into Home Assistant using its built-in RESTful integration. There's nothing to install: you create an API key, paste some YAML and restart.

Start with the steps below, then add whichever sensors you want. Each guide says which scope it needs. Using something other than Home Assistant? The API reference covers every endpoint a key can call.

GuideScopeYou get
Live databattery:liveCharge, battery, solar, grid and home power, every 30 seconds.
Historical databattery:historicalToday's energy totals and this half hour's wholesale price.
Prices & costspricing:readWhat today has cost and earned, and your daily fixed charge.
Forecastsbattery:historicalForecast price, solar and load for the next half hour.
  1. Step 1: Get a key and your battery id

    Follow getting started: create a key named Home Assistant with the scopes for the guides you'll follow, and find your battery id. Paste the id here too and every snippet in this guide uses it:

    Fills in every snippet in these docs. It stays in your browser.

  2. Step 2: Store your key

    Add the key to secrets.yaml in your Home Assistant config folder, with the word Bearer and a space before it. Every guide reads it from here.

    secrets.yaml
    aotea_api_key: "Bearer ak_your_key_here"
  3. Step 3: Add sensors and restart

    Pick a guide from the table above, paste its YAML into configuration.yaml and restart Home Assistant.

Good to know

  • Power is in kW, energy in kWh, prices in $/kWh.
  • Grid power is positive when importing and negative when exporting.
  • Each network can make 120 requests a minute. The guides poll every 30 seconds to 5 minutes, which stays well inside that.
  • The time-based guides assume your Home Assistant timezone is New Zealand (Settings → System → General).

Troubleshooting

ProblemFix
Sensors show unavailableCheck the Home Assistant logs for the request. A 401 means the key is wrong or revoked. A 403 means it's missing the scope that guide needs.
Sensors show unknownThe battery id is wrong, or the battery hasn't reported yet. Re-run the battery list to check the id.
secrets.yaml errorsThe value must include Bearer before the key, inside the quotes.
429 errorsToo many requests from your network. Raise scan_interval.