How pszypowicz/ampio-mqtt works
ampio-mqtt is a Home Assistant-agnostic async client for the Ampio M-SERV local MQTT protocol. The main workflow is LAN discovery (optional), client connection and catalogue loading, protocol decoding into typed state, then event delivery and object commands. The graph also preserves classification, room/scene data, admin-only module and raw-channel features, and diagnostics. Source excerpts show the client, transport, protocol, and store boundaries; less-visible capabilities are included where documented in the README, without asserting their internal wiring.
Main entry points: client.py Ampio client · _store.py State store · _connection.py MQTT connection · _protocol.py Wire protocol
Components 15
Client API
- Ampio client
src/ampio_mqtt/client.py - Commands and admin
src/ampio_mqtt/client.py
MQTT Runtime
- MQTT connection
src/ampio_mqtt/_connection.py - Wire protocol
src/ampio_mqtt/_protocol.py
Domain State
- State store
src/ampio_mqtt/_store.py - Typed models
src/ampio_mqtt/models.py - Object classification
src/ampio_mqtt/classification.py - Device type metadata
src/ampio_mqtt/device_types.py - Typed event stream
src/ampio_mqtt/events.py - Errors
src/ampio_mqtt/errors.py
LAN Discovery
- LAN discovery
src/ampio_mqtt/discovery.py
Other components
- Library consumer
- Ampio LAN
- MQTT broker
- Ampio M-SERV
Connections 20
- Library consumer → LAN discovery: discovers
README.md - LAN discovery → Ampio LAN: queries mDNS
src/ampio_mqtt/discovery.py - Library consumer → Ampio client: creates client
README.md - Ampio client → MQTT connection: opens session
src/ampio_mqtt/client.py - MQTT connection → MQTT broker: connects and publishes
README.md - MQTT broker → MQTT connection: delivers messages
src/ampio_mqtt/_connection.py - MQTT connection → Ampio client: forwards messages
src/ampio_mqtt/_connection.py - Ampio client → Wire protocol: routes wire data
src/ampio_mqtt/client.py - Wire protocol → State store: decodes replies
src/ampio_mqtt/_store.py - Ampio client → State store: applies updates
src/ampio_mqtt/client.py - State store → Object classification: classifies objects
src/ampio_mqtt/_store.py - State store → Typed models: builds state
src/ampio_mqtt/_store.py - Typed models → Object classification: uses kind definitions
src/ampio_mqtt/models.py - Typed models → Device type metadata: uses metadata
src/ampio_mqtt/models.py - Ampio client → Typed event stream: dispatches updates
src/ampio_mqtt/client.py - State store → Typed event stream: produces store events
src/ampio_mqtt/_store.py - Ampio client → Commands and admin: exposes commands
README.md - Commands and admin → Wire protocol: builds wire requests
src/ampio_mqtt/client.py - Wire protocol → Ampio M-SERV: speaks MQTT protocol
README.md - Ampio client → Errors: raises client errors
src/ampio_mqtt/client.py