Skip to main content

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.0 can break between any two releases without migration shims, so pin exact versions. 1.0.0 is 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.state),
        of=ObjectUpdated,
    )
    await client.connect()  # connect, subscribe, request the catalogues

    rooms = await client.fetch_rooms()
    for obj_id, room in rooms.items():
        print(f"object {obj_id} -> {room}")

    await asyncio.sleep(30)
    await client.disconnect()


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 but the retained raw state tree, and a capped-backoff reconnect. One typed event stream carries every update and the terminal AuthFailed and ConnectionDied signals (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. The M-DOT panel buzzer, its touch field colours and touch lock, and the module identify LED are admin-only. The command() escape hatch sends any other /api verb (docs/commands.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, reported capabilities, touch panel settings and cover travel parameters, 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 catalogue, the low-latency raw tree, the module diagnostics, and the CAN write surfaces (panel LEDs and colours, the buzzer, the touch lock, and the identify LED). Bus events are the exception on both tiers. 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 says 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.

Ampio does not guarantee the stability of these wire surfaces. A server update or a module firmware update can change or remove behavior this library depends on, without notice. Breaking changes by Ampio are a known pattern. The author of an earlier Ampio integration stopped maintenance for exactly this reason.

Upgrade rules

  • If something misbehaves on an older server, upgrade the M-SERV first.
  • If your install meets the baseline and works, stay on your current versions. Do not chase the latest ones.
  • If you decide to update anyway, make a full backup first - ideally a full image of the M-SERV's microSD card.

Disclaimer

This library is an independent, best-effort project and has no affiliation with Ampio. Use it at your own risk. It commands real hardware, and a wrong command moves real devices.

The M-SERV itself guarantees the safety of a standard account. The broker limits such an account to the objects granted in the Ampio app, and it denies the raw CAN surfaces on the wire. A defect in this library cannot widen that boundary. Bus events are the one exception (see Choosing an account).

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

ampio_mqtt-0.58.0.tar.gz (261.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ampio_mqtt-0.58.0-py3-none-any.whl (90.5 kB view details)

Uploaded Python 3

File details

Details for the file ampio_mqtt-0.58.0.tar.gz.

File metadata

  • Download URL: ampio_mqtt-0.58.0.tar.gz
  • Upload date:
  • Size: 261.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for ampio_mqtt-0.58.0.tar.gz
Algorithm Hash digest
SHA256 3e88be4cbcc8469353bf00ac1e4919f8d1893f422abf552780752b9afe6c81c3
MD5 9150dda41fc032879b7351a872234e99
BLAKE2b-256 186a0f67973a5f99885deedbf1794988f8a9cd85a8f3ab1b1620669d9a8a842e

See more details on using hashes here.

Provenance

The following attestation bundles were made for ampio_mqtt-0.58.0.tar.gz:

Publisher: release.yml on pszypowicz/ampio-mqtt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ampio_mqtt-0.58.0-py3-none-any.whl.

File metadata

  • Download URL: ampio_mqtt-0.58.0-py3-none-any.whl
  • Upload date:
  • Size: 90.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for ampio_mqtt-0.58.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8ad5f2c5eb16ec977e11d38b32088cf24140d84e96369917762e02c42973c030
MD5 c5aa741fba9aea12a5a3d7823d2611e2
BLAKE2b-256 917f5fb19e8b6c2244c2bea904041c3c063e473e4420d6fb3ecfca151015824d

See more details on using hashes here.

Provenance

The following attestation bundles were made for ampio_mqtt-0.58.0-py3-none-any.whl:

Publisher: release.yml on pszypowicz/ampio-mqtt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.58.0 This release

2 files

0.57.0

2 files

0.56.0

2 files

0.55.0

2 files

0.54.1

2 files

0.54.0

2 files

0.53.0

2 files

0.52.0

2 files

0.51.0

2 files

0.50.0

2 files

0.49.0

2 files

0.48.0

2 files

0.47.0

2 files

0.46.0

2 files

0.45.0

2 files

0.44.0

2 files

0.43.0

2 files

0.42.0

2 files

0.41.0

2 files

0.40.0

2 files

0.39.0

2 files

0.38.0

2 files

0.37.0

2 files

0.36.1

2 files

0.36.0

2 files

0.35.0

2 files

0.34.0

2 files

0.33.0

2 files

0.32.0

2 files

0.31.0

2 files

0.30.0

2 files

0.29.0

2 files

0.28.0

2 files

0.27.0

2 files

0.26.1

2 files

0.26.0

2 files

0.25.0

2 files

0.24.0

2 files

0.23.0

2 files

0.22.0

2 files

0.21.0

2 files

0.20.0

2 files

0.19.0

2 files

0.18.0

2 files

0.17.0

2 files

0.16.0

2 files

0.15.0

2 files

0.14.0

2 files

0.13.0

2 files

0.12.0

2 files

0.11.0

2 files

0.10.0

2 files

0.9.0

2 files

0.8.0

2 files

0.7.1

2 files

0.6.0

2 files

0.5.0

2 files

0.4.0

2 files

0.3.0

2 files

0.2.0

2 files

0.1.0

2 files

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