anker-eufy-security
Asyncio Python library and command-line tool for eufy Security systems. It talks to the HomeBase and its cameras directly over the local network, and uses eufy's cloud only for login, keys and push events. It is written for a Home Assistant integration, but it has no Home Assistant dependency and works on its own.
Home Assistant users: install the Anker eufy Integration through HACS. This package is the Python library that integration uses; Home Assistant installs it automatically, so do not add this repository to HACS.
Origin. This library is based on Alar Aun's
eufy-home-security (MIT), from
its v0.4.19 release, under its own name (anker-eufy-security, import
anker_eufy_security) so both can be installed side by side. What differs from upstream
is listed in CHANGES-FROM-UPSTREAM.md; see also
NOTICE.
Status: beta, incomplete. This is a 0.x release. It works day to day on the hardware it was developed against, but device coverage is narrow, much of the device support is unproven, and the API may change in any release. Do not make it the only thing between you and an intruder: keep the eufy app installed. Not affiliated with Anker or eufy.
What it does
-
Local P2P to the station: guard mode, status (battery, signal, storage, firmware), device settings, live video and audio, stored recordings and stills, the station's event history, and pan/tilt presets. Once connected, commands and state stay on your LAN.
-
eufy cloud (the
eufy_megabackend): login with the e-mailed code or captcha, the device list, the per-station keys a local session needs, and firmware-update notices. -
Push events over FCM: guard-mode changes made elsewhere (app, keypad, schedule), and events when the host is not on the station's LAN.
-
A session cache, so a restart needs no cloud call.
-
Per-model settings from eufy's own code: each product's settings (values, labels, units, how to write and read them) are generated from the thing description and handler the eufy app downloads, and ship with the library for 166 products.
-
Every product the eufy app names: the model list (223 serial prefixes, with kind and cloud device type) is generated from the app's own tables, so a camera is recognised as a camera even when nobody has tested it.
-
Support graded as data: every model and capability carries verified (proven on hardware), declared (from the eufy app, not proven) or unknown, with its source, so a consumer can tell what is proven.
-
MQTT transport (optional,
mqttextra): the client certificate, device selection, topics, envelope and an asyncio client for the eufy broker the app uses for its Wi-Fi locks. Declared from the eufy app, not yet tested against the broker; lock commands are not part of it yet.
Pure asyncio on aiohttp, cryptography, firebase-messaging and protobuf: no
Node.js bridge, no add-on, no threads (the optional MQTT extra's aiomqtt runs its
broker connect step, name lookup to TLS handshake, in the event loop's executor).
Status
| area | state |
|---|---|
| HomeBase 3 (T8030) with eufyCam 3 (T8160) | the primary target. Login, local session, status, guard mode, camera settings, live stream, recordings, stills, local and push events are verified on hardware |
| Battery SoloCam (T8170), standalone | guard mode, status, live stream, pan/tilt presets and control, zoom, and settings (write + read-back) verified on firmware 3.3.5.4. The camera sleeps, so each call first wakes it (seconds). From firmware 3.4.0.0 the eufy app streams most T8170 units over WebRTC (the exception: a serial whose 7th character is 2), which the library does not implement: live view and pan/tilt are then graded unknown and refused |
| Motion sensor (T8910) | battery and signal read through the station; of its settings, only the per-mode delays and actions were written |
| HomeBase 2 (T8010) | local P2P session, recording history, per-camera filtering, pagination, native playback and download verified on HomeBase 2 (firmware 3.4.2.6h) with eufyCam 2C (T8113); other eufyCam 2-series models are declared |
| other HomeBases and cameras | declared only: known from the app, never tested. Every product the app names is in the model list; settings files for 166 products ship with the library, generated from eufy's own code; a product without one is listed read-only from the cloud |
| per-mode actions and delays | readable and writable; the Home, Away and Custom 1 delays are verified by write + read-back, the action flags' names are not checked against the app |
| firmware updates | reported, never installed |
| smart locks, garage doors | declared only, never tested: lock state and events for every bundled lock model (no lock command yet), garage-door state and open/close for the garage-door cameras (T8452, T8453) |
| API | not stable: names and signatures may change in any 0.x release |
| packaging | a pure-Python wheel with typing (py.typed) on PyPI |
The full picture is in the generated support matrix and the hardware verification page. A setting comes from eufy's code, not from a test on hardware: it may be rejected by a device, and the page names the ones written and read back.
Requirements
- Python 3.13 or newer.
- A eufy Security account that can see the station: the owner's, or a member it is shared with (commands are sent on the owner's behalf).
- For local access, the fastest path is a host on the same L2 network as the station (discovery is a broadcast). A station on another subnet or at another site connects through eufy's rendezvous servers instead (outbound UDP 32100 and a cloud session for its key). Login and push work from anywhere.
- If inbound UDP is filtered: a fixed IP and a pinned local port per station.
anker-eufy-security networkprints what each station needs.
Install
uv add anker-eufy-security # the library, in a uv project (or: pip install anker-eufy-security)
uv add "anker-eufy-security[mqtt]" # with the MQTT transport (aiomqtt), for Wi-Fi locks
uv tool install anker-eufy-security # the anker-eufy-security CLI on PATH
uvx --from anker-eufy-security anker-eufy-security --help # run once
The development version: uv add "anker-eufy-security @ git+https://github.com/abz2much/anker-eufy-security",
or from a checkout uv sync && uv run anker-eufy-security --help.
Usage
Command line
anker-eufy-security login # asks for the password and the e-mailed code once
anker-eufy-security status # guard mode, firmware, storage, every paired device
anker-eufy-security guard set home
anker-eufy-security settings --model T8160 # a model's settings, keyed by eufy's identifiers
anker-eufy-security set detection_sensitivity 4 --channel 0
anker-eufy-security live --channel 0 --seconds 10 --out clip
anker-eufy-security monitor # print events as they arrive
The password is never a flag: it comes from $EUFY_PASSWORD, the session cache or a
prompt. Every command is in the CLI reference.
Library
import asyncio
import aiohttp
from anker_eufy_security import EufySecurity, JsonFileStore, LoginChallengeError
async def main() -> None:
async with aiohttp.ClientSession() as http:
eufy = EufySecurity(
http, "you@example.com", "password", store=JsonFileStore("~/.eufy-cache.json")
)
try:
await eufy.async_login()
except LoginChallengeError as challenge:
if challenge.kind != "verify_code":
raise
await eufy.async_login(verify_code=input("code from the e-mail: "))
station = (await eufy.async_discover())[0]
state = await station.async_update()
print(station.name, state.guard_mode, state.firmware)
await station.async_set_guard_mode("home") # returns once the station confirms
await eufy.async_close()
asyncio.run(main())
Events from the local session and from push arrive on one stream:
eufy.subscribe(print)
await eufy.async_start() # local sessions and cloud push, until async_close()
Arming returns only after the station confirms it; a setting write returns how far it
got (CommandOutcome). A failure raises a typed error from
anker_eufy_security.exceptions.
The cache file holds the cloud session, the station keys and the account password:
keep it private.
More in getting started and, for an integration, the Home Assistant guide.
Documentation
| Getting started | install, login, arm, settings, events |
| Home Assistant integration | how an integration uses the library: cache, reauth, ids, network, coordinators, events, entities, stills, streaming, errors |
| Command line | every anker-eufy-security command |
| Support matrix · Hardware verification | what is supported, and what is proven on hardware |
| Add or verify a device | how support is declared and proven |
| Regenerate the settings files · Settings file schema | how the per-model settings are generated, and their format |
| Debug logging | loggers, wire dumps, redaction |
| Testing | end-to-end tests with anker_eufy_security.testing |
| Thing models | the app's per-model descriptions and handler recipes |
| Protocol reference | cloud, P2P transport, session crypto, commands, events, media, lock commands, MQTT |
Contributing
Reports from other hardware help most: anker-eufy-security status --raw and
anker-eufy-security coverage show what a station reports, and
add a device explains how an entry becomes verified.
Never post serials, credentials or captures from your home; see
CONTRIBUTING.md and SECURITY.md.
uv sync
uv run pytest -n auto
uv run ruff check && uv run ruff format --check
uv run mypy
Support
This project is built in spare time and is free to use. If it is useful to you, donations are welcome. They are voluntary, buy no support or priority, and are not tax-deductible.
Donated eufy hardware helps develop future features; please get in touch first.
License
MIT. eufy and Anker are trademarks of Anker Innovations; this project is not affiliated with or endorsed by them.
Metadata
Release files for anker-eufy-security 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| anker_eufy_security-0.1.3.tar.gz | 1.3 MB | With provenance | Details for anker_eufy_security-0.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| anker_eufy_security-0.1.3-py3-none-any.whl | Python 3 | none | any | Details for anker_eufy_security-0.1.3-py3-none-any.whl |
Total release size: 2.8 MB
Release files / anker_eufy_security-0.1.3.tar.gz
| Download URL | anker_eufy_security-0.1.3.tar.gz |
|---|---|
| Size | 1.3 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a2dd3cfa0d619919bf6b92f975c933ffd7048e9ce820b6846cf3d08a83e27dff
|
|
BLAKE2b-256 checksum How to use checksums |
5b5476792837d36ff2a3426eeb4365bc7802ecc0c4b1249502898c986cb6cb14
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.
Transparency logRelease files / anker_eufy_security-0.1.3-py3-none-any.whl
| Download URL | anker_eufy_security-0.1.3-py3-none-any.whl |
|---|---|
| Size | 1.5 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0c260ae4f2308f2008f3eee87289fdba5fcc6990668084818dcf1a4b88af6937
|
|
BLAKE2b-256 checksum How to use checksums |
70bb55d154608da8e9c356a19bd002d86115a1919feb30993b57fb5c0b00a7af
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.
Transparency logSecurity for anker-eufy-security 0.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for anker_eufy_security-0.1.3.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.