Skip to main content

zwave-alarm-client

Async Python client (aiohttp) for the REST API of the Z-Wave Alarm service. Used by the Home Assistant integration; contains no Home Assistant code.

import aiohttp
from zwave_alarm_client import async_get_panel_state, async_stream_events, InvalidAuth, CannotConnect

async with aiohttp.ClientSession() as session:
    panel = await async_get_panel_state(session, "192.168.1.50", 3000, None)

    async for event in async_stream_events(session, "192.168.1.50", 3000, None):
        ...  # first event is a full `snapshot`, then `panel.changed`, `sensor.changed`, ...

Every call takes (session, host, port, token, ...); token is optional: pass None (no Authorization header is sent, so only host and port are needed); a non-empty value is sent as a bearer token. A cookie session from async_login also works with None. Pass secure=True for https/wss.

Coverage

Area Calls
Auth async_login, async_logout
Panel async_get_panel_state, async_validate_connection, async_arm, async_disarm (zone-restricted guests return a panel with disarmedZoneIds)
Zones & sensors async_get_zones, async_create_zone, async_update_zone, async_delete_zone (force=), async_list_discoverable_sensors, async_assign_sensor, async_update_sensor, async_unassign_sensor
Users async_list_users (ha_person_id= filter), async_create_user (code optional; guest expiry / guest_zone_id, ha_person_id, ha_user_id), async_update_user, async_delete_user
Codes (write-only) async_set_user_code, async_clear_user_code; users expose only hasCode
Lockout policy async_get_lockout_policy, async_update_lockout_policy
Events async_get_events
HA links async_create_ha_link, async_delete_ha_link
Keypads async_list_keypads, async_chime_keypad
Schlage locks async_list_locks, async_get_lock, async_refresh_lock, async_update_lock_settings, async_list_lock_users, async_set_lock_user_code, async_clear_lock_user_code, async_get_lock_schedule_slots, async_set_lock_schedules_enabled, async_get_lock_schedule, async_set_lock_schedule, async_clear_lock_schedule; validate_lock_code (see below)
Push channel async_stream_events (sends keepalive pings, drops pongs; reconnect policy is the caller's)

Schlage locks (BE469 / BE468)

Follows the service's contracts/locks.md. Under /api/v1; userId is 1-30; no endpoint returns a stored code.

Call Request
async_list_locks / async_get_lock GET /locks ({locks}), GET /locks/{nodeId}
async_refresh_lock POST /locks/{nodeId}/refresh: re-read every parameter and the schedule slot counts
async_update_lock_settings PATCH /locks/{nodeId}/settings, any non-empty subset of LockSettingsUpdate, validated as a whole
async_list_lock_users GET /locks/{nodeId}/users ({users: [{userId, status}]}, status enabled/disabled/available)
async_set_lock_user_code / async_clear_lock_user_code PUT ({code, status?}) / DELETE /locks/{nodeId}/users/{userId}/code
async_get_lock_schedule_slots GET /locks/{nodeId}/schedules ({slots})
async_set_lock_schedules_enabled PUT /locks/{nodeId}/users/{userId}/schedules/enabled with {enabled}
async_get_lock_schedule / async_set_lock_schedule / async_clear_lock_schedule GET / PUT / DELETE /locks/{nodeId}/users/{userId}/schedules/{weekDay|yearDay|dailyRepeating}/{slotId}

Create entities from a lock's supportedSettings. Any value in settings / diagnostics is None until the lock reports it; BE469-only settings are always None on a BE468 and writing one is a BadRequest. Failures to reach the lock (502 lock_unavailable) raise LockUnavailable, a CannotConnect.

Setting Param Notes
beeper, vacationMode, lockAndLeave, autoLock 0x03, 0x04, 0x05, 0x0F bool (wire 0x00 / 0xFF)
pinLength 0x10 4-8, default 4; does not rewrite existing codes
alarmMode 0x07 off, alert, tamper, forced_entry; BE469 only
alertSensitivity, tamperSensitivity, kickSensitivity 0x08-0x0A 0 (unsupported), 1 (most), 3 (medium), 5 (least); 2 and 4 undocumented; BE469 only
localControls 0x0B True = local control enabled; BE469 only

Read-only diagnostics: electronicTransitionCount (0x0C), mechanicalTransitionCount (0x0D), electronicFailedCount (0x0E), electronicHighPreloadTransitionCount (0x11), bootloaderVersion (0x12), userSlotBitField (0x06, 4 bytes) and occupiedUserSlots (that field decoded to slots 1-30). scheduleSlots and userSlotCount give the per-user schedule slots per kind and the number of user slots.

Schedules: weekdays are numbers 0 (Sunday) to 6 (Saturday); yearDay years are two digits (26 = 2026); dailyRepeating takes weekdays, a start and a duration.

Codes must be 4-8 digits: async_set_lock_user_code and validate_lock_code raise BadRequest locally otherwise, and passing the lock's settings["pinLength"] as pin_length= requires that exact length. async_update_lock_settings checks pinLength (4-8) and sensitivities (0-5) before sending.

The stream carries lock.changed ({lock: LockSummary}) and the snapshot gains locks; see LockChanged.

Response shapes are available as TypedDicts in zwave_alarm_client.models.

Errors

All derive from ZwaveAlarmError: CannotConnect (unreachable, timeout, 5xx; ServiceUnavailable for 503), InvalidAuth (401), Forbidden (403), NotFound (404), BadRequest (400, message names the field), Conflict (409; CommandRejected for a lost arm/disarm race, ZoneNotEmpty, ZoneInUse, CodeInUse), AccountLocked (423), TooManyRequests (429, .retry_after), LockUnavailable (502 lock_unavailable, a CannotConnect).

Development

python -m venv .venv && . .venv/bin/activate
pip install -e '.[test]'
pytest

Commits follow Conventional Commits: fix releases a patch, feat a minor, BREAKING CHANGE/! a major. Releases are tagged and published to PyPI from main.

Metadata

Release files for zwave-alarm-client 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for zwave-alarm-client 0.5.0
File Size Uploaded Provenance Actions
zwave_alarm_client-0.5.0.tar.gz 24.8 kB With provenance Details for zwave_alarm_client-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for zwave-alarm-client 0.5.0
File Interpreter ABI Platform Actions
zwave_alarm_client-0.5.0-py3-none-any.whl Python 3 none any Details for zwave_alarm_client-0.5.0-py3-none-any.whl

Total release size: 41.8 kB

Release files / zwave_alarm_client-0.5.0.tar.gz

Download URL zwave_alarm_client-0.5.0.tar.gz
Size 24.8 kB
Tags Source
SHA-256 checksum
How to use checksums
dfab1405da70e8e88ce54ac8370f8d8678b812b034c529bd5af448fa936e887b
BLAKE2b-256 checksum
How to use checksums
2f0c9728f85ec90f53c5293c4ece9b010371bdb297cdbeca60bab86b8cae1998
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 Oct 24, 2026.

Transparency log

Release files / zwave_alarm_client-0.5.0-py3-none-any.whl

Download URL zwave_alarm_client-0.5.0-py3-none-any.whl
Size 16.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e4df280039dbd980cccfe7f1190d6cc843482550d74c026f034cdd2d6162353f
BLAKE2b-256 checksum
How to use checksums
29060c346cedf1840c1a4d8335b3b47a25f33d2b0e51adbcdebf9f943cc16f03
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 Oct 24, 2026.

Transparency log

Security for zwave-alarm-client 0.5.0

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.

Select from 2 files

Attestation for zwave_alarm_client-0.5.0.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 Oct 24, 2026.

Transparency log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page