Dominevo
ReferenceHTTP API

deviceTransitions

The deviceTransitions router: 5 methods of the device-transitions capability, with tier, scope, input and output.

Capability device-transitions · scope device · mode singleton · source packages/types/src/capabilities/device-transitions.cap.ts:64.

Every method is called at /trpc/deviceTransitions.<method> — queries with GET, mutations with POST. See How to call and Authorization. Device methods take deviceId in their input.

MethodKindTierToken scopeViewer
listTransitionsqueryprotectedviewyes
getTransitionqueryprotectedviewyes
listRecentTransitionsqueryadminadmin onlyno
recordmutationadminadmin onlyno
getStatusqueryadminadmin onlyno

deviceTransitions.listTransitions

  • Kind: query — GET /trpc/deviceTransitions.listTransitions
  • Tier: protected — any signed-in principal whose scopes cover the method
  • Token scope: view on capability device-transitions, or category device, or a device grant covering deviceId
  • Viewer: yes
  • Try it: open /system/api-explorer?method=deviceTransitions.listTransitions on your hub

Input

{ deviceId: number; capName?: string; actorKind?: "user" | "addon" | "action" | "scheduler" | "composition" | "node" | "device"; outcome?: "ok" | "failed"; atFrom?: number; atTo?: number; limit?: number = 50; cursor?: string }

Output

{ 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: "ok" | "failed" | "device"; actor: { kind: "user"; userId: string; username: string; credential: "session" | "token" | "integration"; credentialId?: string } | { kind: "addon"; addonId: string; nodeId?: string; onBehalf?: { source: "homeassistant" | "homekit" | "alexa" | "google" | "matter"; principalId: string; principalName?: string } } | { kind: "action"; addonId: string; actionId: string; runId: string; automationId?: string } | { kind: "scheduler"; addonId: string; schedulerId: string } | { kind: "composition"; owner: string } | { kind: "node"; nodeId: string } | { kind: "device" }; command?: { commandId: string; method: string; args: Record<string, unknown>; requestedAt: number; error?: string } })[]; nextCursor: string | null }

deviceTransitions.getTransition

  • Kind: query — GET /trpc/deviceTransitions.getTransition
  • Tier: protected — any signed-in principal whose scopes cover the method
  • Token scope: view on capability device-transitions, or category device, or a device grant covering deviceId
  • Viewer: yes
  • Try it: open /system/api-explorer?method=deviceTransitions.getTransition on your hub

Input

{ deviceId: number; id: string }

Output

{ 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: "ok" | "failed" | "device"; actor: { kind: "user"; userId: string; username: string; credential: "session" | "token" | "integration"; credentialId?: string } | { kind: "addon"; addonId: string; nodeId?: string; onBehalf?: { source: "homeassistant" | "homekit" | "alexa" | "google" | "matter"; principalId: string; principalName?: string } } | { kind: "action"; addonId: string; actionId: string; runId: string; automationId?: string } | { kind: "scheduler"; addonId: string; schedulerId: string } | { kind: "composition"; owner: string } | { kind: "node"; nodeId: string } | { kind: "device" }; command?: { commandId: string; method: string; args: Record<string, unknown>; requestedAt: number; error?: string } } | null

deviceTransitions.listRecentTransitions

  • Kind: query — GET /trpc/deviceTransitions.listRecentTransitions
  • Tier: admin — an administrator; a viewer only as the Viewer line says; never a scoped token
  • Token scope: none — the admin tier needs an administrator (a * token or an admin session)
  • Viewer: no
  • Try it: open /system/api-explorer?method=deviceTransitions.listRecentTransitions on your hub

Input

{ actorKind?: "user" | "addon" | "action" | "scheduler" | "composition" | "node" | "device"; outcome?: "ok" | "failed"; atFrom?: number; atTo?: number; limit?: number = 50; cursor?: string }

Output

{ 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: "ok" | "failed" | "device"; actor: { kind: "user"; userId: string; username: string; credential: "session" | "token" | "integration"; credentialId?: string } | { kind: "addon"; addonId: string; nodeId?: string; onBehalf?: { source: "homeassistant" | "homekit" | "alexa" | "google" | "matter"; principalId: string; principalName?: string } } | { kind: "action"; addonId: string; actionId: string; runId: string; automationId?: string } | { kind: "scheduler"; addonId: string; schedulerId: string } | { kind: "composition"; owner: string } | { kind: "node"; nodeId: string } | { kind: "device" }; command?: { commandId: string; method: string; args: Record<string, unknown>; requestedAt: number; error?: string } })[]; nextCursor: string | null }

deviceTransitions.record

  • Kind: mutation — POST /trpc/deviceTransitions.record
  • Tier: admin — an administrator; a viewer only as the Viewer line says; never a scoped token
  • Token scope: none — the admin tier needs an administrator (a * token or an admin session)
  • Viewer: no
  • Try it: open /system/api-explorer?method=deviceTransitions.record on your hub

Input

{ 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: "ok" | "failed" | "device"; actor: { kind: "user"; userId: string; username: string; credential: "session" | "token" | "integration"; credentialId?: string } | { kind: "addon"; addonId: string; nodeId?: string; onBehalf?: { source: "homeassistant" | "homekit" | "alexa" | "google" | "matter"; principalId: string; principalName?: string } } | { kind: "action"; addonId: string; actionId: string; runId: string; automationId?: string } | { kind: "scheduler"; addonId: string; schedulerId: string } | { kind: "composition"; owner: string } | { kind: "node"; nodeId: string } | { kind: "device" }; command?: { commandId: string; method: string; args: Record<string, unknown>; requestedAt: number; error?: string } })[] }

Output

TransitionRecordResultSchema

Shapes: TransitionRecordResultSchema

deviceTransitions.getStatus

  • Kind: query — GET /trpc/deviceTransitions.getStatus
  • Tier: admin — an administrator; a viewer only as the Viewer line says; never a scoped token
  • Token scope: none — the admin tier needs an administrator (a * token or an admin session)
  • Viewer: no
  • Try it: open /system/api-explorer?method=deviceTransitions.getStatus on your hub

Input

{}

Output

TransitionsStatusSchema

Shapes: TransitionsStatusSchema