Skip to content

@mega-yfue/eufy-sdk / EufyDevice

Interface: EufyDevice

Normalised device record, regardless of which API produced it.

Properties

api

ts
api: ApiBackend;

Which cloud API owns this device.


category

ts
category: string;

Anker category string: eufy_security | eufy_mega | eufy_home …


deviceClass

ts
deviceClass: DeviceClass;

lastSeenMs?

ts
optional lastSeenMs?: number;

The most recent paramUpdatedAt across all of this device's params, in milliseconds (comparable to Date.now() directly). undefined when the record carried no timestamp at all.

This is an observation — "the device last reported at T" — deliberately not a reachability verdict. How long a silence means "unreachable" depends on the device (a mains camera heartbeats constantly; a battery sensor may be quiet for days by design), so the threshold is the caller's to choose; the SDK reports the fact.


model

ts
model: string;

name?

ts
optional name?: string;

p2pDid?

ts
optional p2pDid?: string;

Present (and non-empty) for P2P devices.


params?

ts
optional params?: Record<number, string>;

Device state data points (param_type → param_value), exactly as the cloud record carries them. Raw and unnamed: the capability surface resolves these into named properties. Device.inspect labels them for troubleshooting.

Not a realtime source. These are refreshed server-side on the device's own cloud heartbeat, which is slow: measured across a live fleet, the freshest param on an active device was ~12 minutes old, and the per-device get_device_param_list call returns the same staleness as the bulk list (so fetching harder does not make them fresher). They are a coarse state snapshot plus liveness evidence (paramUpdatedAt); realtime state arrives over push / P2P / MQTT.


paramUpdatedAt?

ts
optional paramUpdatedAt?: Record<number, number>;

When each param in params was last written server-side (param_typeunix SECONDS, the wire's own update_time unit — not milliseconds). The device heartbeats its params up to the cloud, so these are the freshest liveness evidence available without opening a transport.

Sparse by construction: a param the record delivered without an update_time has no entry here.


raw?

ts
optional raw?: unknown;

Raw record from the source API, for fields not yet normalised.


realtime

ts
realtime: RealtimeKind;

Which realtime transport carries its live state/commands.


sn

ts
sn: string;

stationSn?

ts
optional stationSn?: string;

The station this device's traffic belongs to: its parent HomeBase, or its own serial when it has none.

parent_sn carries the parent on an attached device. station_sn is frequently absent there — empty on every attached sensor of a T8010 — and serves only as a fallback for a device naming no parent.

Independent and unofficial. Not affiliated with, endorsed by, or sponsored by Anker Innovations, Anker eufy, or eufy. "Anker eufy", "eufy" and "Anker" are trademarks of their respective owners. Use responsibly — rapid or failed logins can trigger captcha or temporary cooldowns.