Dominevo
ReferenceDevice capabilities

scene-monitor

scene-monitor — device-scoped reference-region state cap.

scene-monitor — device-scoped reference-region state cap. An operator marks a rect ROI on a camera frame and names one or more states; the engine (pipeline-analytics, designated post-processing node) reports which state is active on an ongoing basis. Two operator-selectable check modes share every- thing except the comparator: similarity (CLIP cosine at the same ROI coords vs condition-tagged references) and llm (vision-LLM judgment over the crop).

That is the wrong shape for the thing: a scene is a standing question about the property ("is the bin still out"), and the operator's question is "which of my scenes have tripped", across every camera at once — not "what does camera 102 think". Buried one camera deep it also could not be found. The surface is now a top-level admin page (/scenes, pages/Scenes.tsx) that lists every scene on every camera and picks the camera inside the create flow, the same shape Events and Faces have.

The consequence to keep in mind: host/scene-monitor-editor is gone from HOST_WIDGETS too. scripts/check-host-widget-resolves.ts asserts BOTH directions, so a registration nobody declares fails exactly as loudly as a declaration nobody registers. The editor is imported directly by the page.

status.kind:'push' — the engine pushes on every hysteresis flip / availability change; consumers never poll.

Extensible condition tag. Seeded 'day' | 'ir' (the two variants the operator captures) plus 'night' | 'dawn' | 'dusk' from the resolver's sun-times band. Open by design so more can be added without a wire break.

Matching does NOT fall back across conditions: cross-condition cosines are not comparable, so "I have never seen this scene in this light" is reported as unknown, never guessed. A day reference scored against an IR frame collapses the cosine and would latch a false alarm every single night.

At a glance

Capabilityscene-monitor
Provided byAn addon wraps the device and provides it. It is bound to a device through the device bindings and can be bound automatically to compatible devices.
Active providers per deviceone
Device typescamera
Sourcepackages/types/src/capabilities/scene-monitor.cap.ts

Methods

MethodKindRequired of a providerAccess
listScenesqueryyesdefault
listScenesBatchqueryyesdefault
createScenemutationyesadmin
updateScenemutationyesadmin
deleteScenemutationyesadmin
captureReferencemutationyesadmin
deleteReferencemutationyesadmin
recheckNowmutationyesadmin
resetScenemutationyesadmin

listScenes

query

Input

FieldTypeRequiredDescription
deviceIdnumberyes

Output

