Skip to main content

Overview

A charging session is one plug-in-to-completion episode: when the vehicle arrived, when it left, and how much energy went into it. GET /ev-charger/{deviceId}/sessions reads them for one charger, newest first. Use it to bill a driver, show a home owner last night’s charge, or reconcile a month of energy against a tariff.
Check sessions on the device read first. GET /ev-charger/{deviceId} carries a sessions boolean. false means the manufacturer records no history and this endpoint answers 422 SESSIONS_NOT_SUPPORTED, permanently. Reading the flag costs you nothing and saves a request that can only fail.

Step 1: Read one charger’s sessions

Timestamps here are absolute UTC, unlike the plant-local wall-clock you send on a push. A session is a record of something that happened, so there is no local intent to preserve. id is an Amps identifier, opaque and unique across every charger, so it is safe as a primary key in your own store. It is not the manufacturer’s session number, which is often a position in a list and renumbers as older records age out.

Two shapes, keyed by status

An active session is still running, so it carries no endedAt and no endReason, and its energyDelivered is a running total that may be absent if the charger reports no figure mid-session. A completed session always carries endedAt, energyDelivered, and measurement. Branch on status before reading the end fields:
endReason is present when the charger says why the session stopped: unplugged, vehicle_finished, stopped (someone ended it), power_lost, fault, or unknown. It is absent when the charger offers no reason at all, which is not the same as unknown.

Step 2: Read the provenance before you bill

measurement says how the energyDelivered figure was arrived at, and the three values are not interchangeable. Provenance is not accuracy. No value here is a settlement-grade guarantee. metered says the charger kept the count, not that the charger is a certified revenue meter or that the reading has been reconciled. Take the accuracy you need for billing from the charger’s own metering certification, and use measurement to decide whether a figure is worth billing on at all. The practical rule: bill on metered, show oem_reported with the manufacturer named, and treat inferred as an estimate in the interface.

Step 3: Page through the history

pagination.hasMore is the loop condition. limit accepts 1 to 50 and defaults to 10; offset defaults to 0. Pin the window before you page. The list is newest first and the charger keeps being used, so the set grows at the head. With no explicit to, every request resolves the upper bound to the current instant, and a session that starts between two of your requests pushes every older row down one place — the row that was about to be your next page’s first is never returned. Each page reports the window it was cut from as window; send its to back on every subsequent request and all your pages come from one set.
Filter before you page rather than after. Three query parameters narrow the set: A window is an overlap test, not a containment test: a session that began before from and was still running inside the window is returned, so a month’s query does not lose the charge that started on the last night of the previous month.

Sessions versus the device read

Both surfaces talk about energy, and they answer different questions. sessionEnergy is a live reading that resets with each plug-in. The session list is the durable record, and it carries the provenance that the live reading does not. See device state for the full telemetry surface.

What next

Smart charging modes

Hand timing to the charger’s own price or solar optimiser.

Cap an EV charger's power

The standing ceiling every session runs under.

EV charger cheat sheet

The whole charger surface in one page.

Subscribe to webhooks

React to charger events instead of polling.