Skip to main content
Add start to run a command later, or end to run it across a window. Times are the device’s local wall-clock time, so you never deal with UTC offsets.

Timing

Each command lists the shapes it accepts in its execution array. Both windowed shapes need windowed. See Capabilities.

Schedule a window

The battery charges from 00:30 to 04:30 where it’s installed, wherever your servers are.

Time format

Send start and end as local wall-clock time with no offset: YYYY-MM-DDTHH:MM:SS. Amps converts them using the device’s timezone. Relative durations run that long after Amps receives the request. A window needs absolute times for both start and end.

Times come back in UTC

Actions return start and end as UTC instants. A UK device in summer (BST, UTC+1):

Limits

All return 422. INVALID_TIME_WINDOW carries details.reason. A relative start doesn’t need the device’s timezone.

Daylight saving

end is compared with start in local time, so a window that crosses a clock change is valid as long as end is later on the wall clock.

When a window ends

At end, Amps stops the command. EV chargers and thermostats are sent idle. Batteries have the window Amps wrote removed, so they return to whatever they run outside it. If another command has taken over the device before then, Amps leaves it alone. The action’s endedAt records when the window actually closed. To run something specific after the window, schedule it as a separate action. In sandbox, the device goes idle and holds where the window left it.

Cancel a scheduled action

An action can be cancelled while it’s still scheduled. See Cancelling. Only one action can be active or scheduled per device. A new push that collides returns 409 unless you set onConflict. See Conflicts.

Device schedules

To have a device run the program it already holds, such as a thermostat’s own schedule, send the auto.schedule command.
Coming soon. Recurring schedules that Amps sets and runs on the device.

Next steps

Push

The action body and lifecycle.

Conflicts

Handle collisions with scheduled actions.

Webhooks

Get notified when a scheduled action runs.

Battery cookbook

Charge in a cheap-rate window, and more.