Skip to main content

zm-py

image

Python package

image

license

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

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")

Metadata

Release files for zm-py 0.5.7

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

Source distribution (sdist)

Source distribution for zm-py 0.5.7
File Size Uploaded
zm_py-0.5.7.tar.gz 48.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for zm-py 0.5.7
File Interpreter ABI Platform
zm_py-0.5.7-py3-none-any.whl Python 3 none any Details

Total release size: 68.1 kB

Release files / zm_py-0.5.7.tar.gz

Download URL zm_py-0.5.7.tar.gz
Size 48.5 kB
Tags Source
SHA-256 checksum
How to use checksums
74d209f5502a1f66af432140a26ead89e878b69ba464e42669ac76e335aeb699
BLAKE2b-256 checksum
How to use checksums
73faa98be69324f49c622bf3de76f8e9506850ba051fc73b28dc691072d6588b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.7

Release files / zm_py-0.5.7-py3-none-any.whl

Download URL zm_py-0.5.7-py3-none-any.whl
Size 19.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
107359026714cf4ec75a84ee40f73314c8167c59a4057057289894eb850b7bf2
BLAKE2b-256 checksum
How to use checksums
7af34e0f8296f6bd0c7b79634dd754b3f7fea75e8ec5a8a36de416c6bad4b228
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.7
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