accessories
List of accessory children linked to a parent device.
List of accessory children linked to a parent device. The cap surfaces the grouping and the per-child UI-visibility flag — the single source of truth for what an accessory IS remains the child device itself (resolved via device-manager.getDevice from the listed numeric ids).
Two parallel arrays:
childDeviceIds— every accessory child the parent recogniseshiddenChildIds— subset that the operator chose to hide from the parent's UI surface (panels / detail page / grid). The hidden children remain registered and continue to receive state updates; they're omitted only from the parent's UI accessories view.
Use cases:
- Camera parents hiding seldom-used accessories (e.g. a chime that was provisioned but isn't connected to anything).
- HA-integration parents hiding entity-children the user doesn't care about (an "Aqara plug" exposes one switch + 3 sensors — the operator may want only the switch visible).
Toggling visibility is the parent provider's responsibility — it implements setChildHidden and persists the set so reboots survive.
At a glance
| Capability | accessories |
| Provided by | The device's own driver provides it: each device registers its own provider. |
| Active providers per device | one |
| Device types | camera, switch, light, sensor, climate, cover, lock, fan, media-player, alarm-panel, generic |
| Source | packages/types/src/capabilities/accessories.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 |
|---|---|---|---|
setChildHidden | mutation | yes | admin |
setChildHidden
mutation
Toggle the UI-visibility of a single accessory child. Hidden children stay registered and continue to receive state updates; they're omitted only from the parent's UI accessories panel.
Idempotent — hiding an already-hidden child or unhiding a non-hidden child is a no-op. Providers that don't support per-child visibility may implement this as a no-op (the UI hide toggle gracefully degrades).
Input
| Field | Type | Required | Description |
|---|---|---|---|
childDeviceId | number | yes | |
hidden | boolean | yes |
Output
Nothing.
Status
| Field | Type | Required | Description |
|---|---|---|---|
childDeviceIds | number[] | yes | All accessory children of the parent. |
hiddenChildIds | number[] | yes | Subset of childDeviceIds the operator hid from the UI. The order is irrelevant; the array is treated as a set by consumers. |
Events
onAccessoriesChanged
Emitted when a child device is created, removed, or its parent assignment changes. Payload carries the fresh list and the hidden subset.
| Field | Type | Required | Description |
|---|---|---|---|
deviceId | number | yes | |
childDeviceIds | number[] | yes | |
hiddenChildIds | number[] | yes |
onChildVisibilityChanged
Emitted when the operator toggles a child's UI-visibility. Subscribers (admin UI accessories panel) re-render off this signal without re-fetching the full status block.
| Field | Type | Required | Description |
|---|---|---|---|
deviceId | number | yes | |
childDeviceId | number | yes | |
hidden | boolean | yes |