Skip to main content
Read a device’s latest available state, what it can do, and what Amps last told it to do. The read shape is the same for every device type; only the state fields change.

Read a device

The same route exists for every type: /battery, /ev-charger, /hvac, /solar-inverter, /vehicle. Solar inverters and vehicles are read-only. Their reads carry id, vendor, model, sync, and state, and nothing else.

What the device is doing vs what it was told

state.status is what the battery is doing. state.currentMode describes operating intent and does not prove a command took effect. They can differ: a charge whose target is already met reads status: "idle", currentMode: "charge", chargeRate: 0. EV chargers report the same split with isCharging and activeControlMode. Compare state with lastAction to spot changes made outside Amps, such as the homeowner switching mode in the manufacturer’s app.

lastAction

A summary for rendering a device card in one call. For parameters and the full result, follow links.self to GET /actions/{id}.
Actions appear when Amps starts sending them, including requests the manufacturer refuses. Future bookings, cancelled bookings and actions that fail before dispatch do not displace the last action that ran. A window’s stop has its own ID, command: "stop", and windowActionId naming the command whose window it ends. It sends its own settlement webhook; settings writes stay outside public action history. start and end are the requested times; endedAt says when the command window ended. updatedAt is the last state change, and errorCode and errorMessage are null without an error.

Freshness

Use sync to see how old a reading is and when you can fetch again. Timestamps are UTC. An unknown refresh time is null. Simulated state has null reading timestamps, fetch attempt, change marker and refresh times.

Refresh a reading

Normal reads reuse readings for up to 15 minutes; expedited reads use a shorter lifetime, usually one minute. The refresh times also include known manufacturer read limits.
A request before a known manufacturer wait ends returns the stored reading, or state: null if none exists. A new fetch does not guarantee a newer manufacturer timestamp.

Read after a change

Commands accepted by the manufacturer mark earlier readings with outdatedBy. Successful window stops and settings writes do the same. The marker does not confirm physical execution. A successful fetch started after the change clears the marker. actionId is null for settings writes and changes from another customer. Use refetchAfter or expeditedRefetchAfter to decide when to read again.

Handle a failed fetch

Offline and temporary fetch failures return 200 with stored state, or state: null when no reading exists. lastFetchAttempt.errorCode explains the failure. Login, consent and missing-device errors return an error response. See Error codes. State and settings stay together on list and detail responses. A null setting value means its value is unavailable; see Settings.

List devices

Lists make no manufacturer calls. Entries carry the stored reading, its settings and clocks, change marker and refresh times, the latest attempt, and the capabilities and action summaries the device type exposes. A device without a reading has state: null and source: "none".

Sandbox

Sandbox devices are simulated. Batteries, EV chargers, and thermostats report sync.source: "simulated", and their state follows the commands you send: push charge and the next read shows status: "charging" with level rising toward the target. No cache, no waiting.
  • Values in motion change between reads. Compare against the command you sent, not an exact earlier number.
  • A windowed command is active between start and end, then the device goes idle and holds where the window left it.
  • With no commands, devices follow a daily pattern on UTC time, for example batteries charge around midday UTC.
Solar inverters and vehicles follow the UTC daily pattern only, since they take no commands. Their readings report sync.source: "simulated" with null fetch clocks, attempt, change marker and refresh times.

State fields by device type

Battery

EV charger

Only status, isConnected, and isCharging are always present. The rest are omitted when the charger doesn’t report them, never sent as zero.

HVAC

Solar inverter

Vehicle

Next steps

Capabilities

Read commands to build a valid push.

Push

Send commands and track actions.

Webhooks

React to completed actions instead of polling.

Settings

Read and change persistent device configuration.