Dominevo
ReferenceDevice capabilities

script-runner

Script-runner cap.

Script-runner cap. Models HA script.* entities on DeviceType.Script. A Script is a pre-recorded action sequence that can be invoked imperatively — optionally with a variables map when the script declares input fields.

Variable-support is signalled by DeviceFeature.ScriptVariables so the UI gates a "with parameters" form without a slice fetch.

At a glance

Capabilityscript-runner
Provided byThe device's own driver provides it: each device registers its own provider.
Active providers per deviceone
Device typesscript
Sourcepackages/types/src/capabilities/script-runner.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
runmutationyesadmin
stopmutationyesadmin

run

mutation

Input

FieldTypeRequiredDescription
variablesRecord<string, unknown>noOptional variables map — passed through to the upstream script. Provider rejects when the script doesn't declare input fields (gated by DeviceFeature.ScriptVariables).

Output

Nothing.

Actions (offered in automations and on device cards)

ActionLabelSets
script.runRun script

stop

mutation

Cancel a running script. Provider rejects when the script isn't currently running.

Input

No fields besides deviceId.

Output

Nothing.

Actions (offered in automations and on device cards)

ActionLabelSets
script.stopStop scriptisRunning = false

Runtime state

The state Dominevo keeps for each device with this capability, readable without calling the provider.

Runtime-state slice — mirrored by the kernel. UI script tile reads isRunning to render a spinner during execution and surfaces lastError / lastRunSuccess in the recent-runs panel.

FieldTypeRequiredDescription
isRunningbooleanyesWhether the script is currently executing.
lastRunAtnumberyesMs epoch of the last invocation start. 0 when never run.
lastRunSuccessboolean | nullyesOutcome of the last completed run. Null when never run or still running.
lastErrorstring | nullyesFailure description from the last completed run. Null on success or when never run.
lastChangedAtnumberyesMs epoch when the slice was last updated.