A loose python wrapper around the ZoneMinder REST API.
Project description
zm-py
A lightweight Python API client for ZoneMinder, built specifically for the Home Assistant ZoneMinder integration.
The official Home Assistant ZoneMinder component depends on zm-py==0.5.4. Active development of the integration has moved to nabbi/ha-zoneminder; it is unknown if or when those changes will be submitted back to HA core.
Project Status
This project is in maintenance mode. zm-py provides the limited set of ZoneMinder API interactions that Home Assistant needs (monitors, camera streaming, events, sensors, and switches). Bug fixes and compatibility updates are accepted; new feature development is not planned.
Not pyzm / pyzm2
zm-py is not a general-purpose ZoneMinder Python library. For full-featured ZoneMinder API access, see pyzm or its fork pyzm2. zm-py covers only the subset of the ZoneMinder API required by Home Assistant and carries no heavy dependencies. Replacing zm-py with pyzm or pyzm2 would require significant refactoring of the HA integration due to dependency conflicts and functional differences.
Origins
zm-py is based on code that was originally part of Home Assistant. Historical sources and authorship information is available as part of the Home Assistant project:
Documentation
- API Reference — all public classes, methods, properties, and enums
- Architecture — package structure, design patterns, caching strategy, Mermaid diagrams
- Architecture diagrams:
Installation
PyPI
pip install zm-py
Usage
from zoneminder.zm import ZoneMinder
SERVER_HOST = "{{host}}:{{port}}"
USER = "{{user}}"
PASS = "{{pass}}"
SERVER_PATH = "{{path}}"
zm_client = ZoneMinder(
server_host=SERVER_HOST,
server_path=SERVER_PATH,
username=USER,
password=PASS,
verify_ssl=False,
stream_scale=50, # optional: scale streams to 50%
stream_maxfps=5.0, # optional: cap MJPEG at 5 FPS
)
# Zoneminder authentication
zm_client.login()
# Get all monitors
monitors = zm_client.get_monitors()
for monitor in monitors:
print(monitor)
>>> Monitor(id='monitor_id', name='monitor_name', controllable='is_controllable')
# Move camera down
controllable_monitors = [m for m in monitors if m.controllable]
for monitor in controllable_monitors:
zm_client.move_monitor(monitor, "right")
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 zm_py-0.5.5.tar.gz.
File metadata
- Download URL: zm_py-0.5.5.tar.gz
- Upload date:
- Size: 47.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.3.2 CPython/3.14.0 Linux/6.12.58-gentoo-x86_64
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
416f28072bcf2dfec56626ed812af6526bd9e63c286b190813b2e60781b040de
|
|
| MD5 |
ca6239cc48e3d2100f8a41b68b5b89ee
|
|
| BLAKE2b-256 |
4e6b3cb48f3b5db5fa11853bfbfe3c97b0168145310e7fb6956ffb0f33dc13e2
|
File details
Details for the file zm_py-0.5.5-py3-none-any.whl.
File metadata
- Download URL: zm_py-0.5.5-py3-none-any.whl
- Upload date:
- Size: 19.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.3.2 CPython/3.14.0 Linux/6.12.58-gentoo-x86_64
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a50ab6081121d9cdce540785facb80f2c53ed2387656782df4bb4e6c7eff2e7d
|
|
| MD5 |
68e098cc4c62b3f6eeb6d44466c8cf14
|
|
| BLAKE2b-256 |
7c5c204ca6198f1525f19f91fc9cea9a2ca73b432e603859f5f62de882a9869f
|