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.
| Guide | Scope | You get |
|---|---|---|
| Live data | battery:live | Charge, battery, solar, grid and home power, every 30 seconds. |
| Historical data | battery:historical | Today's energy totals and this half hour's wholesale price. |
| Prices & costs | pricing:read | What today has cost and earned, and your daily fixed charge. |
| Forecasts | battery:historical | Forecast price, solar and load for the next half hour. |
Step 1: Get a key and your battery id
Follow getting started: create a key named
Home Assistantwith 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.
Step 2: Store your key
Add the key to
secrets.yamlin your Home Assistant config folder, with the wordBearerand a space before it. Every guide reads it from here.secrets.yamlaotea_api_key: "Bearer ak_your_key_here"Step 3: Add sensors and restart
Pick a guide from the table above, paste its YAML into
configuration.yamland 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
| Problem | Fix |
|---|---|
| Sensors show unavailable | Check 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 unknown | The battery id is wrong, or the battery hasn't reported yet. Re-run the battery list to check the id. |
| secrets.yaml errors | The value must include Bearer before the key, inside the quotes. |
| 429 errors | Too many requests from your network. Raise scan_interval. |