Skip to main content

pyloxone-api

A Python API for communicating with a Loxone Miniserver.

PyPI - Python Version PyPI - License PyPI

Low-level asynchronous client for the Loxone Miniserver WebSocket API. It handles the HTTP bootstrap, WebSocket connection, authentication (token and key exchange), commands and state events. It has no dependency on Home Assistant.

Used by the PyLoxone Home Assistant integration.

Installation

pip install pyloxone-api

Requires Python 3.14 or newer.

Usage

from pyloxone_api import LoxoneConnection, LoxoneException

connection = LoxoneConnection(host, username, password, port=8080)

Keeping the token between runs

A token lets the library log in without the password. To keep it across restarts, pass a token_store object that saves and loads the token. The library never writes files itself. See Saving the token for the protocol, the stored format and a JSON-file example.

connection = LoxoneConnection(host, username, password, token_store=my_store)

The public API is exported from pyloxone_api (see __all__). Everything else is internal and may change between releases.

Version 0.3.0 is a complete rewrite of the 0.2.x series and is not API-compatible with it.

Documentation

  • Callbacks: what the library calls back into, when, and what happens on errors.
  • Saving the token: keep the login token between restarts with token_store.
  • Live web view: a developer tool that shows a Miniserver's structure and live values in the browser.

Development

We use uv for environments and builds, and pytest for tests.

uv sync --group dev        # create .venv with the package and dev tools
uv run pytest              # tests; online tests are skipped by default
uv run pytest -m online    # online tests, need a live Miniserver

Online tests can make a Miniserver behave oddly. Run them only against a Miniserver you can afford to disturb.

Build the sdist and wheel into dist/:

./scripts/build

License

AGPL-3.0-only, see LICENSE.

Metadata

Release files for pyloxone-api 0.4.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 pyloxone-api 0.4.0
File Size Uploaded Provenance Actions
pyloxone_api-0.4.0.tar.gz 167.5 kB Without provenance Details for pyloxone_api-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyloxone-api 0.4.0
File Interpreter ABI Platform Actions
pyloxone_api-0.4.0-py3-none-any.whl Python 3 none any Details for pyloxone_api-0.4.0-py3-none-any.whl

Total release size: 242.7 kB

Release files / pyloxone_api-0.4.0.tar.gz

Download URL pyloxone_api-0.4.0.tar.gz
Size 167.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b5b75c5958aeec67832f00fe68d2e5ec946a8fc80614bac6875fafb09a55d48a
BLAKE2b-256 checksum
How to use checksums
ded55c8b16e9375ee556ee1f043285fdf9fbebbb0cbbb12edf0e6c60a2ad629e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / pyloxone_api-0.4.0-py3-none-any.whl

Download URL pyloxone_api-0.4.0-py3-none-any.whl
Size 75.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3356a40eac70b59c31fb605438e512ba36010bdefc0bcabda392516cc6383e10
BLAKE2b-256 checksum
How to use checksums
b6060d6b31cad10be6a2326eeee45183f8dde569c80ff4c4841107bc4a442505
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for pyloxone-api 0.4.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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