eufy-mega / model/capabilities / DeviceEventMap
Interface: DeviceEventMap
The typed event surface, keyed by semantic event name → payload type. THE projection point for events (the sibling of DeviceActionMap): a capability that emits a new event name adds one line here. EufyMega's typed on/once/off/emit overloads are derived from this map, so eufy.on("motion", e => e.deviceSn) autocompletes the name and types the payload. Names MUST match the module emit: / decodeEvent event: strings.
Properties
alarm
alarm: PushSemanticEvent & object;Station alarm lifecycle; phase says whether it fired or is counting down.
Type Declaration
phase?
optional phase?: "triggered" | "delayed";armingModeChanged
armingModeChanged: PushSemanticEvent;The guard mode changed. Carries no mode value — re-read the current mode.
batteryAlert
batteryAlert: PushSemanticEvent & object;Battery alert — state discriminates low / hot / full.
Type Declaration
state?
optional state?: "low" | "hot" | "full";batteryLevel
batteryLevel: PollSemanticEvent;Battery level changed (poll). to is the new 0–100 level.
contactState
contactState: PushSemanticEvent & PollSemanticEvent & object;Entry sensor opened/closed. Arrives via push (seconds) or cloud poll (minutes), which carry the state under different raw keys — read open, which both normalise to. Absent when the signal carried no contact value, so undefined means "not reported here", not "closed".
Type Declaration
open?
optional open?: boolean;cryingDetected
cryingDetected: PushSemanticEvent;Crying detected (indoor/baby-monitor families).
dogDetected
dogDetected: PushSemanticEvent & object;A dog was detected; kind distinguishes the licking/fouling sub-events when the device reports one.
Type Declaration
kind?
optional kind?: "lick" | "poop";doorbellPress
doorbellPress: PushSemanticEvent;Doorbell button pressed.
lockState
lockState: PushSemanticEvent;Lock (un)locked or a lock alarm fired.
motion
motion: PushSemanticEvent;Motion detected (camera / PIR sensor).
packageDelivered
packageDelivered: PushSemanticEvent;A package was delivered (drop/porch).
packageStranded
packageStranded: PushSemanticEvent;A delivered package has been left unattended too long.
packageTaken
packageTaken: PushSemanticEvent;A previously-delivered package was taken.
personDetected
personDetected: PushSemanticEvent;A recognized/known or stranger person detected.
petDetection
petDetection: PushSemanticEvent;Pet detected.
ptzNotify
ptzNotify: SemanticEventBase & object;Pan/tilt status streamed while the camera moves.
Type Declaration
coords?
optional coords?: [number, number][];kind
kind: "zoom" | "rotate" | "position";payload?
optional payload?: unknown;smartLightState
smartLightState: SemanticEventBase & object;A eufy_life smart light reported its state (secure-MQTT DP status report). Every field is optional: a report carries only the fields the device sent, and an absent one is silence about that field rather than a change to it.
Type Declaration
brightness?
optional brightness?: number;cloudEffectId?
optional cloudEffectId?: number;colorGradient?
optional colorGradient?: boolean;effectId?
optional effectId?: number;lightLength?
optional lightLength?: number;power?
optional power?: boolean;soundDetected
soundDetected: PushSemanticEvent;Sound above the configured threshold.
strangerDetected
strangerDetected: PushSemanticEvent;A person the device does NOT recognise (distinct from personDetected).
vehicleDetected
vehicleDetected: PushSemanticEvent;A vehicle was detected.