Skip to main content

Overview

Some sessions have an amount, not an end time. A guest gets 20 kWh. A prepaid top-up buys 8 kWh. A fleet allowance releases 30 kWh per driver per night. Push charge with an energy parameter and the session stops at the amount. The charger enforces the stop, not the platform. Amps sends the amount once, in the command. The charger’s own meter counts the kilowatt-hours and ends the session at the target. Amps does not watch the meter and does not send a second command to stop. That is why this is a per-device capability: a charger that cannot meter its own stop cannot accept the parameter, so read the device before you push.
Coming soon. Live control for EV chargers. The sandbox environment serves the full commands and settings surface, so the walkthrough below works against a sandbox device today. A live EV charger push returns 503 NOT_YET_AVAILABLE until the live path opens.

Step 1: Check that the charger declares energy

Read the device, then read data.commands.charge.parameters. The energy entry carries the unit and the range the charger accepts.
This charger meters between 1 and 100 kWh. It declares no step on energy, so any value inside the range is accepted. Other chargers do declare a step, and a value between the increments is refused, so read the key before you round. A charger that omits energy cannot meter the stop. Two alternatives exist. A charger that reads the car’s battery level declares target instead, in percent, and stops at a state of charge. A charger that declares neither leaves the stop to you. Push charge, then poll state.sessionEnergy. Push idle when the amount arrives.

Step 2: Push the charge with an amount

Send the amount as the canonical { value, unit } pair.
The push is immediate, so the action starts in acknowledged rather than scheduled.
Combine the amount with a rate cap. An amount says how much, and power or current says how fast. A guest session that gives 20 kWh at no more than 7.4 kW carries both in one command.
Send power or current, never both. They cap the same rate in different units, so the pair returns 422 UNSUPPORTED_PARAMETER_COMBINATION. To defer the session, add a start as a plant-local wall-clock time. See smart charging an EV for windows and strategies.

Step 3: Read the two refusals

Both refusals a first-time caller meets return 422, and both carry enough in details to fix the request without a second device read. An amount outside the declared range returns PARAMETER_OUT_OF_RANGE. The details object carries the range.
An amount on a charger that cannot meter it returns UNSUPPORTED_PARAMETER. The refusal names the offending key and lists what the command does accept on this device.
Clamp the amount to min and max before you push. Branch on supportedParameters when a charger refuses the key. The platform refuses both requests before it dispatches anything, so nothing changed at the site.

Step 4: Track the delivery

Two surfaces answer two different questions. The action record says whether the charger accepted the instruction. Read it at GET /actions/{actionId}.
Read completed carefully. It means the charger accepted the command and started the session. It does not mean 20 kWh arrived. The delivery takes hours, and the action record closes in seconds. The device read says how much energy has arrived. state.sessionEnergy counts the kilowatt-hours of the current session, so poll the device to drive a progress bar. When state.isCharging turns false and sessionEnergy sits at the amount, the charger met the target. For a completed session and its measurement provenance, read the history instead: see read charging sessions.

Why this works

A canonical parameter earns its place when several manufacturers offer the same lever. Each device then declares whether it has that lever. energy is declared per charger because the meter that enforces the stop sits in the charger, not in the platform. Amps refuses the parameter on a charger that cannot honour it. The alternative is a platform timer, and a timer delivers an amount the caller never requested. See canonical actions and capabilities.

What next

Read charging sessions

What each session delivered, and how it was measured.

Cap charging for a grid event

Hold a charger under an operator’s limit, then restore it.

Smart charging modes

Windows you own, and strategies the charger owns.

EV charger cheat sheet

Every command, parameter, and state field in one page.