Dominevo
ReferenceDevice capabilities

device-transitions

device-transitions - the audit of what changed on a device and who asked for it.

device-transitions - the audit of what changed on a device and who asked for it.

A transition is a FACT about one status field: it went from from to to at at, and the actor is the user, token, addon, action or scheduler whose command the hub mirror matched to the change, or device when nothing asked. The hub kernel (device-manager) writes the rows by batch through record; device-history owns the ledger, its retention and its removal hook. Reads answer from disk: an answered empty page is "no transitions".

null is "unknown", never 0: a from the mirror had not seen, a matchedAfterMs of a command that produced no change, a count not taken.

At a glance

Capabilitydevice-transitions
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 typescamera, light, siren, switch, sensor, climate, button, event-emitter, update, generic, notifier, script, automation, lock, cover, valve, humidifier, water-heater, fan, media-player, alarm-panel, control, presence, weather, weather-station, vacuum, lawn-mower, image, pet-feeder, pet-fountain, dishwasher, washer, dryer, gateway, heat-pump, energy-system, workload
Sourcepackages/types/src/capabilities/device-transitions.cap.ts

Methods

MethodKindRequired of a providerAccess
listTransitionsqueryyesdefault
getTransitionqueryyesdefault
listRecentTransitionsqueryyesadmin
recordmutationyesadmin
getStatusqueryyesadmin

listTransitions

query

Transitions of a device, newest first. limit is bounded; page with cursor. At most ONE of capName, actorKind, outcome per call - each is served by its own index.

Input

FieldTypeRequiredDescription
deviceIdnumberyes
capNamestringno
actorKind"user" | "addon" | "action" | "scheduler" | "composition" | "node" | "device"no
outcome"confirmed" | "device" | "already" | "unconfirmed" | "failed"no
atFromnumberno
atTonumberno
limitnumberno (default 50)
cursorstringno

Output

FieldTypeRequiredDescription
transitions({ id: string; deviceId: number; at: number; capName: string; field: string; from: string | number | boolean | null | Record<string, unknown>; to: string | number | boolean | null | Record<string, unknown>; outcome: "con…yes
nextCursorstring | nullyes

getTransition

query

Input

FieldTypeRequiredDescription
deviceIdnumberyes
idstringyes

Output

FieldTypeRequiredDescription
idstringyes
deviceIdnumberyes
atnumberyes
capNamestringyes
fieldstringyes
fromstring | number | boolean | null | Record<string, unknown>yes
tostring | number | boolean | null | Record<string, unknown>yes
outcome"confirmed" | "device" | "already" | "unconfirmed" | "failed"yes
actor{ kind: "user"; userId: string; username: string; credential: "session" | "token" | "integration"; credentialId?: string } | { kind: "addon"; addonId: string; nodeId?: string; onBehalf?: { source: "homeassistant" | "home…yes
command{ commandId: string; method: string; args: Record<string, unknown>; requestedAt: number; matchedAfterMs: number | null; error?: string }no

listRecentTransitions

query

The fleet page, newest first. At most ONE of actorKind, outcome per call.

Input

FieldTypeRequiredDescription
actorKind"user" | "addon" | "action" | "scheduler" | "composition" | "node" | "device"no
outcome"confirmed" | "device" | "already" | "unconfirmed" | "failed"no
atFromnumberno
atTonumberno
limitnumberno (default 50)
cursorstringno

Output

FieldTypeRequiredDescription
transitions({ id: string; deviceId: number; at: number; capName: string; field: string; from: string | number | boolean | null | Record<string, unknown>; to: string | number | boolean | null | Record<string, unknown>; outcome: "con…yes
nextCursorstring | nullyes

record

mutation

Kernel write: device-manager delivers a batch. Refused for any other caller.

Input

FieldTypeRequiredDescription
transitions({ id: string; deviceId: number; at: number; capName: string; field: string; from: string | number | boolean | null | Record<string, unknown>; to: string | number | boolean | null | Record<string, unknown>; outcome: "con…yes

Output

FieldTypeRequiredDescription
writtennumberyes
refused({ id: string; reason: "not-kernel" | "invalid" })[]yes

getStatus

query

Input

No fields.

Output

FieldTypeRequiredDescription
rowsnumber | nullyesRows in the ledger; null until counted.
lastWriteAtnumber | nullyes
refusedRecord<string, number>yesRefused rows since start, by reason.