Dominevo
ReferenceDevice capabilities

siren

Timed siren: trigger the siren for a duration and know until when it sounds.

Timed siren: trigger the siren for a duration and know until when it sounds.

The plain on/off switch of a siren stays as it is (HomeKit / Alexa see a switch); this cap adds the part a switch cannot say — HOW LONG, and the moment the siren is expected to fall silent (activeUntil, epoch ms), so a UI can show the activation with a countdown.

What the camera counts natively.

At a glance

Capabilitysiren
Provided byThe device's own driver provides it: each device registers its own provider.
Active providers per deviceone
Device typessiren
Sourcepackages/types/src/capabilities/siren.cap.ts

Methods

Every method takes the device id (deviceId) to address the device; the input tables below list the other fields.

MethodKindRequired of a providerAccess
getOptionsqueryyesprotected
getPlayChoicesqueryyesprotected
triggermutationyesprotected
stopmutationyesprotected

getOptions

query

The durations the camera allows, read from the camera.

Input

No fields besides deviceId.

Output

FieldTypeRequiredDescription
allowedSecondsnumber[] | nullyesDiscrete durations in seconds the operator may pick; null when the camera gives a range.
rangeSeconds{ min: number; max: number; step: number } | nullyesContinuous range in seconds; null when the camera gives a discrete list.
defaultSecondsnumberyesThe camera's default duration, seconds.
allowedPlaysnumber[] | nullno (default null)Discrete play counts the operator may pick; null when the camera gives a range or does not count plays. Defaults to null so a provider that predates plays (#589) reads as declaring none.
rangePlays{ min: number; max: number; step: number } | nullno (default null)Continuous range of play counts; null when listed or not counted.
defaultPlaysnumber | nullno (default null)The camera's default play count; null when the camera does not count plays.
unit"seconds" | "plays"yesWhat the camera counts natively.
secondsPerPlaynumber | nullyesSeconds one play lasts, when unit is plays; null for a seconds camera.
source"camera" | "fallback"yescamera when the values were read from it, fallback when the camera could not say.
fetchedAtnumberyesMs epoch of the read that produced this answer.

getPlayChoices

query

The play counts a rule may pick: what getOptions declares as a list, or its range spelled out. Empty for a siren that counts seconds.

Input

No fields besides deviceId.

Output

number[]

trigger

mutation

Sound the siren for durationSeconds OR plays — never both. With neither the camera default applies. A count on a siren that declares no plays is refused. Answers the state at the moment of the trigger (activeUntil included).

Input

FieldTypeRequiredDescription
durationSecondsnumberno
playsnumberno

Output

FieldTypeRequiredDescription
activebooleanyesTrue while the siren is sounding by a timed trigger or switched on.
activeUntilnumber | nullyesMs epoch the siren is expected to fall silent; null when not active or open-ended.
durationSecondsnumber | nullyesDuration of the current / last activation, seconds; null when none yet.
playsnumber | nullno (default null)The play count of the current / last activation when it was asked in plays; null when it was asked in seconds (or none yet). The unit that was asked.
activeUntilEstimatedbooleanno (default false)True when activeUntil comes from a seconds-per-play factor the camera did not report — the siren may fall silent somewhat earlier or later.
lastTriggeredAtnumberyesMs epoch of the last trigger (0 = never).

Actions (offered in automations and on device cards)

ActionLabelSets
siren.triggerSound the siren
siren.triggerPlaysSound the siren N times

stop

mutation

Silence the siren now.

Input

No fields besides deviceId.

Output

FieldTypeRequiredDescription
activebooleanyesTrue while the siren is sounding by a timed trigger or switched on.
activeUntilnumber | nullyesMs epoch the siren is expected to fall silent; null when not active or open-ended.
durationSecondsnumber | nullyesDuration of the current / last activation, seconds; null when none yet.
playsnumber | nullno (default null)The play count of the current / last activation when it was asked in plays; null when it was asked in seconds (or none yet). The unit that was asked.
activeUntilEstimatedbooleanno (default false)True when activeUntil comes from a seconds-per-play factor the camera did not report — the siren may fall silent somewhat earlier or later.
lastTriggeredAtnumberyesMs epoch of the last trigger (0 = never).

Actions (offered in automations and on device cards)

ActionLabelSets
siren.stopSilence the sirenactive = false

Runtime state

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

FieldTypeRequiredDescription
activebooleanyes
activeUntilnumber | nullyes
durationSecondsnumber | nullyes
playsnumber | nullno (default null)
activeUntilEstimatedbooleanno (default false)
lastTriggeredAtnumberyes
lastFetchedAtnumberyesMs epoch of the last successful camera read of the options (0 = never).

Status

FieldTypeRequiredDescription
activebooleanyesTrue while the siren is sounding by a timed trigger or switched on.
activeUntilnumber | nullyesMs epoch the siren is expected to fall silent; null when not active or open-ended.
durationSecondsnumber | nullyesDuration of the current / last activation, seconds; null when none yet.
playsnumber | nullno (default null)The play count of the current / last activation when it was asked in plays; null when it was asked in seconds (or none yet). The unit that was asked.
activeUntilEstimatedbooleanno (default false)True when activeUntil comes from a seconds-per-play factor the camera did not report — the siren may fall silent somewhat earlier or later.
lastTriggeredAtnumberyesMs epoch of the last trigger (0 = never).

Events

onSirenChanged

FieldTypeRequiredDescription
deviceIdnumberyes
activebooleanyes
activeUntilnumber | nullyes