control
Unified user-settable input cap.
Unified user-settable input cap. Models HA's number / input_number / select / input_select / text / input_text / input_datetime domains as a single device-scoped cap on DeviceType.Control.
The slice is a discriminated union over four kind values that mirror the corresponding DeviceRole sub-roles (NumericControl / SelectControl / TextControl / DateTimeControl) — the device's role and the slice's kind are populated in lockstep at materialisation time. The UI reads device.role (or equivalently the slice's kind) to render the correct input widget (slider / dropdown / text field / date picker).
The select branch carries its options list IN THE SLICE (not in sourceInfo) because HA select.* entities can update their options dynamically at runtime — the slice is the live source of truth. Numeric unit/min/max/step also live IN THE SLICE — populated live from the upstream source on each state push (HA attributes.unit_of_measurement / min / max / step). The slice is the single source of truth; there is no separate sourceInfo or device-config blob for these values.
At a glance
| Capability | control |
| Provided by | The device's own driver provides it: each device registers its own provider. |
| Active providers per device | one |
| Device types | control |
| Source | packages/types/src/capabilities/control.cap.ts |
Methods
Every method takes the device id (deviceId) to address the device; the input tables below list the other fields.
| Method | Kind | Required of a provider | Access |
|---|---|---|---|
setValue | mutation | yes | protected |
next | mutation | no | protected |
previous | mutation | no | protected |
first | mutation | no | protected |
last | mutation | no | protected |
setValue
mutation
Input
| Field | Type | Required | Description |
|---|---|---|---|
control | { kind: "numeric"; value: number } | { kind: "select"; value: string } | { kind: "text"; value: string } | { kind: "datetime"; value: string } | yes |
Output
Nothing.
next
mutation · optional for a provider
Select one step forward through options (#544). providerOptional (hence optionalMethod): only a kind: 'select' provider implements it — the stepping math is NOT re-derived per provider, it is the one shared helper selectNavigationMethods (control-select-navigation.ts) every select-kind driver spreads in.
Input
| Field | Type | Required | Description |
|---|---|---|---|
cycle | boolean | no (default true) |
Output
Nothing.
Actions (offered in automations and on device cards)
| Action | Label | Sets |
|---|---|---|
select.next | Next option |
previous
mutation · optional for a provider
Select one step backward through options (#544) — mirrors next.
Input
| Field | Type | Required | Description |
|---|---|---|---|
cycle | boolean | no (default true) |
Output
Nothing.
Actions (offered in automations and on device cards)
| Action | Label | Sets |
|---|---|---|
select.previous | Previous option |
first
mutation · optional for a provider
Select the first entry of options (#544).
Input
No fields besides deviceId.
Output
Nothing.
Actions (offered in automations and on device cards)
| Action | Label | Sets |
|---|---|---|
select.first | First option |
last
mutation · optional for a provider
Select the last entry of options (#544).
Input
No fields besides deviceId.
Output
Nothing.
Actions (offered in automations and on device cards)
| Action | Label | Sets |
|---|---|---|
select.last | Last option |
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 widgets (slider / dropdown / text field / date picker) read the slice's discriminant and value directly without polling the provider.
| Field | Type | Required | Description |
|---|---|---|---|
kind | "numeric" | "select" | "text" | "datetime" | yes | |
value | number | string | yes | Current value. Numeric kind → number; select/text/datetime → string. Datetime values are ISO 8601 strings (full timestamp, date-only, or time-only — HA accepts all three forms). |
options | string[] | yes | Acceptable values when kind === 'select'. Empty for other kinds. |
lastChangedAt | number | yes | Ms epoch when the slice was last updated. |
min | number | no | Minimum allowed value, in the device quantity's base unit. |
max | number | no | Maximum allowed value, in the device quantity's base unit. |
step | number | no | Step increment, in the device quantity's base unit. |