FieldTypeRequiredDescription
monitors({ id: string; label: string; roi: { kind: "rect"; x: number; y: number; width: number; height: number }; enabled: boolean; triggerMode: "periodic" | "on-motion" | "both"; checkIntervalSec?: number; check: { mode: "simil…yes
lastFetchedAtnumberyes

listScenesBatch

query

The same answer, for a SET of cameras, in one round trip.

/scenes renders every camera and re-reads them on a 30s safety-net poll behind the push slice. Fanned out client-side that was one query per camera — 29 round trips through the browser, the hub and the post-analysis runner every 30 seconds to read an in-memory map the owner had already merged. The work is unchanged (statusFor per device, all in-process at the owner); what collapses is the transport.

A camera that cannot answer still gets a row, with status: null — see { ids: a caller that asked for twenty-nine and got twenty-seven cannot tell which two are missing, or that any are.

Input

FieldTypeRequiredDescription
deviceIdsnumber[]yes

Output

({ deviceId: number; status: { monitors: SceneMonitorSchema[]; lastFetchedAt: number } | null })[]

createScene

mutation

Input

FieldTypeRequiredDescription
deviceIdnumberyes
labelstringyes
roi{ kind: "rect"; x: number; y: number; width: number; height: number }yes
check{ mode: "similarity"; threshold: number; hysteresisCount: number } | { mode: "llm"; prompt: string; profileId?: string; hysteresisCount: number }yes
triggerMode"periodic" | "on-motion" | "both"no
checkIntervalSecnumberno

Output

FieldTypeRequiredDescription
idstringyes
labelstringyes
roi{ kind: "rect"; x: number; y: number; width: number; height: number }yes
enabledbooleanyes
triggerMode"periodic" | "on-motion" | "both"yes
checkIntervalSecnumberno
check{ mode: "similarity"; threshold: number; hysteresisCount: number } | { mode: "llm"; prompt: string; profileId?: string; hysteresisCount: number }yes
states({ id: string; label: string; references: ({ embedding: number[]; modelId: string; condition: string; capturedAt: number; thumbnailMediaId?: number; anchorEmbedding?: number[] })[]; textPrompts?: string[]; referenceCount…yes
currentStateIdstring | nullyes
lastCheckedAtnumber | nullyes
lastConfidencenumber | nullyes
currentConditionstring | nullyes
availability"ok" | "unavailable"yes
unavailableReasonstring | nullyes
baselineStateIdstring | nullyesNo mode: 'boolean' | 'states' field: it would be a second source of truth over a distinction the data already makes (states.length === 1). Which state is "the initial screen". null until the first capture.
emit"latched" | "live"no (default "latched")Which boolean drives notification rules and any export.
verdict"matched" | "diverged" | "unknown"yesLive: does the region match the baseline RIGHT NOW.
latchedbooleanyesHas it been diverged at least once since armedAt — the operator's boolean.
armedAtnumberyesLast reset (or creation).
divergedAtnumber | nullyes
restoredAtnumber | nullyes
quietSecondsnumberno (default 60)A check is only COUNTED when the device has been quiet this long. Motion during the window DISCARDS the observation — a car pulling up in front of the bin must not be able to spend hysteresis credit.
minObservationSpacingSecnumberno (default 120)
confirm{ enabled?: boolean; prompt: string; profileId?: string; timeoutMs?: number; maxImagePx?: number; onTimeout?: "flip" | "hold" }noVision-model adjudication of a candidate flip. Similarity primary only.
anchorThresholdnumberno (default 0.85)Whole-frame anchor cosine below which a flip is REFUSED as view-shifted.
autoRestorebooleanno (default false)Clear the latch on its own when the scene matches again? Default false — restoredAt and the scene-restored edge are recorded regardless, so an automation can react to the bin coming back without the operator's own alarm silently clearing itself.
onUncoveredCondition"skip" | "judge-anyway"no (default "skip")What to do when the current light has no reference of its own. See {
suspendedConditionstring | nullno (default null)The light whose checks are currently being SAT OUT under onUncoveredCondition: 'skip' — null when the scene is checking normally. Engine-reported and advisory only: it moves no verdict, no latch and no hysteresis. It exists so the card can say "night (IR) — checks paused, nothing captured in this light" in the same calm voice as the coverage line, because the alternative is a scene that silently stops answering after sunset with nothing anywhere saying why. A skipped check must never read as a broken one.
unavailable"no-reference-for-condition" | "view-shifted" | "no-vision-profile" | "encoder-model-changed" | "no-snapshot" | nullyesNamed cause when verdict === 'unknown'.
coveredConditionsstring[]yesConditions that have at least one comparable reference — the coverage line ("day ✓ · ir ✓ · dusk ✗") that turns a silent fallback into a visible fact.

updateScene

mutation

Input

FieldTypeRequiredDescription
deviceIdnumberyes
monitorIdstringyes
patch{ label?: string; roi?: { kind: "rect"; x: number; y: number; width: number; height: number }; enabled?: boolean; triggerMode?: "periodic" | "on-motion" | "both"; checkIntervalSec?: number; check?: { mode: "similarity"; …yes

Output

Nothing.

deleteScene

mutation

Input

FieldTypeRequiredDescription
deviceIdnumberyes
monitorIdstringyes

Output

Nothing.

captureReference

mutation

Input

FieldTypeRequiredDescription
deviceIdnumberyes
monitorIdstringyes
stateIdstringno
labelstringno
conditionstringno

Output

FieldTypeRequiredDescription
stateIdstringyes
referenceCountnumberyes

deleteReference

mutation

Input

FieldTypeRequiredDescription
deviceIdnumberyes
monitorIdstringyes
stateIdstringyes
indexnumberyes

Output

Nothing.

recheckNow

mutation

Input

FieldTypeRequiredDescription
deviceIdnumberyes
monitorIdstringyes

Output

Nothing.

Actions (offered in automations and on device cards)

ActionLabelSets
sceneMonitor.recheckRe-check a scene

resetScene

mutation

Clear the latch, re-arm, and — by default — RE-CAPTURE the baseline for the CURRENT condition. The bin never goes back in exactly the same spot; "reset" in the operator's head means this is the new normal, and re-capture is what makes the feature self-healing against slow drift instead of failing silently weeks later.

Reachable from three surfaces on this one mutation: the scene card, a notification button (an onTrigger sequence with a kind:'command' step — no new Notification-Center code at all), and tRPC for scripts.

Input

FieldTypeRequiredDescription
deviceIdnumberyes
monitorIdstringyes
recapturebooleannoDefaults to TRUE at the provider seam — see SCENE_RESET_RECAPTURES.

Output

Nothing.

Runtime state

The state Dominevo keeps for each device with this capability, readable without calling the provider.

FieldTypeRequiredDescription
monitors({ id: string; label: string; roi: { kind: "rect"; x: number; y: number; width: number; height: number }; enabled: boolean; triggerMode: "periodic" | "on-motion" | "both"; checkIntervalSec?: number; check: { mode: "simil…yes
lastFetchedAtnumberyes