API reference
Every endpoint an Aotea Energy API key can call. The Home Assistant guides use a few of these; anything else that can make an HTTP request, like Node-RED or a script, can use the rest.
The same endpoints are described in an OpenAPI document, ready to import into Postman, Insomnia or a client generator.
Authentication
Create a key in the Aotea app under API keys (see the introduction), then send it as a Bearer token to https://api.aoteaenergy.com on every request:
Authorization: Bearer ak_your_key_hereKeys only read data, and only for batteries your account can see. Each endpoint below names the scope it needs:
| Scope | Allows |
|---|---|
battery:live | Latest readings, and live updates over the WebSocket. |
battery:historical | Historical time series, fine-grained telemetry and forecasts. |
pricing:read | Cost summaries, tariff rates and the daily fixed charge. |
Requests
- Time ranges take
startandendasYYYY-MM-DD HH:MM:SS ZONE, whereZONEis an IANA name likePacific/Auckland(the default). Responses use the same zone. URL-encode the spaces. - Power is in kW, energy in kWh, prices in $/kWh, daily charges in $/day. Grid power is positive when importing.
- Each IP address can make 120 requests a minute. Responses carry
x-ratelimit-limit,x-ratelimit-remainingandx-ratelimit-reset. - Errors return a JSON body with one
errormessage.401means the key is missing, wrong, expired or revoked;403that it lacks the scope or can't see that battery;429that you're over the limit.
{ "error": "Battery doesnt exist or User is not an owner/user of the battery" }Choose a battery, or paste its id, to fill it into every example on this page:
Fills in every snippet in these docs. It stays in your browser.
Endpoints
| Endpoint | Scope |
|---|---|
| get/api/v1.0.1/battery/all | battery:live |
| get/api/v1.0.1/battery/data/{id} | battery:historical |
| get/api/v1.0.1/battery/forecast/{id} | battery:historical |
| get/api/v1.0.1/battery/grid-health/{id} | battery:historical |
| get/api/v1.0.1/battery/period/{id} | battery:historical |
| get/api/v1.0.1/battery/telemetry/{id} | battery:historical |
| get/api/v1.0.1/billing/daily-fixed-charge/{id} | pricing:read |
| get/api/v1.0.1/billing/data/{id} | pricing:read |
| get/api/v1.0.1/billing/period/{id} | pricing:read |
| get/api/v1/battery/all | Any |
| get/api/v1/battery/data/{id} | battery:historical |
| get/api/v1/battery/last/{id} | battery:live |
Battery
/api/v1.0.1/battery/allRetrieves a detailed list of all batteries the authenticated user can access
Needs the battery:live scope.
This version of the endpoint returns each battery's details, including the user's battery permission and installation-specific customer type.
Every caller only gets the pricing and grid frequency/voltage entries of each record's metadata.
curl -H "Authorization: Bearer ak_your_key_here" \
https://api.aoteaenergy.com/api/v1.0.1/battery/all200 · Battery details for all batteries the user can access. An array of objects with:
| Field | Type | Description |
|---|---|---|
| billing_info | BillingInfoResponse | null | |
| id | string (uuid) | The battery's unique identifier. |
| last_record | string | null | The last record for the battery if available. pulls from the battery_data_latest materialzied view/cagg |
| name | string | The battery's name. |
| role | Role | the users role for the battery. |
| solar_present | boolean | Whether the battery has solar, as its settings row reports it (reported_hardware.solar_present). False when the battery has never reported. |
| system_type | SystemTypeEnum | The battery's system type. e.g. no_solar, default, 'no_grid' etc. |
| trading_type | string | Whether the battery is trading with us. e.g. 'wholesale' or 'other'. |
401 Failed authentication · 500 Database query failed
/api/v1.0.1/battery/data/{id}Retrieves historical time-series data for a battery
Needs the battery:historical scope.
This endpoint fetches aggregated data (solar, grid, home, battery usage, and price) for a specified time range and interval count.
There are occasional gotchas with abnormal interval to time period ratios. Also, if the version isn't correct, the data call will not work.
curl -G -H "Authorization: Bearer ak_your_key_here" \
https://api.aoteaenergy.com/api/v1.0.1/battery/data/YOUR_BATTERY_ID \
--data-urlencode "start=2026-10-22 00:00:00 Pacific/Auckland" \
--data-urlencode "end=2026-10-23 00:00:00 Pacific/Auckland" \
--data-urlencode "intervals=48"| Parameter | In | Type | Description |
|---|---|---|---|
| start | query | string | The start of the time range (e.g., "YYYY-MM-DD HH:MM:SS"). |
| end | query | string | The end of the time range (e.g., "YYYY-MM-DD HH:MM:SS"). |
| intervals | query | integer | The number of intervals to return. |
| id | path | string (uuid) |
200 · Array of requested historical data for X time period. An object with:
| Field | Type | Description |
|---|---|---|
| battery_data | number[] | |
| daily_charges_data | (number | null)[] | |
| grid_data | number[] | |
| home_data | number[] | |
| net_profit_loss_data | (number | null)[] | |
| net_tariff_profit_loss_data | (number | null)[] | |
| price_data | (number | null)[] | |
| soc_data | number[] | |
| solar_data | number[] | |
| tariff_export_rates_data | (number | null)[] | |
| tariff_import_rates_data | (number | null)[] | |
| time_data | string[] | |
| trading_periods | number[] |
400 Invalid input data · 401 Failed authentication · 403 Battery doesnt exist or User is not an owner/user of the battery · 500 Historical query failed
/api/v1.0.1/battery/forecast/{id}Retrieves a battery's load, solar and price forecasts
Needs the battery:historical scope.
Takes the same parameters as /battery/data/{id} and returns the forecasts on the same buckets, in the same timezone and time format, so the two responses can share a time axis. The load and solar forecast is the battery's own; the price forecast is the latest PRSS run for its GXP, falling back to PRSL, with the tariff import/export rates for those periods. Only buckets inside the window that a forecast covers are returned; each series is null where its forecast doesn't reach.
curl -G -H "Authorization: Bearer ak_your_key_here" \
https://api.aoteaenergy.com/api/v1.0.1/battery/forecast/YOUR_BATTERY_ID \
--data-urlencode "start=2026-10-22 00:00:00 Pacific/Auckland" \
--data-urlencode "end=2026-10-23 00:00:00 Pacific/Auckland" \
--data-urlencode "intervals=48"| Parameter | In | Type | Description |
|---|---|---|---|
| start | query | string | The start of the time range (e.g., "YYYY-MM-DD HH:MM:SS"). |
| end | query | string | The end of the time range (e.g., "YYYY-MM-DD HH:MM:SS"). |
| intervals | query | integer | The number of intervals to return. |
| id | path | string (uuid) |
200 · The battery's load, solar and price forecasts for the window. An object with:
| Field | Type | Description |
|---|---|---|
| generated_at | string | null | When the battery produced its load/solar forecast, or null when it has none. |
| load_forecast | (number | null)[] | Forecast household load, kW. |
| price_forecast | (number | null)[] | Forecast spot price at the battery's GXP, $/kWh. The latest PRSS run, falling back to the latest PRSL run. |
| solar_forecast | (number | null)[] | Forecast solar generation, kW. |
| tariff_export_forecast | (number | null)[] | Tariff export rate, $/kWh, as a magnitude. |
| tariff_import_forecast | (number | null)[] | Tariff import rate, $/kWh. |
| time_data | string[] |
400 Invalid input data · 401 Failed authentication · 403 Battery doesnt exist or User is not an owner/user of the battery · 500 Forecast query failed
/api/v1.0.1/battery/grid-health/{id}Retrieves the grid at a battery's site over a period: the frequency and voltage its inverter read, and how long it was off grid
Needs the battery:historical scope.
Takes the same start, end and bucket_minutes as /battery/period/{id}, with the same validation and buckets, so the app can ask both for one range. The range runs up to the half hour in progress.
Each half hour gets a status from its own readings: off_grid when the inverter reported itself off grid or its grid relay open, frequency_excursion when at least 1% of its frequency readings were outside 49.5 to 50.5 Hz, voltage_low or voltage_high when its lowest or highest phase averaged outside 207–253 V (230 V ± 10%), normal otherwise, and no_data when the inverter sent no grid readings. A bucket and the summary show the worst of their half hours, and count how many had each status.
curl -G -H "Authorization: Bearer ak_your_key_here" \
https://api.aoteaenergy.com/api/v1.0.1/battery/grid-health/YOUR_BATTERY_ID \
--data-urlencode "start=2026-10-22 00:00:00 Pacific/Auckland" \
--data-urlencode "end=2026-10-23 00:00:00 Pacific/Auckland"| Parameter | In | Type | Description |
|---|---|---|---|
| id | path | string (uuid) | The battery id to look at the grid for |
| start | query | string | The start of the time range (e.g., "YYYY-MM-DD HH:MM:SS ZONE"), rounded down to the half hour. |
| end | query | string | The end of the time range (e.g., "YYYY-MM-DD HH:MM:SS ZONE"), rounded down to the half hour. Anything after the half hour in progress is left out. |
| bucket_minutesoptional | query | integer | null | How many minutes each bucket covers: 30, 60, 90, 120, 180, 240, 360, 480, 720 or 1440, at most 1,500 buckets. Leave it out to have the server choose, as /battery/period does. |
200 · The grid at the battery's site over the requested period. An object with:
| Field | Type | Description |
|---|---|---|
| battery_id | string (uuid) | The battery id. |
| bucket_minutes | integer | How many minutes each bucket covers, whether requested or chosen. |
| buckets | GridHealthTotals[] | The range split into buckets, in time order, up to the half hour in progress. A bucket with no readings is still listed, as no_data. |
| limits | GridLimits | The limits the statuses are judged against, for drawing them. |
| summary | GridHealthTotals | The whole range. |
400 Invalid input data · 401 Failed authentication · 403 Battery doesnt exist or User is not an owner/user of the battery · 500 Grid health query failed
/api/v1.0.1/battery/period/{id}Retrieves a battery's energy and grid prices over a period, added up from its trading periods
Needs the battery:historical scope.
Takes start and end in the same format as /battery/data/{id}, but stricter: both are rounded down to the half hour, start must be before end, and the range must hold at least one whole half hour. It works the range out one trading period at a time before adding it up: over the whole range (summary) and in buckets bucket_minutes wide (buckets), which start on those clock times in the range's timezone. Leave bucket_minutes out to have the server choose it; a requested width may split the range into at most 1,500 buckets.
Each of those gives the kWh through the home, solar, battery and grid (energy, with each direction of the battery and grid on its own), and for import and for export the market's average price, the cheapest and dearest trading period with its time, what the grid kWh cost or earned, and the price per kWh that works out to. A bucket's figures come from the half hours inside it, never from its average. Prices are the wholesale price at the installation's GXP plus the network rate, in $/kWh before GST and the levy.
The range is trimmed to whole trading periods that have finished, and can be at most 366 days. A trading period with no wholesale price is left out of the price and money figures entirely, network rate included, and shows in priced_periods.
The kWh are the battery's own readings, not the ICP meter's, and unpriced trading periods carry no network charge here, so the money figures won't match /billing/data exactly.
curl -G -H "Authorization: Bearer ak_your_key_here" \
https://api.aoteaenergy.com/api/v1.0.1/battery/period/YOUR_BATTERY_ID \
--data-urlencode "start=2026-10-22 00:00:00 Pacific/Auckland" \
--data-urlencode "end=2026-10-23 00:00:00 Pacific/Auckland"| Parameter | In | Type | Description |
|---|---|---|---|
| id | path | string (uuid) | The battery id to add the period up for |
| start | query | string | The start of the time range (e.g., "YYYY-MM-DD HH:MM:SS ZONE"), rounded down to the half hour. |
| end | query | string | The end of the time range (e.g., "YYYY-MM-DD HH:MM:SS ZONE"), rounded down to the half hour. Trading periods still in progress are left out. |
| bucket_minutesoptional | query | integer | null | How many minutes each bucket covers: 30, 60, 90, 120, 180, 240, 360, 480, 720 or 1440. Buckets start on those clock times in the range's timezone, and the range may split into at most 1,500 of them (half hourly over 30 days). Leave it out to get the finest of 30 minutes, 1 hour, 3 hours, 6 hours or a day that covers the range in at most 60 buckets. |
200 · The battery's energy and prices for the requested period. An object with:
| Field | Type | Description |
|---|---|---|
| battery_id | string (uuid) | The battery id. |
| bucket_minutes | integer | How many minutes each bucket covers, whether requested or chosen. |
| buckets | PeriodTotals[] | The range split into buckets, in time order. A bucket at either end of the range can be cut short; periods says how many half hours it holds. |
| summary | PeriodTotals | The whole range. |
| timing_saving | number | null | What using the grid when the customer did made, in $, against moving the same kWh at the range's average prices: each kWh imported counts the average import price less what it cost, and each kWh exported what it earned less the average export price. Negative when the timing cost money. null when no trading period in the range has a price. |
400 Invalid input data · 401 Failed authentication · 403 Battery doesnt exist or User is not an owner/user of the battery · 500 Period query failed
/api/v1.0.1/battery/telemetry/{id}Retrieves a battery's power and SOC in fine-grained buckets
Needs the battery:historical scope.
Takes the same parameters as /battery/data/{id}, with the same date validation, and returns the range in the same time format. Unlike /battery/data, buckets aren't rolled up to 30-minute trading periods first, and there are no price, tariff or billing series. Intervals the battery sent nothing in are null.
intervals is optional. Given, it splits the range into that many equal buckets: at most 200, each at least 5 seconds. Left out, the server picks the finest standard step (5 seconds up to a week) that fits the range in at most 200 buckets, starting on a whole step. bucket_seconds in the response says which.
curl -G -H "Authorization: Bearer ak_your_key_here" \
https://api.aoteaenergy.com/api/v1.0.1/battery/telemetry/YOUR_BATTERY_ID \
--data-urlencode "start=2026-10-22 00:00:00 Pacific/Auckland" \
--data-urlencode "end=2026-10-23 00:00:00 Pacific/Auckland" \
--data-urlencode "intervals=48"| Parameter | In | Type | Description |
|---|---|---|---|
| start | query | string | The start of the time range (e.g., "YYYY-MM-DD HH:MM:SS ZONE"). |
| end | query | string | The end of the time range (e.g., "YYYY-MM-DD HH:MM:SS ZONE"). |
| intervalsoptional | query | integer | null | The number of equal intervals to split the range into, at most 200, each at least 5 seconds long. Leave it out to get the finest of 5s, 10s, 15s, 30s, 1m, 2m, 5m, 10m, 15m, 30m, 1h, 2h, 3h, 6h, 12h, 1d or 1w that fits the range in at most 200 intervals, starting on a whole step. |
| id | path | string (uuid) |
200 · The battery's telemetry for the requested period. An object with:
| Field | Type | Description |
|---|---|---|
| battery_data | (number | null)[] | Average battery flow, kW, with the same sign as /battery/data's battery_data. |
| bucket_seconds | number | The length of each interval in seconds, whether requested or chosen. |
| grid_data | (number | null)[] | Average grid flow, kW, with the same sign as /battery/data's grid_data. |
| home_data | (number | null)[] | Average household load, kW. |
| soc_data | (number | null)[] | The last state of charge reported in the interval, %. null when no packet in the interval carried one. |
| solar_data | (number | null)[] | Average solar generation, kW. |
| time_data | string[] | The start of each interval, in the request's timezone and the same format as /battery/data (YYYY-MM-DD HH:MM:SS ZONE). |
400 Invalid input data · 401 Failed authentication · 403 Battery doesnt exist or User is not an owner/user of the battery · 500 Telemetry query failed
/api/v1/battery/allRetrieves a list of all batteries the authenticated user can access
Any API key, whatever its scopes.
The response includes each battery's ID and its assigned name.
curl -H "Authorization: Bearer ak_your_key_here" \
https://api.aoteaenergy.com/api/v1/battery/all200 · Array of requested battery id's and names that a user owns/can access. An object with:
| Field | Type | Description |
|---|---|---|
| data | [string (uuid), string][] | A vector of tuples, where each tuple contains a battery's Uuid and name. |
401 Failed authentication · 500 battery_user & battery_owner query failed
/api/v1/battery/data/{id}Retrieves historical time-series data for a battery
Needs the battery:historical scope.
This endpoint fetches aggregated data (solar, grid, home, battery usage, tariff rates, and wholesale price) for a specified time range and interval count.
There are occasional gotchas with abnormal interval to time period ratios.
curl -G -H "Authorization: Bearer ak_your_key_here" \
https://api.aoteaenergy.com/api/v1/battery/data/YOUR_BATTERY_ID \
--data-urlencode "start=2026-10-22 00:00:00 Pacific/Auckland" \
--data-urlencode "end=2026-10-23 00:00:00 Pacific/Auckland" \
--data-urlencode "intervals=48"| Parameter | In | Type | Description |
|---|---|---|---|
| start | query | string | The start of the time range (e.g., "YYYY-MM-DD HH:MM:SS"). |
| end | query | string | The end of the time range (e.g., "YYYY-MM-DD HH:MM:SS"). |
| intervals | query | integer | The number of intervals to return. |
| id | path | string (uuid) |
200 · Array of requested historical data for X time period. An object with:
| Field | Type | Description |
|---|---|---|
| battery_data | number[] | |
| daily_charges_data | (number | null)[] | |
| grid_data | number[] | |
| home_data | number[] | |
| net_profit_loss_data | (number | null)[] | |
| net_tariff_profit_loss_data | (number | null)[] | |
| price_data | (number | null)[] | |
| soc_data | number[] | |
| solar_data | number[] | |
| tariff_export_rates_data | (number | null)[] | |
| tariff_import_rates_data | (number | null)[] | |
| time_data | string[] | |
| trading_periods | number[] |
400 Invalid input data · 401 Failed authentication · 403 Battery doesnt exist or User is not an owner/user of the battery · 500 Historical query failed
/api/v1/battery/last/{id}Retrieves the most recent data point recorded for a specific battery
Needs the battery:live scope.
Every caller only gets the pricing and grid frequency/voltage entries of the record's metadata.
curl -H "Authorization: Bearer ak_your_key_here" \
https://api.aoteaenergy.com/api/v1/battery/last/YOUR_BATTERY_ID| Parameter | In | Type | Description |
|---|---|---|---|
| limitoptional | query | integer | null | The maximum number of data points to return. |
| id | path | string (uuid) |
200 · Successfully retrieved last saved battery data. An object with: Fields are the current record version's.
| Field | Type | Description |
|---|---|---|
| ac_input | number | null | |
| ac_load | number | null | |
| current | number | null | |
| events | Event[] | |
| inverter_state | integer | null | |
| overall_temp | number | null | |
| pv_current | number | null | |
| pv_max | number | null | |
| pv_power | number | null | |
| pv_voltage | number | null | |
| soc | number | null | |
| soh | number | null | |
| time | string (date-time) | |
| total_voltage | number | null | |
| version | string | |
| id | string (uuid) | |
| metadata | object | null |
401 Failed authentication · 500 Retrieving last saved battery data failed
Billing
/api/v1.0.1/billing/daily-fixed-charge/{id}Retrieves the daily fixed charge for a battery's installation
Needs the pricing:read scope.
The charge is resolved by walking from the battery to its installation, matching the installation's ICP to the network tariff in force today (ClickHouse icp_tariffs) and returning that tariff's daily fixed charge.
curl -H "Authorization: Bearer ak_your_key_here" \
https://api.aoteaenergy.com/api/v1.0.1/billing/daily-fixed-charge/YOUR_BATTERY_ID| Parameter | In | Type | Description |
|---|---|---|---|
| id | path | string (uuid) | The battery id to resolve the daily fixed charge for |
200 · Successfully resolved the daily fixed charge. An object with:
| Field | Type | Description |
|---|---|---|
| battery_id | string (uuid) | the battery id |
| daily_fixed_charge | number | The daily fixed charge in $/day. |
| tariff_code | string | The EDB tariff code matched via the installation's ICP distributor price category code. |
| tariff_name | string | null | The human readable name of the matched EDB tariff. |
401 Failed authentication · 403 Battery doesnt exist or User is not an owner/user of the battery · 404 No EDB tariff found for the battery's installation · 500 Failed to get data
/api/v1.0.1/billing/data/{id}Retrieves import and export totals, and what they cost and earned, for a time range
Needs the pricing:read scope.
Totals come from the smart meter reads for the battery's installation ICP, one per trading period that starts inside the range. Each period's import is priced at the wholesale price at the installation's GXP plus the network import rate, and its export at the wholesale price plus any network export credit. Spending and earnings are in $, average prices in $/kWh. Fixed daily charges are not included.
Meter reads usually arrive a day or two late, and sometimes skip periods. Each whole half hour up to now that the meter has no reads for uses the battery's own grid readings instead, so recent totals are estimates until the meter catches up. The half hour in progress is left out. A battery without an installation returns zeros.
curl -G -H "Authorization: Bearer ak_your_key_here" \
https://api.aoteaenergy.com/api/v1.0.1/billing/data/YOUR_BATTERY_ID \
--data-urlencode "start=2026-10-22 00:00:00 Pacific/Auckland" \
--data-urlencode "end=2026-10-23 00:00:00 Pacific/Auckland"| Parameter | In | Type | Description |
|---|---|---|---|
| start | query | string | The start of the time range (e.g., "YYYY-MM-DD HH:MM:SS"). |
| end | query | string | The end of the time range (e.g., "YYYY-MM-DD HH:MM:SS"). |
| id | path | string (uuid) |
200 · Successfuly got n days summed of results. An object with:
| Field | Type | Description |
|---|---|---|
| avg_export_price | number | null | The average export price in $/kWh. Null below 0.5 kWh of exports. |
| avg_import_price | number | null | The average import price in $/kWh. Null below 0.5 kWh of imports. |
| battery_id | string (uuid) | the battery id |
| gxp_code | string | The installation's GXP, whose wholesale prices are used. Empty without an installation. |
| total_export_earnings | number | What the exports earned in $: wholesale price plus any network export credit. |
| total_export_kwh | number | The kWh the meter recorded sent to the grid over the time period. |
| total_import_kwh | number | The kWh the meter recorded drawn from the grid over the time period. |
| total_import_spending | number | What the imports cost in $: wholesale price plus the network import rate. |
400 Invalid input data · 401 Failed authentication · 403 Battery doesnt exist or User is not an owner/user of the battery · 500 Failed to get data
/api/v1.0.1/billing/period/{id}Retrieves every figure on the app's billing page for one month
Needs the pricing:read scope.
A billing period runs from the 1st of the month (or the day the customer joined, if later) to the 1st of the next month, when it is billed. For the current month the figures run to midnight this morning and include a projection for the whole period; for a past month they are the final bill.
Usage comes from the installation's smart meter, with the battery's own readings filling any half hour the meter has no read for yet (counted as estimated_periods). Each half hour is priced on its own: the wholesale price at the installation's GXP, the EDB's network rates and the Electricity Authority levy, with GST added to the import charges (exports are paid GST free). Fixed daily charges, the projection, run rates and the comparison with last month follow the billing page's rules.
Only batteries on Aotea's trading plan have a bill.
curl -H "Authorization: Bearer ak_your_key_here" \
https://api.aoteaenergy.com/api/v1.0.1/billing/period/YOUR_BATTERY_ID| Parameter | In | Type | Description |
|---|---|---|---|
| id | path | string (uuid) | The battery id to show the bill for |
| monthoptional | query | string | null | The month, as YYYY-MM in New Zealand time. Omit for the current month. |
200 · The billing page's figures for the month. An object with:
| Field | Type | Description |
|---|---|---|
| battery_id | string (uuid) | The battery id. |
| daily | BillingDay[] | Energy spend for each day of the period so far, for the daily chart. |
| is_current_month | boolean | Whether the month is still in progress. Only the current month has a projection. |
| month | string | The month shown, as YYYY-MM. |
| period | BillingPeriodDates | When the period starts, runs to and is billed. |
| projected | BillingProjected | null | |
| rates | BillingRates | The rates behind the figures, for labelling them. |
| run_rate | BillingRunRate | Average spend per day. |
| spent | BillingSpent | What the period has cost so far; the final bill for a past month. |
| stats | BillingStats | The headline figures, with last month's for comparison. |
400 Invalid month: badly formatted, in the future, or before the customer joined · 401 Failed authentication · 403 Battery doesnt exist or User is not an owner/user of the battery · 404 The battery isn't on Aotea's trading plan · 500 Failed to get data
Live updates over WebSocket
For readings as they arrive rather than polling, open a WebSocket to wss://api.aoteaenergy.com/ws. It needs the battery:live scope. Send the key in the Authorization header where your client allows it; otherwise pass it as ?token=ak_..., which is more likely to end up in logs along the way.
# Any WebSocket client works; websocat shown here.
websocat -H "Authorization: Bearer ak_your_key_here" \
wss://api.aoteaenergy.com/wsOnce connected, send a battery id as a text message to subscribe to it. Each new reading then arrives as a JSON message with the same fields as the latest reading. Send another id to switch battery, or unsubscribe to stop.
YOUR_BATTERY_ID- An id your key can't see gets the text reply “Battery does not exist or you are not authorized”; anything that isn't an id gets “Invalid battery UUID”.
- The server pings every 5 seconds and drops a connection that hasn't answered in 10. Most clients answer pings for you.
- The key is re-checked every minute. If it is revoked, expires or loses
battery:live, the socket closes with code1008. Reconnect with a working key.