motion
Span timeout for a camera's attached sensors.
Span timeout for a camera's attached sensors. This is the pipeline-runner motionCooldownMs default: the window after which a heartbeat-only edge no longer counts. The span does not declare a separate cooldown.
At a glance
| Capability | motion |
| Provided by | The device's own driver provides it: each device registers its own provider. |
| Active providers per device | one |
| Device types | camera, sensor |
| Source | packages/types/src/capabilities/motion.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 |
|---|---|---|---|
isDetected | query | yes | default |
isDetected
query
Pull the current motion state synchronously. Convenience shortcut for consumers that don't need the full status object. A composed group answers from its slice: unknown throws, it is not off.
Input
No fields besides deviceId.
Output
boolean
Runtime state
The state Dominevo keeps for each device with this capability, readable without calling the provider.
Runtime-state slice — the last observed motion snapshot, mirrored by the kernel and readable cross-process via device.state.motion.value. Reads never invoke the provider, so UIs and other addons can poll the cached state safely.
| Field | Type | Required | Description |
|---|---|---|---|
detected | boolean | yes | |
lastDetectedAt | number | null | yes | Ms epoch of the last detected-true observation. Null if never detected. |
autoClearAfterMs | number | null | yes | MOTION_CLOSE_AFTER_MS while detected: true on a Camera device, null while false and on every Sensor device — see that constant's doc for the one-authority rule. |
Events
onMotionChanged
Fires every time the runner transitions a camera between watching and active phases. source carries which motion path drove the transition; regions is populated only for source: 'analyzer' (frame-diff regions from the ML motion detector) — onboard sources don't carry per-frame regions here (camera-provided zones / AI metadata live in dedicated channels: detection.camera-native, future zone capability).
Consumers that want all motion pushes (even with detected unchanged) should subscribe to the status subscription via device-manager.subscribeDeviceStatusAggregate instead.
| Field | Type | Required | Description |
|---|---|---|---|
deviceId | number | yes | |
detected | boolean | yes | |
timestamp | number | yes | |
source | "onboard" | "analyzer" | "device-activity" | yes | |
regions | ({ bbox: { x: number; y: number; w: number; h: number }; pixelCount: number; intensity: number })[] | no | |
triggeredBy | { kind: "camera" } | { kind: "sensor"; deviceId: number } | no | Who started it. Absent = the camera itself. Only onboard carries sensor. |