Dominevo
ReferenceDevice capabilities

power-source

power-source — a device that hangs is powered by a smart switch, and the operator picks that switch in the device's Customize.

power-source — a device that hangs is powered by a smart switch, and the operator picks that switch in the device's Customize. The device then offers power on, power off and a forced restart (switch off, wait, switch on).

Manual by default: nothing here restarts a device by itself. The one exception is a device's OWN provider calling forceRestart for its own device as a bounded self-recovery (unreachable for a long stretch, linked, one attempt per cooldown, never with a live session); Velux is the first. It is not the native reboot cap and never replaces or wraps it: reboot talks to the device, this cuts the power of the device that no longer answers.

The link is a Customize extension (add): one scalar target whose source is the switch. The stored composition is the ONE copy of the link and of offSeconds; the composed slice only mirrors the switch state for the UI. The methods are served by the core-blocks system provider, so they are systemMethods and carry a top-level deviceId.

Power on / off are withdrawn — and refused as not-settable — when the linked switch ANSWERED it only reports; the forced restart stays.

Every action answers a typed result and never throws for an expected refusal, so a caller tells "the switch is offline" from "a restart is already running" without parsing text.

Bounds of the off time of a forced restart, in seconds.

At a glance

Capabilitypower-source
Provided byOne addon provides it for every device and answers by device id.
Active providers per deviceone
Device typesgateway, camera, sensor, media-player, vacuum, generic, washer, dryer, dishwasher, pet-fountain, fan, humidifier, climate, water-heater
Sourcepackages/types/src/capabilities/power-source.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
getStatusqueryyesprotected
powerOnmutationyesprotected
powerOffmutationyesprotected
forceRestartmutationyesprotected

getStatus

query

Input

No fields besides deviceId.

Output

FieldTypeRequiredDescription
linkedbooleanyesFalse when the device has no power source linked; the rest is then empty.
switchDeviceIdnumber | nullyes
switchNamestring | nullyes
switchOnboolean | nullyesThe switch's on/off state, or null when it is unknown. Never false for unknown.
switchOnlineboolean | nullyes
switchSettableboolean | nullnoWhether the linked switch can be set (switch.getOptions().supportsSetState; a provider without the method is a plain switch, true). null = not known: no link, the switch is missing, or the read FAILED. Absent = a provider that predates the field. Only false withdraws power on / off (offeredWhen of powerSource.on / .off, the device hero) — unknown keeps them.
restartInProgressbooleanyes
offSecondsnumberyes

powerOn

mutation

Input

No fields besides deviceId.

Output

{ accepted: true } | { accepted: false; reason: "no-power-source" | "switch-missing" | "switch-offline" | "switch-unknown" | "restart-in-progress" | "switch-call-failed" | "switch-options-unreadable" | "not-settable" | "…

Actions (offered in automations and on device cards)

ActionLabelSets
powerSource.onPower on

powerOff

mutation

Input

No fields besides deviceId.

Output

{ accepted: true } | { accepted: false; reason: "no-power-source" | "switch-missing" | "switch-offline" | "switch-unknown" | "restart-in-progress" | "switch-call-failed" | "switch-options-unreadable" | "not-settable" | "…

Actions (offered in automations and on device cards)

ActionLabelSets
powerSource.offPower off

forceRestart

mutation

Input

No fields besides deviceId.

Output

{ accepted: true } | { accepted: false; reason: "no-power-source" | "switch-missing" | "switch-offline" | "switch-unknown" | "restart-in-progress" | "switch-call-failed" | "switch-options-unreadable" | "not-settable" | "…

Actions (offered in automations and on device cards)

ActionLabelSets
powerSource.forceRestartForce restart

Runtime state

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

FieldTypeRequiredDescription
switchOnboolean | nullyesNull while the switch has not reported: unknown is never false.
offSecondsnumberyes
lastFetchedAtnumberyes