zones
Zones capability — per-camera CRUD over polygon detection zones.
Zones capability — per-camera CRUD over polygon detection zones.
Provider lives in addon-pipeline-orchestrator (hub-only). Persists to per-device settings and mirrors into the zones device-state slice on every mutation, so downstream consumers can subscribe via dev.state.zones.onChanged.
The cap surface only handles geometry + identity; filtering behaviour (per-class, include/exclude, threshold) lives in the consumer addons' rule arrays — see ZoneRuleSchema exported from capabilities/schemas/zone-rule.js.
At a glance
| Capability | zones |
| Provided by | One addon provides it for every device and answers by device id. |
| Active providers per device | one |
| Device types | camera |
| Source | packages/types/src/capabilities/zones.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 |
|---|---|---|---|
listZones | query | yes | default |
addZone | mutation | yes | admin |
removeZone | mutation | yes | admin |
updateZone | mutation | yes | admin |
listZones
query
Input
No fields besides deviceId.
Output
({ id: string; name: string; kind?: "polygon" | "tripwire"; polygon: ({ x: number; y: number })[]; color?: string })[]
addZone
mutation
Input
| Field | Type | Required | Description |
|---|---|---|---|
zone | { id: string; name: string; kind?: "polygon" | "tripwire"; polygon: ({ x: number; y: number })[]; color?: string } | yes |
Output
Nothing.
removeZone
mutation
Input
| Field | Type | Required | Description |
|---|---|---|---|
zoneId | string | yes |
Output
Nothing.
updateZone
mutation
Input
| Field | Type | Required | Description |
|---|---|---|---|
zone | { id: string; name: string; kind?: "polygon" | "tripwire"; polygon: ({ x: number; y: number })[]; color?: string } | yes |
Output
Nothing.
Runtime state
The state Dominevo keeps for each device with this capability, readable without calling the provider.
Runtime-state slice — the live zone catalogue mirrored by the orchestrator on every CRUD mutation. Consumers read via device.state.zones.value / .watch(...) without round-tripping the cap, and the codegen DeviceProxy auto-wires the reactive handle. Slice shape is { zones: Zone[] } so future extensions (e.g. zone groupings) can sit alongside the polygon list.
| Field | Type | Required | Description |
|---|---|---|---|
zones | ({ id: string; name: string; kind?: "polygon" | "tripwire"; polygon: ({ x: number; y: number })[]; color?: string })[] | yes |