fan-control
Fan-control cap.
Fan-control cap. Models HA fan.* entity-specific surfaces: speed percentage, preset modes, ceiling-fan direction, and oscillation. The on/off state lives on the existing switch cap (Fan devices register switch + fan-control, mirroring the Light pattern of switch + brightness + color).
availablePresets mirrors HA's preset_modes attribute so the UI renders a closed-list picker without a separate getOptions round-trip. direction and oscillating are nullable — most fans don't expose them.
Sub-surface gating paired with DeviceFeature flags:
FanSpeed— speed-percentage sliderFanPreset— preset selectorFanDirection— direction toggle (ceiling fans)FanOscillating— oscillation toggle
Per-axis oscillation: an air circulator sweeps horizontally and vertically, each axis with its own switch, fixed angle, sweep bounds and limits. A provider may report them natively; otherwise the OPERATOR links sibling devices to each field in Customize (a replace over the fields listed in overridable — nothing is linked or inferred by itself), and a write to a linked field is forwarded to its source. oscillating stays the single summary flag: when axes exist it means "any axis oscillates" (anyAxisOscillating).
At a glance
| Capability | fan-control |
| Provided by | The device's own driver provides it: each device registers its own provider. |
| Active providers per device | one |
| Device types | fan |
| Source | packages/types/src/capabilities/fan-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 |
|---|---|---|---|
setPercentage | mutation | no | protected |
setPreset | mutation | no | protected |
setDirection | mutation | no | protected |
setOscillating | mutation | no | protected |
setOscillationAxis | mutation | no | protected |
setPercentage
mutation · optional for a provider
Input
| Field | Type | Required | Description |
|---|---|---|---|
speed | number | yes |
Output
Nothing.
Actions (offered in automations and on device cards)
| Action | Label | Sets |
|---|---|---|
fan.off | Fan off | speed = 0 |
fan.full | Fan full | speed = 100 |
fan.speed | Set speed | speed = undefined |
setPreset
mutation · optional for a provider
Input
| Field | Type | Required | Description |
|---|---|---|---|
preset | string | yes |
Output
Nothing.
Actions (offered in automations and on device cards)
| Action | Label | Sets |
|---|---|---|
fan.preset | Set preset | preset = undefined |
setDirection
mutation · optional for a provider
Input
| Field | Type | Required | Description |
|---|---|---|---|
direction | "forward" | "reverse" | yes |
Output
Nothing.
Actions (offered in automations and on device cards)
| Action | Label | Sets |
|---|---|---|
fan.forward | Spin forward | direction = "forward" |
fan.reverse | Spin in reverse | direction = "reverse" |
setOscillating
mutation · optional for a provider
Input
| Field | Type | Required | Description |
|---|---|---|---|
oscillating | boolean | yes |
Output
Nothing.
Actions (offered in automations and on device cards)
| Action | Label | Sets |
|---|---|---|
fan.oscillateOn | Oscillate | oscillating = true |
fan.oscillateOff | Stop oscillating | oscillating = false |
setOscillationAxis
mutation · optional for a provider
Sets one oscillation axis: its switch, fixed angle and/or sweep bounds. Fields left out are untouched. A field linked in Customize is forwarded to its linked source; otherwise the native provider serves it; neither → axis-not-linked. Ranges are checked against the axis limits before anything is written; writes run in order and stop at the first failure, which the result names.
Input
| Field | Type | Required | Description |
|---|---|---|---|
axis | "horizontal" | "vertical" | yes | |
oscillating | boolean | no | |
angle | number | no | |
sweepFrom | number | no | |
sweepTo | number | no |
Output
{ status: "applied" } | { status: "refused"; reason: "nothing-to-set" | "axis-not-linked" | "out-of-range" | "source-gone" | "source-unknown" | "source-call-failed"; field?: "oscillating" | "angle" | "sweepFrom" | "sweep…
Actions (offered in automations and on device cards)
| Action | Label | Sets |
|---|---|---|
fan.horizontalOscillateOn | Horizontal oscillation on | |
fan.horizontalOscillateOff | Horizontal oscillation off | |
fan.verticalOscillateOn | Vertical oscillation on | |
fan.verticalOscillateOff | Vertical oscillation off |
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 fan speed sliders read speed for live updates.
| Field | Type | Required | Description |
|---|---|---|---|
speed | number | null | yes | Active speed as 0..100 inclusive. Null when the device has no speed surface (single-speed fan). |
percentageStep | number | no | Speed granularity the device accepts (HA percentage_step, e.g. 25 for a 4-speed fan). Absent when unknown — the UI then falls back to step 1. |
preset | string | yes | Active preset mode (auto / quiet / turbo / vendor-specific) — empty string when no preset is active or supported. |
availablePresets | string[] | yes | Available preset modes the device accepts. |
direction | "forward" | "reverse" | null | yes | Ceiling-fan blade direction. Null when the device has no direction surface. |
oscillating | boolean | null | yes | Oscillation toggle. Null when the device has no oscillation surface. |
oscillationAxes | { horizontal?: { oscillating?: boolean | null; angle?: number | null; sweepFrom?: number | null; sweepTo?: number | null; min?: number | null; max?: number | null; step?: number | null } | null; vertical?: { oscillating?… | no | Per-axis oscillation (air circulators). Absent when the device has no per-axis surface and nothing is linked in Customize. |
lastChangedAt | number | yes | Ms epoch when the slice was last updated. |