Skip to content

feat: read a monitor's alarm state on both APIs - #58

Merged
SteveGilvarry merged 2 commits into
ZoneMinder:mainfrom
nabbi:feat/alarm-state
Oct 25, 2026
Merged

SteveGilvarry merged 2 commits into
ZoneMinder:mainfrom
nabbi:feat/alarm-state

Conversation

@nabbi

@nabbi nabbi commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Impact: feature (zm-py parity: the alarm state ha-zoneminder shows as recording and the force alarm switch)

Automated PR, tested in a zm-holodeck sandbox. An AI agent (Claude Opus 5.5) wrote this against a disposable
lab (ZoneMinder upstream master 1bdccda40 with its CakePHP API v2, zm-api 9e296bf passive; simulated HikVision,
Dahua, Axis, Reolink and ONVIF cameras) and ran the checks there. Minimal human review before opening: please
review it as you would any contributor's PR.

TL;DR

Closes #57

🤖 Generated with Claude Code

zm-py reads it per monitor from API v2's alarm status (zmu -s), and
ha-zoneminder shows it as the camera recording and the force alarm
switch's state. aiozoneminder had no way to read it on API v2; on API v3
only the event stream carried it.

get_alarm_state() returns idle, prealarm, alarm or alert, or None when
ZoneMinder can't say (not capturing, zmc not running). API v2 asks the
monitor's own server, as alarms do; API v3 reads zm-api's live status.
# Conflicts:
#	CHANGELOG.md
#	src/aiozoneminder/client/legacy.py
#	tests/live/test_write.py
@SteveGilvarry
SteveGilvarry merged commit 2ff846a into ZoneMinder:main Oct 25, 2026
3 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 25, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Read a monitor's alarm state (zm-py has it, ha-zoneminder uses it)

2 participants