Dominevo
ReferenceDevice capabilities

device-runs

device-runs - the durable record of ONE run of a device: a washing cycle, a dishwasher cycle, later a mow or a clean.

device-runs - the durable record of ONE run of a device: a washing cycle, a dishwasher cycle, later a mow or a clean.

A run is a DOCUMENT (opened at one instant, closed at another, carrying what was measured over it), never a sample - device-history keeps the numbers over time and its device-runs provider keeps these documents beside them, because the energy of a run is a question about device-history's own series. The record is written from the running-state flip on DeviceStateChanged; it survives a restart (the open row is on disk) and a missed flip (boot compares the open rows against the live snapshots).

Every measurement is number | null and null means "could not be measured", never 0. A run closed by the boot reconcile because the device stopped while nobody was watching has outcome: 'unknown'.

At a glance

Capabilitydevice-runs
Provided byAn addon wraps the device and provides it. It is bound to a device through the device bindings and can be bound automatically to compatible devices.
Active providers per deviceone
Device typeswasher, dryer, dishwasher
Sourcepackages/types/src/capabilities/device-runs.cap.ts

Methods

Every method takes the device id (deviceId) to address the device; the input tables below list the other fields.

MethodKindRequired of a providerAccess
listRunsqueryyesdefault
getRunqueryyesdefault
getCurrentRunqueryyesdefault

listRuns

query

Runs of a device, newest first. limit is bounded; page with cursor.

Input

FieldTypeRequiredDescription
outcome"completed" | "aborted" | "error" | "unknown"no
atFromnumberno
atTonumberno
limitnumberno (default 50)
cursorstringno

Output

FieldTypeRequiredDescription
runs({ runId: string; deviceId: number; kind: "appliance" | "mower" | "vacuum"; state: "open" | "closed"; startedAt: number; endedAt: number | null; durationMs: number | null; outcome: "completed" | "aborted" | "error" | "un…yes
nextCursorstring | nullyes

getRun

query

Input

FieldTypeRequiredDescription
runIdstringyes

Output

FieldTypeRequiredDescription
runIdstringyes
deviceIdnumberyes
kind"appliance" | "mower" | "vacuum"yes
state"open" | "closed"yes
startedAtnumberyes
endedAtnumber | nullyes
durationMsnumber | nullyes
outcome"completed" | "aborted" | "error" | "unknown" | nullyes
startSource"running-state" | "activity" | "reconcile"yes
endSource"running-state" | "activity" | "reconcile" | nullyes
runningSource"native" | "assigned" | nullyes
phases({ phase: string; at: number })[]yes
detail{ kind: "appliance"; energyKwh: number | null; energyMethod: "counter-delta" | "history-integral" | null; peakW: number | null; avgW: number | null; program: string | null; remainingAtStartSec: number | null; finalPhase:…yes

getCurrentRun

query

The run open right now, or null (answered: there is none).

Input

No fields besides deviceId.

Output

FieldTypeRequiredDescription
runIdstringyes
deviceIdnumberyes
kind"appliance" | "mower" | "vacuum"yes
state"open" | "closed"yes
startedAtnumberyes
endedAtnumber | nullyes
durationMsnumber | nullyes
outcome"completed" | "aborted" | "error" | "unknown" | nullyes
startSource"running-state" | "activity" | "reconcile"yes
endSource"running-state" | "activity" | "reconcile" | nullyes
runningSource"native" | "assigned" | nullyes
phases({ phase: string; at: number })[]yes
detail{ kind: "appliance"; energyKwh: number | null; energyMethod: "counter-delta" | "history-integral" | null; peakW: number | null; avgW: number | null; program: string | null; remainingAtStartSec: number | null; finalPhase:…yes

Events

onRunOpened

FieldTypeRequiredDescription
runIdstringyes${deviceId}:${startedAt}.
deviceIdnumberyes
kind"appliance" | "mower" | "vacuum"yes
state"open" | "closed"yes
startedAtnumberyes
endedAtnumber | nullyes
durationMsnumber | nullyes
outcome"completed" | "aborted" | "error" | "unknown" | nullyes
startSource"running-state" | "activity" | "reconcile"yes
endSource"running-state" | "activity" | "reconcile" | nullyes
runningSource"native" | "assigned" | nullyesWhere the device's running bit came from (running-state.source); null when it did not say.
phases({ phase: string; at: number })[]yes
detail{ kind: "appliance"; energyKwh: number | null; energyMethod: "counter-delta" | "history-integral" | null; peakW: number | null; avgW: number | null; program: string | null; remainingAtStartSec: number | null; finalPhase:…yes

onRunClosed

FieldTypeRequiredDescription
runIdstringyes${deviceId}:${startedAt}.
deviceIdnumberyes
kind"appliance" | "mower" | "vacuum"yes
state"open" | "closed"yes
startedAtnumberyes
endedAtnumber | nullyes
durationMsnumber | nullyes
outcome"completed" | "aborted" | "error" | "unknown" | nullyes
startSource"running-state" | "activity" | "reconcile"yes
endSource"running-state" | "activity" | "reconcile" | nullyes
runningSource"native" | "assigned" | nullyesWhere the device's running bit came from (running-state.source); null when it did not say.
phases({ phase: string; at: number })[]yes
detail{ kind: "appliance"; energyKwh: number | null; energyMethod: "counter-delta" | "history-integral" | null; peakW: number | null; avgW: number | null; program: string | null; remainingAtStartSec: number | null; finalPhase:…yes