Overview
A home battery is rarely alone: it shares a grid connection with pv panels and sometimes a heat pump. That is why the battery API has two levels:- Households: a house and all the NOX-connected devices in it, behind its grid connection. A household shows which devices sit behind the same grid connection. It is read-only.
- Batteries: the individual devices. Steering capabilities (
allowed_modes), schedules and settings live here.
device_ids it lists are the same ones the
heat pump, pv and battery endpoints return.
Who steers a battery follows from its optimization settings, exactly as for heat pumps:
With every optimization off, NOX Energy leaves the battery untouched.
Getting Started
Prerequisites
- Valid NOX API key with access to the battery features (see Authentication)
Base URL
All endpoints use the base URL:- Sandbox:
https://api.sandbox.nox.energy - Production:
https://api.nox.energy
Core Workflows
All our collection api endpoints use a
next_token to paginate through results if the size limit of the response has been reached.
To paginate through a response, you can use the next_token received in the response as a query parameter and call the same endpoint with
the same parameters again. You can repeat this process until you have received the last page of the response, which is signified
by the next_token field becoming null.1. Getting households and batteries
Fetch the household of a user, then their batteries:cURL
allowed_modes, together with the battery model.
Power sign convention
All power values follow one rule: positive means power consumed, negative means power delivered.2. Battery modes
You steer a battery by asking it to follow a battery mode during a time window:
Only modes listed in the battery’s
allowed_modes are accepted.
min_soc_pct (fixed at 20 % for now) is the lower limit for force_discharge. When the state of charge reaches it,
NOX Energy takes control and puts the battery in auto for the rest of the schedule entry. It does not limit auto
itself, where the battery may keep covering the house load.
3. Submitting schedules (flex_trading on)
Enable flex_trading for the battery (see Settings), then send one schedule per battery with POST /devices/battery/schedules.
A new schedule for a battery replaces everything previously sent for it. Outside your time windows the battery
falls back to auto, and every start_time must be at least 1 minute in the future.
cURL
200 means every schedule was accepted. A 207 lists the rejected batteries with a reason and
reason_code, for example when the mode is not in allowed_modes or flex_trading is not enabled for the battery.
4. Nominating NOX-optimized batteries
For batteries NOX Energy optimizes, fetch the planned 15 minute charge and discharge with GET /devices/battery/forecast/historical and include it in your nominations, just as you do with the heat pump consumption forecast. The forecast is made every day at a fixed time depending on supplier. To know what the household will consume without its battery, use GET /households/house-load/forecast. The house load excludes the battery and is taken before pv production is subtracted; heat pump consumption is included.5. Measuring the value of steering
GET /devices/battery/typical-charge-discharge/historical returns a simulated baseline: how each battery would have behaved inauto (pure self-consumption), using the realised
pv production and house load. Compare it per 15 minutes with the measured values from
GET /devices/battery/charge-discharge/historical
to calculate what steering earned.
6. Settings
Battery settings work like the heat pump settings: per device, updated with PATCH /devices/battery/settings and read with GET /devices/battery/settings. Provide adevice_id to update one battery, or a user_id to update all batteries of a user.
optimization_settings decides who steers the battery:
dynamic_tariff,pv_self_consumptionandimbalance_optimization: NOX Energy optimizes the battery. They can be combined.flex_trading: you steer the battery with your own schedules. It is mutually exclusive with the other optimizations: enabling it disables them, and enabling any of them disablesflex_trading.- Everything off: NOX Energy leaves the battery untouched.
cURL