Visonic Alarm Panel Library using asyncio
An asyncio interface to Visonic PowerMax and PowerMaster alarm panels, including PowerMax+, PowerMaxExpress, PowerMaxPro, PowerMaxComplete, PowerMaster 10 and PowerMaster 30. Python 3.14 or newer is required.
This library does not make any physical / transport connections to a device or panel. This library is a protocol, you make the connection to the panel and the library:
- Is given the received serial data from the panel
- Provides the serial data to send to the panel
A PowerLink device is not required; do not use this library with PowerLink hardware. See the hardware and configuration wiki.
Installation
python -m pip install pyvisonic
Version 4 migration
Version 4 packages the updated protocol implementation as a pyvisonic package.
The previous standalone modules (pyconst, pyenum, pyeprom, pyhelper, and
pyvisonic.py) are replaced by the modules in the new package. Update imports,
for example:
from pyvisonic.py_visonic import VisonicProtocol
from pyvisonic.py_abstract_classes import AlPanelInterface
from pyvisonic.py_enum import AlPanelCommand, AlPanelMode
Connection setup and protocol callbacks are demonstrated in the included examples. Review these when migrating an application from version 3.
Quick connection test
Before calling connect(), an idle VisonicClient can check its endpoint:
baud = await client.async_test_connection(timeout=5.0, attempts=2)
if baud is not None:
client.settings.baud = baud
client.connect()
The test returns the responding baud rate, or None when neither rate responds
or the connection fails. It sends a status request and requires a checksum-checked
status reply; an acknowledgement alone is insufficient. This does not establish
authenticated control or decoded panel state.
Serial probes try the configured baud and then the other rate (9600 or 38400)
on each pass, changing the open port's baud without commanding the panel to
change its baud. By default there are two passes, so a 9600-baud configuration
tries 9600, 38400, 9600, 38400, stopping as soon as a valid reply arrives.
TCP probes use the remote adapter's existing settings and return the configured
baud on success; they cannot discover the adapter's actual serial baud. They
send up to two status requests over the same connection by default.
timeout is a positive number of seconds per attempt, including opening the
connection or changing baud. attempts is a positive integer specifying the
number of passes. The defaults allow up to twenty seconds for serial or ten
seconds for TCP, plus up to one second for serial cleanup. Opening failures
and disconnected transports end the probe without further requests. The probe
always closes its connection and stops its sender. Cancellation propagates
after cleanup. The standalone probe leaves the client's settings unchanged.
Normal serial connect() also uses this bounded discovery before full startup.
It starts at the saved baud, tries the alternate baud if needed, and hands the
same open transport to the normal protocol once a status reply is verified.
The verified baud is persisted through the existing baud-change callback.
Short power interruptions normally retain the panel's baud; a PowerMaster may
revert to 9600 after prolonged power loss, usually around 24 hours. No outage
duration needs to be tracked because startup checks the responding baud.
Reconnections perform discovery again. Once a PowerMaster is connected in Powerlink mode, a requested baud upgrade first commands the panel at its working baud, then reconfigures the local serial transport in place. Rejected commands leave the working baud unchanged. Failed local reconfiguration triggers recovery through discovery. The standalone connection test still closes its connection and leaves its settings unchanged.
Examples
Install the optional dependencies for the command line examples, Textual interface, and serial bridge:
python3.14 -m pip install -e '.[examples]'
Run the examples as modules so their relative imports resolve:
python -m pyvisonic.examples.simple_example -address 192.168.0.7 -port 11124
python -m pyvisonic.examples.complete_example -address 192.168.0.7 -port 11124
python -m pyvisonic.examples.simple_example -usb /dev/ttyUSB0 -baud 9600
Use --help to see the available options. The common connection adapter is in
pyvisonic.examples.example_common. The library itself depends on Pillow;
serial and user interface dependencies are provided by the examples extra.
Build a release
From this directory:
python -m pip install build twine
python -m build
PYVISONIC_VERSION=$(sed -n 's/^__version__ = "\(.*\)"/\1/p' src/pyvisonic/__init__.py)
python -m twine check dist/pyvisonic-${PYVISONIC_VERSION}-*
Install and test the wheel before publishing. To upload only this release:
python -m twine upload dist/pyvisonic-${PYVISONIC_VERSION}-*
Tests
From this directory, install the package and test/example dependencies in a virtual environment, then run pytest:
python -m venv .venv
. .venv/bin/activate
python -m pip install -e '.[test,examples]'
python -m pytest
The tests use fixed checksum vectors (including a captured F4 acknowledgement),
synthetic control packets, and fragmented or corrupted byte streams. They verify
state updates, expected responses, and shutdown without opening a connection to a
panel. The distribution tests build a source archive, build its wheel, validate
both with Twine, install the wheel into a temporary directory, and check imports
and example --help commands outside the source directory. Build and installation
checks run without network access after the test dependencies are installed.
These are initial regression tests; they do not verify live panel behaviour or all message types. Add anonymised captures and expected decoded state when fixing protocol bugs. The receive API is synchronous, so these tests use a local event loop without starting background connection tasks.
Development and releases
See RELEASING.md for local checks and the public CI release process.
Metadata
Release files for pyvisonic 4.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyvisonic-4.1.1.tar.gz | 218.0 kB | With provenance | Details for pyvisonic-4.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyvisonic-4.1.1-py3-none-any.whl | Python 3 | none | any | Details for pyvisonic-4.1.1-py3-none-any.whl |
Total release size: 416.4 kB
Release files / pyvisonic-4.1.1.tar.gz
| Download URL | pyvisonic-4.1.1.tar.gz |
|---|---|
| Size | 218.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f7f63d73de4f2a8f01119d1cb6089879028c746248b4f9b94d7800f71a5c917d
|
|
BLAKE2b-256 checksum How to use checksums |
39d81a60a2d8f5c0f4fe18f40466ac582d5f79eacea24afb35cefe8cb3701a47
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 25, 2026.
Transparency logRelease files / pyvisonic-4.1.1-py3-none-any.whl
| Download URL | pyvisonic-4.1.1-py3-none-any.whl |
|---|---|
| Size | 198.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b4bec17a1438b81b93675f432c43a8b372e9b786ef8dd8ce608de592c50b2911
|
|
BLAKE2b-256 checksum How to use checksums |
e8d8d77e06856b3ff8b554a8a887cab1387b6f84764fb6ed6a2713e99e1192ed
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 25, 2026.
Transparency logSecurity for pyvisonic 4.1.1
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.
Attestation for pyvisonic-4.1.1.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 25, 2026.
Transparency logA 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.