Overview
Schedule acharge action two ways. Send start on its own to defer the charge: it fires once, at that instant, and holds until your next push. Add an end and it becomes a window: the platform fires at start and reverts the battery at end, so you can ride a cheap-rate tariff overnight without touching the API again.
A cheap-rate window is the most common reason to schedule a charge: an Octopus Agile dip, a Cosy off-peak slot, a tariff window the customer’s app already knows about. The platform fires the command, reverts the device at the end of any window, and webhook payloads land at each transition so the customer’s app reflects what actually happened.
Which shapes a battery accepts is declared in commands.charge.execution: scheduled for a bare start, windowed for a start/end pair. They vary by device, so check before you push.
Step 1: Check capability before pushing
Read the device and inspect thecommands.charge.execution array.
windowed, so it takes a start/end window. A unit that lists scheduled (GivEnergy’s charge default, for instance) accepts a deferred start on its own. Match your push to what the array shows.
Step 2: Schedule the charge
Adding astart turns an immediate charge into a scheduled one. Two shapes, gated by the device’s execution array:
- Deferred —
startonly. Fires once atstartand holds until your next push. Needsscheduled. - Windowed —
startandend. Fires atstart, reverts the battery atend. Needswindowed.
YYYY-MM-DDTHH:MM:SS, no offset, no Z) — the platform interprets them in the device’s plant timezone. Parameters take the canonical { value, unit } shape.
Defer to a future time
Sendstart without an end. The GivEnergy unit below lists scheduled, so it accepts a bare start; the charge fires at 22:00 and holds until you push something else.
Charge through a window
Sendstart and end together to bound the charge. The FoxESS unit from Step 1 lists windowed.
- curl
- Node
- Python
202 Accepted. The action stays in scheduled state until start.
command, the parameters you constrained it with, and the deviceType. It also returns links.self (and a Location header) pointing at the action record, so you always have a handle to track the work.
Step 3: Track the action
Actions move throughscheduled to acknowledged to completed. Poll links.self, or subscribe to webhooks for push.completed and push.failed.
command and parameters you sent come back, alongside the lifecycle fields. The deviceType is the clean device family, and the command is the same canonical verb you posted.
When the window opens, the command dispatches to the OEM. acknowledgedAt populates and state advances to acknowledged. On success, state reaches completed and a push.completed webhook fires.
Step 4: Cancel before it fires
Plans change. Cancel the action while it is stillscheduled.
state: cancelled.
What next
Discharge during peak
Mirror this recipe to force-discharge during expensive windows.
Subscribe to webhooks
Receive push.completed events instead of polling.
Handle conflicts
What happens when an action is already in flight.
Scheduling concepts
The semantic background to start, end, and execution shapes.