ampio-mqtt
Async Python client for the Ampio Smart Home local MQTT protocol exposed by the Ampio M-SERV controller. Built to back a Home Assistant integration while staying Home Assistant agnostic itself.
Beta. Everything below
1.0.0may break between any two releases without migration shims, so pin exact versions.1.0.0is reserved for the release that accompanies the home-assistant/core integration being accepted upstream.
Installation
pip install ampio-mqtt
LAN discovery (discover()) needs the discovery extra
(pip install ampio-mqtt[discovery]), which pulls in zeroconf. Home
Assistant ships zeroconf itself, so the integration needs no extra.
Quickstart
import asyncio
from ampio_mqtt import AmpioClient, ObjectUpdated, discover
async def main() -> None:
found = await discover() # mDNS lookup of ampio.local
if found is None:
raise SystemExit("No Ampio M-SERV found on the LAN")
client = AmpioClient(found.address, "user", "secret")
client.subscribe(
lambda e: print(e.object.id, e.object.kind, e.object.value),
of=ObjectUpdated,
)
await client.start() # connect, subscribe, run discovery
rooms = await client.fetch_rooms()
for obj_id, room in rooms.items():
print(f"object {obj_id} -> {room}")
await asyncio.sleep(30)
await client.stop()
asyncio.run(main())
What it does
Each area is one page under docs/, and the docstrings
carry the API detail.
- A maintained broker connection with QoS 1 on every leg, capped-backoff
reconnect, and one typed event stream that includes the terminal
AuthFailedandConnectionDiedsignals (docs/events.md). - Discovery of the object catalogue on either account tier (the module
catalogue is admin-only), with the detected tier exposed for setup flows
(
docs/account-tiers.md). - Classification of every object into a sensor, input, output, or
thermostat kind with Home-Assistant-compatible hints
(
docs/classification.md). - Replacement-stable identity for objects and modules, so a hardware swap
keeps its entities (
docs/identity.md). - Commands for relays, dimmers, RGBW lights, covers with stop and tilt,
the regulator setpoint, scenes, and bus events, plus a raw escape hatch
for the rest of the verb vocabulary
(
docs/protocol.md). - A low-latency input bridge from the raw per-channel topics on the admin
tier (
docs/raw-channel-bridge.md). - Room mapping, per-module health, eviction events for server-side deletions, and connection diagnostics for a consumer's report blob.
- LAN discovery of the M-SERV by multicast DNS, self-contained in the
process (
docs/discovery-flow.md).
Choosing an account
A dedicated standard account is the recommended shape for Home Assistant.
It sees exactly the objects granted in the Ampio app and can command only
those. An administrator account adds the module list and the low-latency
raw input topics. Bus events are the exception on both tiers, since any
account can raise any event number and the logic behind an event runs
with full authority. docs/account-tiers.md has
the capability table and the measured latency difference.
Supported M-SERV versions
The library is developed and live-tested against an M-SERV self-reporting
serverVersion 1865 (serverRevision 409, mqttVersion 5.133.11). That
baseline is the compatibility floor; wire behavior documented in this
repo is verified against that install unless marked otherwise in place -
an open claim carries a tracking-issue link or a caveat naming exactly
what is unverified. Older servers are not supported, and
the library logs a warning when the connected server reports a lower or
missing serverVersion. If something misbehaves on an older server,
upgrade the M-SERV first.
License
MIT
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 ampio_mqtt-0.30.0.tar.gz.
File metadata
- Download URL: ampio_mqtt-0.30.0.tar.gz
- Upload date:
- Size: 176.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a17334de5a049fdf799cb85fc11febdff75e74ee2f5b96f6677a652c5504b755
|
|
| MD5 |
a9eae8affde439c438ea0ffb38b51b4f
|
|
| BLAKE2b-256 |
bf35e054504879fc23905bee5053a5446dfc00cc366e37fb401d79bc4ec62cb3
|
Provenance
The following attestation bundles were made for ampio_mqtt-0.30.0.tar.gz:
Publisher:
release.yml on pszypowicz/ampio-mqtt
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ampio_mqtt-0.30.0.tar.gz -
Subject digest:
a17334de5a049fdf799cb85fc11febdff75e74ee2f5b96f6677a652c5504b755 - Sigstore transparency entry: 2598488125
- Sigstore integration time:
-
Permalink:
pszypowicz/ampio-mqtt@7ed234c7308ac0fdf277f825d863f05660101e10 -
Branch / Tag:
refs/tags/v0.30.0 - Owner: https://github.com/pszypowicz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7ed234c7308ac0fdf277f825d863f05660101e10 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ampio_mqtt-0.30.0-py3-none-any.whl.
File metadata
- Download URL: ampio_mqtt-0.30.0-py3-none-any.whl
- Upload date:
- Size: 62.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
28d65f18deb014bba3433449e99849cbce2359029f4961070c5e12bab66b74be
|
|
| MD5 |
4bbd73b807ec12fdbf14afa1f88d9277
|
|
| BLAKE2b-256 |
b7325d52c0e0d2d013d7ff0e6529a9406cfdb203b37fe38927f6f4637dd40bb8
|
Provenance
The following attestation bundles were made for ampio_mqtt-0.30.0-py3-none-any.whl:
Publisher:
release.yml on pszypowicz/ampio-mqtt
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ampio_mqtt-0.30.0-py3-none-any.whl -
Subject digest:
28d65f18deb014bba3433449e99849cbce2359029f4961070c5e12bab66b74be - Sigstore transparency entry: 2598488253
- Sigstore integration time:
-
Permalink:
pszypowicz/ampio-mqtt@7ed234c7308ac0fdf277f825d863f05660101e10 -
Branch / Tag:
refs/tags/v0.30.0 - Owner: https://github.com/pszypowicz
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@7ed234c7308ac0fdf277f825d863f05660101e10 -
Trigger Event:
push
-
Statement type: