Dominevo
ReferenceDevice capabilities

event-emitter

Generic stateless event emitter.

Generic stateless event emitter. Installed on a DeviceType.EventEmitter device. Carries the device's EXACT declared event vocabulary verbatim (NO normalization). Two shapes:

  • structured source (HA event.* entity) → vocabulary is the fixed declared set (e.g. press_short, press_long, …).
  • generic/legacy source (HA bus events, e.g. zha_event) → vocabulary is [] (open) and lastEvent.data carries the complex payload. vocabulary names each event for a person and types it for a rule; eventTypes is its list of native tokens, kept for older readers. A fire names the part of the device it came from in sourceId when the vocabulary declares sources (a remote's buttons). seq is monotonic so two identical events still produce distinct slice writes.

At a glance

Capabilityevent-emitter
Provided byThe device's own driver provides it: each device registers its own provider.
Active providers per deviceone
Device typesevent-emitter
Sourcepackages/types/src/capabilities/event-emitter.cap.ts

Methods

This capability declares no methods.

Runtime state

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

FieldTypeRequiredDescription
eventTypesstring[]yes
vocabulary({ id: string; source?: { id: string; label: string }; label: string; description?: string; kind?: "press" | "long-press" | "long-press-start" | "release" | "repeat" | "double-press" | "other"; payload?: ({ path: string;…no (default [])Required of a provider by the type. A status written before the field existed still parses, as an empty vocabulary: read it through readEventVocabulary, which then answers with the plain tokens.
lastEvent{ deviceId: number; eventType: string; sourceId?: string; data: Record<string, unknown> | null; timestamp: number; seq: number } | nullyes
eventCountSinceStartnumberyes

Events

onEvent

FieldTypeRequiredDescription
deviceIdnumberyes
eventTypestringyes
sourceIdstringno
dataRecord<string, unknown> | nullyes
timestampnumberyes
seqnumberyes