Devices
Reeve models a device as a canonical, strongly typed entity. Plugins do all vendor translation in both directions. Nothing in the host, the API or the frontend parses a vendor key or coerces a wire value, and supporting a new vendor needs no change outside its plugin.
This page covers the device model, the device API, the rules a driver follows, and the findings Reeve raises when a device changes under the things that refer to it. For the architecture behind it see Device model; for writing a driver see Plugin authoring.
The two addressable layers
| Layer | Route family | What it is |
|---|---|---|
| Logical device | api/devices/*, api/logical-devices/* |
The thing the household owns and automates. Every payload projects the failover-resolved active source. |
| Device source (physical) | api/devices/sources/* |
One feed as reported by one plugin instance: its own name, health, capability descriptor, state and commands. A command sent here bypasses failover and reaches that source. |
Anything a person or an automation targets is logical. Anything that describes a feed is physical. Automations, scenes, widget bindings, helpers, per-user grants, favourites, telemetry, history, device events, cloud bridges and the mobile client are all keyed by logical device.
Access is inherited. A source is visible exactly when its logical device is. There are no per-source grants and no per-source permission codes.
Basic tile and temperature settings
PUT api/logical-devices/{id}/basic-tile replaces the household-wide quick action, state line, Start visibility and presentsAs choice for a device. It needs devices.manage. Capability keys must be declared by the device's descriptor, so while a device has no descriptor only the key-free choices (auto, none) are accepted. Sending auto for every field resets the setting.
presentsAs is auto, light or outlet. The server refuses light on a device that is neither a Switch nor an Outlet, and outlet on anything but a Switch. An unrecognised stored value reads as auto.
PUT api/logical-devices/{id}/average-temperature-exclusion with { "exclude": true|false } keeps a device out of the room and home average temperature, or puts it back. It needs devices.manage. A body without exclude is a 400. exclude: true is also a 400 for a device none of whose sources declares a Number capability ending in .temperature or .currentTemperature; exclude: false is always accepted. The flag starts true for a WaterHeater (its reading is the tank) and false for every other type, and is returned as excludeFromAverageTemperature, omitted when false.
The typed device summary carries lastEvent (time and button) for scene controllers, taken from the last 90 days.
Canonical vocabulary
Device types, capabilities, value kinds, enum tokens and units are a closed set owned by the host: one strongly typed record per device type, with nested typed members for multi-component devices. A plugin maps its vendor vocabulary onto that set and cannot extend it. Persisted references in scenes, automations and workflow blocks need a contract that stays stable, so adding a type or capability is a change to Reeve itself.
A capability key is a dotted path rooted at the lowercase device-type name, for example light.isOn. A channel member is <type>.channels[<number>].<leaf>, for example outlet.channels[2].isOn. The plugin assigns each channel an opaque number and a stable SourceId. State never defines channel membership. Keys are persisted by scenes, automations and workflow blocks, so they are stable identifiers. The bare channel-list key is never settable; command a specific member.
Sensors are one record with named binary capabilities (contactOpen, leakDetected, occupancyDetected, presenceDetected, motionDetected, vibrationDetected, tamperDetected, batteryLow and others). Occupancy, presence and motion are separate and are never collapsed. Smoke/CO and gas detection are dedicated device types with endOfLife, faultDetected, muted, sensitivity and a unified alarmState. Detector notifications go there, not to a generic sensor.
Vendor properties with no canonical home stay in the unmapped-property set (see Writing to a device).
Per-instance capability availability
The canonical record says what a device of a kind could have. The availability descriptor says what this instance does have: which capabilities exist, whether they are controllable, their labels, and their value domain (narrowed enum tokens, or unit, min, max and step, or channel declarations). The UI, the pickers and command validation read only from the descriptor.
Do not infer support from a non-null typed member. null can mean the device has not reported yet. A capability missing from the descriptor is neither shown nor commandable, even when the record field is populated.
A driver with a static capability set gets a correct descriptor from an accurate discovery record. Only availability that changes at runtime needs an explicit re-declaration, and that re-declaration carries the whole descriptor, because the stored descriptor is replaced as a whole.
Reeve refuses a descriptor report with a duplicate capability key, a channel number used twice in the device, a channel SourceId used twice within one capability, or a channel capability with no declarations. The report changes nothing and the plugin instance gets the warning alert device.report_rejected, naming the source, reason and capability. The next accepted discovery, redescribe or capabilities-changed report for that source clears it, as does the plugin removing the source. Deleting the plugin instance deletes its alerts.
The list and the detail
GET api/devices and GET api/devices/{id} describe the same logical device at different weights. The list has two views, chosen with the view query parameter. Any value other than full or lean answers 400.
| Member | List, default (view omitted or full) |
List, view=lean |
Detail |
|---|---|---|---|
Descriptor, canonical state, access, room, freshness, plugin attribution, isControllable |
yes | yes | yes |
Vendor-shaped capabilities rows |
filled | absent | filled |
unmappedProperties (raw vendor properties) |
filled | always [] |
filled |
state (raw payload), recentCommands, freshness windows |
no | no | filled |
Members whose value is null, at any depth |
written as null |
omitted | written as null |
The web application and the mobile app ask for view=lean. A lean client reads an absent member as null or its declared default (for example isCritical: false). A null entry inside canonicalState is still written: the key is declared but has no value yet. Anything that needs the vendor-shaped rows or the raw properties of one device (raw-property workflow blocks, the device capability picker, an expanded room card) reads that device's detail. Pickers across many devices match on the descriptor.
GET api/devices/bulk returns the detail for several devices at once.
Writing to a device
There are two write paths.
| Endpoint | Body | Use |
|---|---|---|
POST api/devices/{id}/canonical-commands |
{ "deviceType": "<Type>", "values": [{ "key": "<canonicalKey>", "kind": "<Kind>", "value": … }] } |
The primary path. Validated against the instance descriptor and the catalogue. Answers 422 when the plugin has not opted in to typed commands. |
POST api/devices/{id}/canonical-commands/by-value |
{ "values": { "<canonicalKey>": <json> } } |
The same command with the kind and device type inferred from the catalogue. This is the only command path a custom widget can use. |
POST api/devices/{id}/raw-properties |
{ "properties": { "<vendorKey>": <json> } } |
Escape hatch for unmapped vendor properties. Forwarded verbatim, with no translation. |
All need devices.control. The same three exist per source under api/devices/sources/{sourceId}/.
Command outcomes
Once a request is valid, every command endpoint answers the same way.
| Result | Meaning |
|---|---|
200 with the command-log entry |
The plugin took the command. |
502, errorCode device.command.failed |
The plugin reported the command was not carried out. detail carries the plugin's reason and commandLogId names the log entry, recorded as Failed. |
504 |
The adapter did not answer in time. Recorded as TimedOut. The command was sent, so the device may still have applied it. |
400 |
The device has no active source (all sources offline), or the command was refused for its target (below). |
422 |
The plugin has not opted in to typed commands. |
In-process callers (IDeviceService, plugins, scripts) receive a DeviceCommandResponse and must treat Status == "Failed" as not carried out.
A repeated Idempotency-Key within five minutes answers what the first request did: 504 for a timed-out entry, a repeated refusal or 502 for a failed one, 200 otherwise. The 502 and 504 of these endpoints are logged as warnings and do not count towards the HighErrorRate alert.
Refusal codes
A canonical command refused for its target answers 400 with an errorCode.
| Code | The target |
|---|---|
device.capability.missing |
is not in any source's descriptor |
device.channel.missing |
names a channel the descriptor does not declare |
device.capability.kind-changed |
is a different value kind than the catalogue's |
device.capability.controllability-lost |
is no longer controllable (a channel needs both its list and itself controllable) |
device.capability.value-domain-changed |
takes a value outside the bounds, tokens or unit the instance declares |
device.target.unsupported-by-source |
resolves on another source of the device but not on the commanded one |
When no single source can take the command, the code comes from the closest source, in the order controllability-lost, value-domain-changed, kind-changed, capability.missing, channel.missing. A capability whose kind changed is not refused for that reason alone.
Workflow device blocks surface the same codes. SetProperty raises DeviceTargetException carrying the code, which also leads the node's error message (device.channel.missing: …). A refusal with no code stays InvalidDeviceCommandException. GetProperty and WaitForProperty read the active source and never raise device.target.unsupported-by-source. All three raise device.not-found for an id that names no device. A read is refused up front only when no source of the device is still awaiting its description and none declares the key.
Unmapped properties
An unmapped vendor property is neither promoted into the typed model nor dropped. It appears as a structured value (vendor key, value type, value) that raw-property workflow blocks and the raw-property endpoint can read and write. Typed features (scenes, triggers, dashboards, cloud bridges) never use it. A property that is a reusable capability belongs in the canonical model, not here.
Momentary events
Button presses and scene-controller activations carry no persisted state. They flow on the event channel readable from GET /api/events, limited to the caller's accessible devices. Declared channels, including a scene controller's buttons, come from the descriptor.
Per-source surface
| Method | Path | Needs |
|---|---|---|
| GET | api/devices/sources, …/{sourceId}, …/{sourceId}/removal-notices |
access token and access to the parent device |
| POST | …/{sourceId}/canonical-commands, …/canonical-commands/by-value, …/raw-properties |
devices.control |
| PUT | …/{sourceId}/name, …/{sourceId}/channel-names |
devices.manage |
| DELETE | …/{sourceId} |
devices.manage |
A source the caller cannot reach answers 404, not 403, so the endpoints do not reveal whether a source exists. Command authorization resolves before the command is inspected, so a caller without control gets a refusal and not a validation error that would reveal whether a key is canonical. Channel indices are checked against the commanded source's own state.
PUT …/name sets the operator's name for the source. A null or blank body clears it, and the display name falls back to the vendor-reported name. PUT …/channel-names takes { "channelFriendlyNames": { "<canonicalKey>": "<name>" } }, where a null or blank value restores the driver's label.
DELETE on one of several sources detaches it and re-elects the active one. DELETE on the last source removes the logical device. The response carries RemovedSourceId, and RemovedLogicalDeviceId only in the second case.
Sources, merging and failover
A logical device owns one or more sources and a failover policy. Commands go to the active source only. Source health is judged by the health check alone.
Merging
Merging is explicit and never automatic, and is allowed only between devices of the same type. Duplicate suggestions come from exact matches on strong identifiers and are advisory. POST api/logical-devices/{targetId}/merge/{sourceLogicalDeviceId} merges the second device into the first. Capability keys do not change.
The merge points the merged-away device's references at the target before removing it:
- Automation triggers and bound inputs, and workflow drafts. Published workflow versions are not rewritten, so an automation whose published workflow names the merged-away device is stopped after the merge. Publish the rewritten draft to bring it back. A workflow with no draft is edited in the designer, which shows its blocks as on a removed device, and published.
- Scene actions, and device, camera, chart, statistics and custom widgets on personal and shared dashboards. A dashboard saved from an editor opened before the merge writes the old id back.
- Attached helpers and utility meters. A moved meter reads the target's history for its property.
Collisions are not merged. When the target already has an action for the same capability in a scene, its action stays and the other is deleted. A helper whose name the target already uses is deleted with the merged-away device, and references to it then show as missing. Both are logged at Information. Merging is refused (409) while both devices feed a utility meter from the same property, because totals would count the series twice. The refusal names both meters and stays even when one meter is excluded from calculations.
Not carried over: grants, time windows, cloud exposure, presence binding and a baby-monitor camera set on the merged-away device. The target's own settings stand. Expressions and helper paths that address the merged-away device by name (${device.<name>...}) stop resolving until edited.
Detaching a source keeps the original logical device id on the remainder. The detached source becomes a new logical device that inherits the per-user access overrides and time windows.
Names
A logical device's name follows its primary source's reported name until someone renames it. After a rename, discovery never changes the name again. Only discovery moves the name, so promoting, reordering or detaching a source takes effect at the next discovery, and failover never does. A name that only repeats the source's identifier is never recorded. A discovery that moves the name wakes the helpers that address the device by its old name.
Health and freshness
Each source's state row holds the canonical typed state, the raw vendor payload as received, and the source's capability descriptor. Only the canonical state is read outside the plugin. A driver passes the whole original message alongside the canonical state.
Source health is judged when it is read. An explicit Degraded or Offline passes through. An Online source presents as Degraded once it has been silent longer than its threshold. Stored health and failover are untouched, so a read cannot flap the failover state.
Only devices that report on a cadence have a silence threshold: sensors (Automations:Freshness:SensorLabelTtlSeconds, 1800 s) and presence reporters (PresenceLabelTtlSeconds, 900 s). Lights, switches, outlets and cameras report on change, so silence says nothing about them: they are fresh while the driver reports Online and offline when it reports Offline. An operator's per-device window gives any type a threshold, and a threshold of zero disables decay. The freshness label is fresh, stale, offline or unknown (no state yet).
Automation triggers do not read the label. They skip a change whose source timestamp is older than Automations:Freshness:StaleTtlSeconds (120 s). The device summary also carries silent: true for a sensor or presence reporter silent for longer than Automations:Freshness:SilentAfterSeconds (86400 s). It does not change availability, but Basic surfaces on the web treat the device as unavailable.
Offline recording by the host
When a plugin instance is disabled, or fails to start on a single-node host, Reeve records each of its sources as Offline and marks them as held by the host. Sources of the same device on another instance take over through failover. The next successful start returns held sources to Online without waiting for the driver. A source the driver reported on in the meantime keeps that report, one the driver had reported Offline stays Offline, and a Degraded one returns as Online. A stop of an enabled instance (reload, update, grant change) and a host shutdown record nothing. In a cluster a failed start on one replica records nothing, because a peer may still run the instance.
A plugin whose workload declares health.mode: adapter-session (Virtual Devices, Bluetooth, Z-Wave, Matter) reaches its devices only through that session. When every session workload of an instance has been absent for the grace period, its sources become Offline and held by the host. The grace period is Workloads:Gateway:InstallFenceMaxHoldSeconds (120 s) plus the 30 s reconnect backoff cap plus PresenceSweepSeconds (30 s), 180 s by default. A clean stop reaches Offline within 210 s and a crash within 300 s of the last heartbeat. Faults reading presence postpone the mark and never write one.
Only the driver lifts a session mark: the snapshot a sidecar sends on connect reports every device it knows, so a session plugin must report every known device there. A start while the session is up lifts only sources reported on since that session connected. A start while the session is absent or unreadable lifts nothing.
Per-gang names
An operator can name an individual channel of a multi-channel switch or outlet, through the capabilityFriendlyNames of PUT api/devices/{id}/metadata or the source's channel-names endpoint. The name is stored per logical device, capability key and channel number, and applied over the descriptor when it is read. Clearing a name deletes it. A name for a channel the descriptor no longer declares is kept and returns if the channel does. It survives rediscovery, resync and failover.
The bracketed channel number is the plugin's opaque number, never an array position. Any ordinal shown to a user comes from the channel's position in the list. Labels are display only. The physical view shows the driver's own labels and does not apply the logical device's overrides.
Rules for drivers
| Rule | Why |
|---|---|
| Every numeric value is in its declared canonical unit | Vendor degrees Fahrenheit, mireds, 0–254 brightness and kWh are converted before they cross the driver boundary. |
| Every enum value is a canonical token from a catalogue-validated map | Map construction rejects a non-canonical target, so a vendor token cannot escape as a canonical value. |
| A canonical value with no wire form throws | Nothing is guessed or passed through. |
| A state parser returns nothing for a message it cannot type | The plugin then falls back to the raw state path. Never drop a message. |
| A driver never sets the critical-capability flag | It is a household setting on the logical device, applied to the descriptor when it is read. |
| Declared min, max and step are already in the canonical unit | A range outside the catalogue's canonical range is dropped whole rather than mislabelled. |
| Pass the device's own clock as the source time | Telemetry is keyed by it (see below). Use receipt time only where one replica hears each message. |
| A session plugin reports every known device in its connect snapshot | Only the driver lifts the host's Offline mark. |
A camera reports motion by sending camera.motionDetected heartbeats |
See Camera motion. |
Behaviour a plugin author relies on
Ingest
State reports for a source are processed in order. An out-of-order report never publishes to automations or the realtime feed, although telemetry still appends. A state batch stays open for DeviceIngest:BatchWindow (20 ms) after its first update, or is written at once when it already holds 50 updates. reeve_device_ingest_batch_size shows what the window collects.
Queued state updates are bounded by bytes: DeviceIngest:SinkQueueByteBudget (16 MiB per plugin instance) and DeviceIngest:ProcessQueueByteBudget (256 MiB shared). Each update is charged its payload size plus DeviceIngest:QueueItemOverheadBytes (1 KiB). Under pressure the oldest queued item is dropped and counted in reeve_device_ingest_queue_dropped_total with labels sink_kind and reason. The newest state per source is kept for replay. An unreachable store is waited out. Any other write failure drops the source's batch after repeated failures, counted as reason=failed. A state the store cannot hold, such as a NUL character in a string, is skipped with a warning and the rest of the batch is stored.
Realtime pushes (state, health, capabilities, discovery) never delay ingest. They go out after commit on a separate queue per plugin instance, bounded by DeviceIngest:RealtimeProcessQueueByteBudget (64 MiB process-wide) and 10 000 pushes. A dropped or failed push is logged and not replayed. See Realtime hubs.
Telemetry
A sample that repeats the series' last stored value at the same or a later instant is skipped. A strictly older sample still appends, which is how backfill works. A row is recorded under the source's own observation time when that is within TelemetryIngest:SourceTimeWindow (2 minutes) of capture and not behind the series' last reading. Otherwise it is recorded under capture time. The row id is derived from source, metric, instant and value, so a reading delivered to several replicas, or replayed by a reconnect snapshot, is one row. See Running multiple replicas.
A delta-usage series (a utility meter's consumption) stores an equal reading only when the arriving message reported that key. A driver that does not set reported keys therefore merges equal consecutive deltas.
Removal
When a plugin reports a device gone but a utility meter reads from it, Reeve keeps the device and its last source, records the source Offline and raises the warning alert device.kept_for_meters. The plugin's call returns normally. Re-pointing or deleting the meter, then deleting the device, clears the alert.
Camera motion
A camera plugin reports motion with the camera.motionDetected heartbeat, repeated every 2 seconds while motion lasts. The host turns heartbeats into counted stretches: a stretch ends 6 seconds after the last heartbeat from any source. Plugins cannot publish camera.motionStarted or camera.motionStopped. The host publishes them, each carrying the stretch id as EventId. A stretch whose owner crashed is closed by a probe that runs every 30 seconds on every replica, once it is more than 10 seconds past its end. A deleted camera's stretch is dropped without a stop event. While Redis is unreachable nothing opens or closes, and open stretches close once it answers.
A camera source that reports Motion as state is repeated by its host: while the stored Motion is true the host sends a heartbeat every 2 seconds. The repeater stops on a false Motion, when the source goes offline or is removed, and does not restart when the source returns Online.
A pan, tilt or zoom command, a frame-changing command (privacy, flip, rotation, night vision) and a reported move beyond tolerance open the PTZ quiet window, CameraMotion:PtzQuietSeconds (10 s, 0 to 120). A stretch that starts inside the window is ignored. A source that declares camera.ptzMoving signals the window only when that flag changes. The baby monitor and the "Camera — motion" trigger read stretches, not the stored camera.motion state.
Type changes
A logical device's type never changes in place. When a source reports a different type, the host moves it to a new logical device of that type. The new device inherits the name, room and Matter exposure. A merged device keeps its other sources. A logical device of type Unknown simply takes the first reported type.
If that was the device's only source, the old device is retired, not deleted. A retired device keeps its findings, its exposure is cleared, and its attached helpers move to the new device. References to it get the error finding device.replaced, and commands to it are refused. Telemetry history, channel labels and critical keys do not move. The warning alert device.rehomed names the replacement. A retired device is purged after DeviceModel:EventRetention, once no automation trigger, scene action, baby-monitor profile, current workflow version or utility meter refers to it. If a source of the same type later returns, the most recently retired matching device is its return target.
Other contracts
- The capability-kind enum is stored as a numeric ordinal and is append-only. A persisted ordinal that decodes as a different kind fails closed: the scene action is refused and has to be captured again.
- Device access filtering is applied in SQL before counting and paging, so totals and pages are correct.
- Capturing a scene from current state takes only controllable capabilities whose role is
Control. Settings and diagnostics are configuration and are not replayed. A catalogue command (cover.state,valve.state,vacuum.command,mediaplayer.command) is captured only at one of its resting tokens, and not beside the capability that supersedes it. - Read-only capabilities are triggers, never scene actions or workflow setters.
- A device's name has one writer, the rename endpoints.
- Source health writes are deduplicated for five minutes, so an unchanged report does not touch the database.
Model findings
Findings record what in your scenes, automations, workflows and meters no longer resolves after a device changes. They are visible to anyone who can see both the object and the device, through GET api/devices/{id}/model-findings (devices.view) and the SignalR change notifications. The troubleshooting steps are in Device model changes.
Finding codes
| Code | Raised when |
|---|---|
device.channel.missing |
a referenced channel is not declared by any source |
device.channel.renumbered |
the plugin gave the channel a new number and the reference still holds the old one |
device.capability.missing |
a referenced capability is not declared |
device.capability.kind-changed |
the capability's value kind changed |
device.capability.controllability-lost |
a written capability or channel is no longer controllable |
device.capability.value-domain-changed |
a stored value falls outside what any source accepts, or an expected unit differs from the declared one |
device.channel.labels-orphaned |
a channel label names a channel the device no longer declares (always a warning) |
device.replaced |
the reference targets a retired device (always an error) |
An automation that has an open Error finding is disabled, and so is one whose bound workflow, or any workflow it calls through static sub-workflow nodes (up to 10 levels), has one. Warnings never disable anything. Enabling a blocked automation is refused with automation.blocked.device-model. When the last blocking error clears, an automation that the model disabled resumes on its own after a scan from the job table. One the operator had disabled stays off. Findings are cleared when a later scan no longer finds the broken reference, and the alert device.dependencies_broken (Error) summarises them per device.
What is checked
| Reference | Kind | Checked against |
|---|---|---|
State-change trigger or condition; workflow GetProperty, WaitForProperty |
State read | the capability, or the {path}.channels list that names the channel |
Device-event trigger with buttonIndex |
Button event | scenecontroller.channels; nothing is raised while no source declares that list |
Scene action; workflow SetProperty |
Write | as a state read, and the capability and channel must be controllable |
| Device channel label | Channel label | the channel, raising device.channel.labels-orphaned |
| Baby-monitor profile camera; utility meter with a vendor metric name | Device | the whole device: only retirement affects it |
| Utility meter with a canonical key | State read | as a state read, with the meter's unit as the expected unit |
References come from automation triggers and conditions, automation inputs (read against the workflow's published version, including values handed to sub-workflows), scene actions, the current published version of workflows, baby-monitor profiles, utility meters and channel labels. A scene action whose key is not canonical for the device's type is checked only as a device reference. Unreadable stored JSON is skipped and the scan continues with the other references.
An unresolved reference is an Error when every source of the device has described itself, and a Warning while a plugin-owned source of a concrete type has no stored descriptor yet. Passthrough changes (runtime-only availability changes) raise Warnings and never downgrade an existing Error. A finding keeps its severity and code while the reference stays unresolved. A device.channel.renumbered finding keeps its text and event id and can be raised to Error by a later structural scan.
Stored values are judged by the rule a command uses. A scene action's target value, a SetProperty literal, an automation StateChange trigger's toValue and fromValue are checked against the instance's bounds and allowed tokens. The operand of an ordering operator (gt, gte, lt, lte) is a threshold and is not judged. A utility meter's unit is compared with the declared unit (Wh and watt_hour are the same unit). A meter whose unit is outside the conversion table is not judged.
Messages name the channel's number and label: Channel 3 (Kitchen light) of device 'Hallway' is no longer declared. The label is the operator's own, else the plugin's current one, else the one the finding already held. The findings endpoints add the name of the object (automation, scene, workflow, baby-monitor profile, utility meter).
What triggers a scan
| Trigger | Scope |
|---|---|
| Descriptor change that alters the structure | The whole device, at Error severity |
| Runtime availability change only | The references on the changed capabilities, at Warning severity |
| Save or delete of an automation, scene, workflow, meter, profile or channel label | That object, plus devices it touched or that have open findings |
| Publish, rollback or delete of a workflow | The workflow, the automations bound to it, and every workflow that calls it |
Object data is committed before its scan. A failed scan is logged and the save stands; the next save or model event retries.
Discovery, redescribe and capabilities-changed reports commit the new descriptor, a model event and a revalidation job in one transaction. An unchanged report creates neither. A new source on an existing device, or a source removed from a device that survives, also records an event and a scan.
Renumbered channels
When a plugin renumbers a channel (same SourceId, new number), Reeve rewrites the references itself in the same transaction as the descriptor: automation trigger keys and button indexes, scene action keys, channel labels and the Property<T> literals in workflow drafts. Each rewrite is recorded on the model event and in an audit entry device.channel.rewritten. Published workflow versions are never changed, and a block whose key is wired from another node keeps it. An automation keeps its enabled state. References the rewrite did not reach keep the finding device.channel.renumbered, which clears once the reference is repaired.
A report that renumbers and also collapses sources or changes the device type skips the rewrite and leaves the finding. An editor tab opened before the renumber still holds the old draft, and saving it writes the old key back.
Collapsing sources
A discovery or redescribe report can declare that a source replaces older ones, for example when a vendor starts reporting several devices as one multi-channel device (Replacements or ReplacesSourceIds). In one transaction Reeve maps the replaced channels onto the new descriptor's channels, then moves what referred to them:
- scene actions, automation triggers (device, key, button index) and bound inputs, channel labels and dashboard device widgets, plus workflow drafts and
Property<T>literals; - attached helpers, cloud exposure, access overrides and time windows, room and critical keys, for a device the mapping carries something for. A helper whose name the new device already has stays on the retired device and is deleted with it.
A whole-device replacement carries its *.isOn toggle and channel labels onto the channel. A mapping the new descriptor cannot hold is dropped and logged, but its source is still replaced. Each replaced source records a source-removed event, a device left with no source is retired, and the new device records one collapse event. History stays on the retired devices.
A reference moves only when every key it is used with moves; otherwise it stays and gets device.replaced. Published workflow versions, wired ports, sub-workflow arguments, blueprint bindings, name-based helper expressions, utility meters, presence devices, tiles, favourites, baby-monitor profiles, merge suggestions and chart series are not rewritten. A meter or profile on a retired device gets device.replaced.
When a report both collapses sources and changes the reporting source's device type, the re-home commits first and the collapse is queued as a collapse job that runs in a second transaction. A job that keeps failing retries with backoff. From the fifth attempt (CollapseStuckAlerts.Threshold) it raises the Error alert device.collapse_stuck on the plugin instance, naming the owning device, the replaced devices and the last error. While it is stuck the plugin already reports the collapsed device, so triggers and commands on the replaced ones stop working. The alert clears when the job completes, or when its source or instance is removed.
Command log maintenance
The command cleanup job runs once a minute on one replica. It marks pending commands older than five minutes as timed out and deletes command history older than 90 days.
Model events
GET api/devices/{id}/model-events?limit= returns the device's model events, newest first (default 100, at most 500), within DeviceModel:EventRetention. Each has an origin, a classification (None, Additive, Breaking or Mixed), typed deltas and the renumber map. It needs devices.view and access to the device. For a device that was removed, access rules no longer exist, so only a caller with devices.manage can read the events.
Delta kinds are channel-added, channel-removed, channel-renumbered, channel-identity-changed, channel-label-changed, channel-controllability-changed, capability-added, capability-removed, capability-kind-changed, capability-controllability-changed, capability-label-changed, value-domain-changed (min, max, step, unit), option-metadata-changed, option-added, option-removed, allowed-tokens-cleared, allowed-tokens-restricted, criticality-changed, device-type-changed and device-type-assigned. Removing an option or restricting the allowed tokens is breaking. Adding one or clearing the restriction is additive.
Matter exposure annotation
When a structural change alters the endpoints Reeve exposes to Matter for a device whose exposure is switched on, and the reporting source is the active one, the event records which endpoints were removed, re-identified, made read-only, made controllable again or added. The warning alert device.exposure_changed is raised when an endpoint was removed, re-identified or made read-only, because Google Home and Apple Home treat those as new or broken accessories, and you must re-add the device there. Failover, source removal and passthrough changes announce nothing.
The endpoints follow the Matter bridge's mappers: a switch or outlet has one endpoint per declared channel, or a default endpoint 0 (never commandable) when it declares none; a scene controller has one button endpoint per declared channel; other types have a single endpoint. Unknown devices have none. An endpoint is commandable only while its capability and its channel both are.
A re-home re-identifies every endpoint of the old device. A collapse into an exposed device raises the alert whenever exposed devices it replaced were retired, moved or lost their active source, and adds the "re-add" sentence. An unexposed device that receives the exposure appears as a new accessory. The annotation is an approximation for sensors and coordinators, whose endpoints depend on bridge configuration. A sensor that declares only capabilities the bridge ignores can raise a spurious alert.
Re-discovery
POST api/devices/sources/{sourceId}/rediscover (devices.manage) asks the source's plugin to describe the device again and answers 202 with a job. GET …/rediscover/{jobId} (devices.view) reads it.
| Status | When |
|---|---|
202 |
A job was queued, or an open job for that source already exists and is returned. |
404 |
The source, or the job, is not visible to the caller or token scope. |
422 |
The plugin instance runs on this replica and does not support redescribe. |
The job has a state and a failure reason. Its revalidation is pending until the scan that follows the applied model event is done, and absent when no event was applied. The deadline is DeviceModel:RedescribeCallTimeout (2 minutes), plus Cluster:LeaseTtl when clustered. A plugin instance this replica does not run is asked through a peer replica.
| Failure reason | Meaning |
|---|---|
not-supported, unreachable |
The plugin reported it cannot redescribe, or the device cannot be reached. |
plugin-error |
The plugin call threw. |
plugin-not-running |
No replica runs the plugin instance, or the source row is gone. |
no-owner |
Peers exist but none owns the connection by the deadline. |
timeout |
The plugin call exceeded DeviceModel:RedescribeCallTimeout. |
invalid-descriptor |
The result omits the device or carries an invalid descriptor. |
apply-failed, registration-failed |
The result could not be applied or the device could not be registered. |
invalid-options, unknown-result, handler-failed |
Malformed options, an unrecognised result, or an unexpected handler failure. |
The web app offers Rediscover in the More actions menu of a source's page when the physical device detail reports supportsRedescribe. The result stays on screen while a job exists.
Model event and job maintenance
Model events and finished jobs are kept for DeviceModel:EventRetention (30 days; 1 to 3650 days) and outlive the device. Revalidation jobs are durable. A failed job retries with backoff (DeviceModel:ErrorBackoff, 5 s, doubling to 30 s). Workers claim jobs under leases (DeviceModel:LeaseDuration, 2 minutes, renewed every LeaseRenewalInterval, 30 s), so a crashed or stopped host's jobs are recovered by the next claimant and several replicas never run one job twice. See Configuration for the options.
A revalidation of a structural event is one job per event. Passthrough jobs for a device merge into one queued job, with the changed keys combined. After a report that leaves the descriptor unchanged, a device that still has an open Warning (other than device.channel.labels-orphaned) and no source awaiting description gets one settle scan. It judges the whole device at structural severity, so a warning no source resolves becomes an Error and disables its automation.
Scene activation
Scene activation checks each device's assignments against the same validation as the command path, one assignment at a time. A refused action is skipped and reported in SkippedActions with a Reason and, when the target was refused, a Code. The remaining actions of the device are sent as one command. The device command API stays all-or-nothing.
| Reason | Meaning |
|---|---|
UnparseableValue |
The stored value is missing, malformed or of the wrong kind. |
ValidationRejected |
The descriptor or catalogue refused the action. Code names why. |
TypedCommandsNotSupported |
The plugin has not opted in to typed commands. |
DeviceNotFound |
The device was removed. |
DeviceAccessDenied |
The activating user cannot control the device. Every action of the device is skipped. |
DeviceTimeout |
The adapter did not answer in time. The device may still have applied the command. |
DeviceOffline |
The device has no active source. |
CommandFailed |
The plugin reported the command was not carried out. Detail is its reason. |
DispatchedActionCount counts only the actions the plugin took. Devices are dispatched in parallel, at most 8 at a time. A scene whose action list contains null is rejected with 400. The system caller (Guid.Empty) is exempt from the scene access check.
Troubleshooting
| Symptom | Cause and fix |
|---|---|
| Merging two devices loses grants, cloud exposure and history | The merged-away device is removed and everything keyed to it goes with it. Its references move to the target (see Merging), except where the target already had its own. Merge into the device that carries the configuration, then re-create what was on the other. |
| Removing the last source removes the whole device | An active device always has a source. The response says which happened. |
| Deleting or resyncing a plugin instance destroys state, grants, telemetry and events | Deleting an instance removes its devices. Uninstalling a plugin type is refused while any instance exists. Scene actions, triggers and widgets that named the devices stay and show the device as removed. Export your configuration first. |
| A scene action stops firing after an upgrade | A stored capability-kind ordinal decodes as a different kind and the action is refused. Capture the scene action again. |
| A device shows a stale type and its new controls refuse to work | It was classified from an incomplete first read. When the plugin reports the corrected type, the source moves to a new device. Re-point the automations, scenes, profiles and workflows that used the old one, then re-enable the automations it blocked. Unrepaired references keep a device.replaced finding. |
| A control the device supports is not shown | The capability is missing from that instance's descriptor. The fix is in the driver. |
| A command is refused with a range or token error | Per-instance bounds and token sets are enforced by the server. The driver's declared domain is the contract. |
| A slider loses its bounds | The declared range was outside the canonical range and was dropped. Convert it to the canonical unit in the driver. |
| A device renamed itself after a plugin update | Nobody had renamed it, so it follows its primary source's name. Rename it to pin the name. |
| A source name reverts to the vendor's name | The vendor name refreshes on every discovery. Rename the source to pin your own. |
| Two gangs of a multi-gang socket both read "State" | The vendor labels gangs identically. Name each gang. |
| A cumulative meter reads far too high | Delta measurements sum duplicates. Equal-instant repeats are skipped. If it persists, the driver re-reports under a frozen clock. |
| An automation fires from an old reading | Out-of-order reports are suppressed. If it still happens, the report claims a timestamp newer than it is. |
| History of a merged device cannot be split by source | Telemetry is keyed by logical device and cannot be re-attributed to a source afterwards. |
| An automation was disabled by a model error | Read the findings in its form. Repair the reference, or wait for the plugin to declare the target again. It resumes when no blocking error is left. |