github mega-yfue/eufy-sdk v0.2.0

latest releases: v0.5.0, v0.4.0, v0.3.0...
one month ago

The biggest release so far. Anker Solix support arrives, a HomeBase can now stream several cameras at once, and a station that can't be reached or addressed now fails with a typed error and a trace, where it used to be a silent wait.

npm install @mega-yfue/eufy-sdk@0.2.0

Anker Solix

The same eufy account also signs in to Anker's Solix cloud, and devices report live over the AWS-IoT plane. The SDK keeps that stream armed without the app being open.

  • Smart Meter (AE1X0). Per-line voltage, current and power, total power, and import/export energy.
  • Solarbank 4 (AE103).
    • Readings: state of charge, temperature, battery health, battery / AC / grid / home power, the four solar inputs, grid import and export limits, backup reserve and expansion-pack count.
    • Writable: ambient light, display timeout, and charge/discharge limits.
  • Sites. Devices are grouped the way the app shows them ("My Home"), and classified by product family.

Several cameras per HomeBase

A HomeBase serves one camera per session, not per station. A second camera asked for while the station's session is busy now gets a media session of its own instead of StationBusyError. Two attached cameras stream concurrently at full rate.

When a station doesn't answer

  • StationUnreachableError and StationKeyUnavailableError say which station failed and why. The wait now ends on the session's own deadline (15 s) instead of five seconds past it.
  • DeviceChannelUnresolvedError covers a device whose channel on its HomeBase is missing, or shared with another attached device. It's refused instead of addressed on a guessed channel, which could stream a different camera's video under its name.
  • Live traces state what a call was resolved to before anything is sent.

Devices

  • Smart Display has its own device line.
  • Vacuums: run a scene, a room set or a zone set, and choose cleaning type, extent and mop level.
  • Arming: custom1, and every guard mode a station reports.
  • Locks: locked state and battery.
  • Classification: T8200 is typed as a doorbell, T9000 as a station. The HomeBase-as-chime switch now has a setter.
  • Detections: mains-powered cameras no longer report a phantom battery, and detections are described only where the device evidences them.

Fixes

  • gtoken not equal userid. Accounts whose Anker cloud id differs from their eufy user id failed every authenticated read. Fixed.
  • A still gives its station back. A standalone station without a session key can be sent a set-payload.
  • A v2 event thumbnail no longer costs ~45 MB of memory to reconstruct.
  • Bounded token-replacement rate, a pinnable acting account name, and realtime connections identified by install.

Breaking changes

New LiveTrace phases: lookup-channels and station-channel-unresolved. A host that types an exhaustive table over LiveTrace phases (for example a Record keyed by LiveTrace["phase"]) stops compiling on 0.2.0 with TS2741 on the missing key. Add an entry for both phases before it compiles. This is the one break confirmed against a real downstream build.

Also removed or changed since 0.1.2:

Change What to do
StationBusyError removed (#168) Drop the catch. A second camera on a busy station now gets its own session and streams.
autoContrast removed (#195) The v2 thumbnail is no longer re-encoded, so there's nothing to call. Drop the import.
generateMqttUuid removed (#160) Derive a stable id with mqttUuidFrom(seed) instead of generating a random one per run.
getP2pSessions() also lists media sessions, keyed <stationSn>#live:<channel> (#168) Don't assume every key is a station serial.
An attached device with a missing or shared channel is refused with DeviceChannelUnresolvedError (#226) Handle the error. Previously it was sent to channel 0, or lost to list order.

Thanks to everyone who contributed to this release: @martijnpoppen, @lenoxys, @rwunsch, @matt1981m and @holland-built.


All changes

What's Changed

  • fix(mqtt): identify a realtime connection by install, not by certificate by @martijnpoppen in #160
  • feat(arming): allow setting custom1 (mode_type 3) by @holland-built in #158
  • feat(p2p): typed refusals for a station, and traces for the waits before them by @lenoxys in #162
  • fix(p2p): let a still give a station back, and state when a stream re-asserts its channel by @lenoxys in #167
  • feat(vacuum): send a scene, a room set and a zone set by @martijnpoppen in #164
  • feat(display): give the Smart Display its own line, namespace and reads by @martijnpoppen in #165
  • docs(gallery): show the Smart Display, on a line of its own by @martijnpoppen in #171
  • build(docs): typecheck the guides' TypeScript snippets in CI by @martijnpoppen in #166
  • feat(arming): every guard mode the station reports, it also accepts by @martijnpoppen in #172
  • feat(solix): full Anker Solix support (login, telemetry, devices, meter, battery, arming) by @max246 in #153
  • feat(p2p)!: serve several cameras on a station at once, a connection each by @martijnpoppen in #168
  • fix(battery): a mains camera has no cell, so it reports none of one by @martijnpoppen in #170
  • fix(model): a read a device's gate withheld is not published under its name by @lenoxys in #175
  • fix(registry): type the wired T8200 as a doorbell by @rwunsch in #179
  • feat(p2p)!: state what an unreachable station was asked for, and stop waiting past the asking by @lenoxys in #177
  • Stop the v2 thumbnail reconstruction costing 45 MB a picture, and say why one failed by @martijnpoppen in #195
  • fix(session): stop reading a gtoken mismatch as an expired token by @martijnpoppen in #190
  • feat(solix): AE1X0 meter bindings + gate the tag->name table to meter frames (folds #186) by @max246 in #184
  • fix(solix): detect a Solarbank's capabilities (category trailing space + newer models) by @max246 in #185
  • feat(solix): product-family classification + SolixSite system aggregate by @max246 in #187
  • chore(deps-dev): bump @types/node from 26.5.0 to 26.5.1 in the toolchain group by @dependabot[bot] in #188
  • chore(deps-dev): bump vitepress from 2.0.0-alpha.19 to 2.0.0-alpha.20 in /docs in the docs group by @dependabot[bot] in #189
  • Solix Solarbank 4 (AE103): telemetry + ambient light / display timeout / SOC-limit controls by @max246 in #196
  • feat(client): let a caller pin the acting account name by @martijnpoppen in #198
  • fix(p2p): let the session seal a set-payload, so a keyless standalone station can be sent one by @martijnpoppen in #197
  • fix(http): put the token-replacement rate on the rejection, so a host cannot loop past it by @martijnpoppen in #208
  • feat(model): describe a detection only where the device evidences it by @martijnpoppen in #207
  • feat(vacuum): let a caller state the cleaning type, extent and mop level by @martijnpoppen in #210
  • docs(solix): cross-reference field names to Anker's official Modbus registers by @max246 in #206
  • feat(solix): expose Solarbank batteryHealth (SOH) from the a4 BMS blob by @max246 in #209
  • feat(lock): map param 6000 (locked state) and 6001 (battery) by @matt1981m in #202
  • feat(model): classify the T9000 station as the station it is by @lenoxys in #192
  • fix(doorbell): the HomeBase-as-chime switch has a captured wire, so it ships a setter by @lenoxys in #181
  • feat(solix): expose grid power limits + backup reserve (write-readback confirmed) by @max246 in #217
  • feat(solix): expose expansion battery pack count + stack ceiling by @max246 in #218
  • fix(p2p): refuse a device whose station channel is missing or shared by @max246 in #226
  • release: 0.2.0 by @max246 in #230

New Contributors

Full Changelog: v0.1.2...v0.2.0

Don't miss a new eufy-sdk release

NewReleases is sending notifications on new releases.