Async Python library for the Akuvox local HTTP API
Project description
pylocal-akuvox
Async Python library for the Akuvox local HTTP API.
pylocal-akuvox provides a single AkuvoxDevice object for
communicating with Akuvox intercoms and access controllers on the LAN.
It supports user/PIN management, relay control, schedule management,
and log retrieval over the device's local HTTP API.
Features
- Async-only — designed for
asyncioevent loops and Home Assistant - Single runtime dependency — only
aiohttp - Full device management — users, PINs, relays, schedules, and logs
- Multiple auth modes — None, Allowlist, Basic, and Digest
- SSL support — including self-signed certificate handling
- Legacy TLS compatibility — OpenSSL SECLEVEL relaxation for old devices
- Comprehensive error handling — typed exception hierarchy
- Capability-aware API — built-in device support matrix, safe probing, and fail-fast unsupported-operation checks
- Contact schema fidelity — door-phone and apartment-book contact records preserve their device-specific fields
Installation
pip install pylocal-akuvox
Quick Start
import asyncio
from pylocal_akuvox import AkuvoxDevice
async def main():
async with AkuvoxDevice("192.168.1.100") as device:
info = await device.get_info()
print(f"{info.model} — FW {info.firmware_version}")
asyncio.run(main())
Capability-aware API
Known device classes are matched against a built-in capability matrix when the connection opens. For unfamiliar devices, or after a firmware update, run the safe read-only probe and then act only on confirmed capabilities:
import asyncio
from pylocal_akuvox import AkuvoxDevice, Capability, CapabilityStatus
async def main():
async with AkuvoxDevice("192.168.1.100") as device:
capabilities = await device.probe_capabilities()
user_add_status = capabilities.status_of(Capability.USER_ADD)
if user_add_status is CapabilityStatus.SUPPORTED:
await device.add_user(
name="Alice",
user_id="2001",
web_relay="0",
schedule_relay="1001-1",
lift_floor_num="0",
private_pin="1234",
)
else:
print("User creation is not confirmed for this device")
asyncio.run(main())
The probe uses a deterministic, non-destructive read sequence. Operations
whose status is UNSUPPORTED always fail fast. Operations whose status is
UNKNOWN fail fast by default; set device.attempt_unknown_capability = True
only when you intentionally want to try an unproven device-side operation.
The effective profile is available as device.capabilities for the current
connection.
The examples below call service methods directly for brevity. They assume the
relevant capability is SUPPORTED; for portable code, guard each operation
with the probed or matrix profile as shown above.
Contact models
Door-phone devices such as X916 and E18C expose contacts with ID, Name,
Phone, and Group. Apartment-book devices such as X915S expose contacts with
Name, Phone, APTName, APTNum, Building, and Landline; they have no
device-assigned ID or Group.
Contact exposes apartment-book metadata as apt_name, apt_num, building,
and landline. Those fields are None on door-phone records. Apartment-book
contacts are read-only over the public HTTP API, so manage them through the
device web UI, provisioning, or another vendor-supported channel.
Manage Users and PINs
import asyncio
from pylocal_akuvox import AkuvoxDevice
async def main():
async with AkuvoxDevice("192.168.1.100") as device:
await device.add_user(
name="Alice",
user_id="2001",
web_relay="0",
schedule_relay="1001-1",
lift_floor_num="0",
private_pin="1234",
)
users = await device.list_users()
for user in users:
print(f"{user.name} (ID: {user.user_id})")
asyncio.run(main())
Trigger a Door Relay
Door-phone models that support the JSON relay API use trigger_relay(),
which sends /api/relay/trig with the connection's AuthConfig:
import asyncio
from pylocal_akuvox import AkuvoxDevice
async def main():
async with AkuvoxDevice("192.168.1.100") as device:
await device.trigger_relay(num=1, delay=5)
asyncio.run(main())
IT83-class devices use Akuvox's separate Open Relay Via HTTP setting instead. Enable Phone → Relay → Open Relay Via HTTP on the device and pass those relay-specific credentials per call:
import asyncio
from pylocal_akuvox import AkuvoxDevice
async def main():
async with AkuvoxDevice("192.168.1.100") as device:
await device.open_door_http(
user="relay-user",
password="relay-password",
)
asyncio.run(main())
The vendor endpoint carries the OpenDoor password in the URL query string,
so it can appear in proxy or device access logs outside this library. On an
IT83, trigger_relay() raises an actionable error directing callers to
AkuvoxDevice.open_door_http() instead of sending a credential-less
OpenDoor request.
Authentication
import asyncio
from pylocal_akuvox import AkuvoxDevice, AuthConfig, AuthMethod
async def main():
# Basic Auth
auth = AuthConfig(method=AuthMethod.BASIC, username="admin", password="secret")
async with AkuvoxDevice("192.168.1.100", auth=auth) as device:
info = await device.get_info()
asyncio.run(main())
Documentation
Full documentation is available at pylocal-akuvox.readthedocs.io.
Contributing
This project uses uv for dependency management.
# Clone and install
git clone https://github.com/tykeal/pylocal-akuvox.git
cd pylocal-akuvox
uv sync --group dev
# Run tests
uv run pytest tests/ -x -q
# Run linting
uv run ruff check src/ tests/
# Build docs locally
uv run --extra docs sphinx-build -b html docs docs/_build/html
License
Apache-2.0 — see LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pylocal_akuvox-1.3.0.tar.gz.
File metadata
- Download URL: pylocal_akuvox-1.3.0.tar.gz
- Upload date:
- Size: 775.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e64059a22cb6578300120fdc79a6d11196dfd8ad9a2bde250d63a711f3af4924
|
|
| MD5 |
0324e8544aa15abe166e92c1d1b57a3e
|
|
| BLAKE2b-256 |
1e974da343ee3f4b6743115b3ad8c4df9e716da709513acd86d14a779b581632
|
Provenance
The following attestation bundles were made for pylocal_akuvox-1.3.0.tar.gz:
Publisher:
build-test-release.yaml on tykeal/pylocal-akuvox
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pylocal_akuvox-1.3.0.tar.gz -
Subject digest:
e64059a22cb6578300120fdc79a6d11196dfd8ad9a2bde250d63a711f3af4924 - Sigstore transparency entry: 2088351618
- Sigstore integration time:
-
Permalink:
tykeal/pylocal-akuvox@30d306d8cd9a4389911696dbe513a4c9ab598fa5 -
Branch / Tag:
refs/tags/v1.3.0 - Owner: https://github.com/tykeal
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-test-release.yaml@30d306d8cd9a4389911696dbe513a4c9ab598fa5 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pylocal_akuvox-1.3.0-py3-none-any.whl.
File metadata
- Download URL: pylocal_akuvox-1.3.0-py3-none-any.whl
- Upload date:
- Size: 95.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2120c520550b4a59089577a7c64d6be65d086f985a910b3cce8c0db3d09efdd8
|
|
| MD5 |
af8b1eb7281cdf213faf7eb50e6a946d
|
|
| BLAKE2b-256 |
4ae7be12c3c577a67b6ff327bd64e8d41d1a2b1ff00936e19861fb22b4ecbdb6
|
Provenance
The following attestation bundles were made for pylocal_akuvox-1.3.0-py3-none-any.whl:
Publisher:
build-test-release.yaml on tykeal/pylocal-akuvox
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pylocal_akuvox-1.3.0-py3-none-any.whl -
Subject digest:
2120c520550b4a59089577a7c64d6be65d086f985a910b3cce8c0db3d09efdd8 - Sigstore transparency entry: 2088351656
- Sigstore integration time:
-
Permalink:
tykeal/pylocal-akuvox@30d306d8cd9a4389911696dbe513a4c9ab598fa5 -
Branch / Tag:
refs/tags/v1.3.0 - Owner: https://github.com/tykeal
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build-test-release.yaml@30d306d8cd9a4389911696dbe513a4c9ab598fa5 -
Trigger Event:
push
-
Statement type: