Skip to main content

ha-mqtt-device

A thin Python library for creating and maintaining Home Assistant devices that are discoverable via MQTT device discovery. Individual entities associated with a device can be added, updated, and removed through the same API.

Features

  • Device discovery: publish the discovery payload Home Assistant needs to automatically pick up your device over MQTT.
  • Entity management: add and maintain multiple entities (sensors, switches, lights, binary sensors, dates, datetimes, humidifiers, cameras, device trackers, infrared emitters/receivers, etc.) that belong to a device.
  • Event subscriptions: entities can subscribe to MQTT topics and deliver updates — for example switch commands from Home Assistant or infrared emitter signals — to your async callbacks as Event objects.
  • Thin and focused: no heavy framework — just the abstractions needed to model a device and its entities.

Requirements

  • Python 3.14+
  • uv for development and dependency management
  • aiomqtt for the MQTT provider (pip install "ha-mqtt-device[mqtt]")

Usage

Runnable examples — for the MQTT provider, device discovery, and every entity (supported and planned) — can be found in EXAMPLES.md.

Development

This project is managed with uv. Common commands:

Task Command
Run tests uv run pytest
Format code uv format
Lint uv run ruff check
Type checking uv run mypy .
Build uv build

Project layout

src/ha_mqtt_device/   # library source
tests/                # test suite
examples/             # runnable entity examples
pyproject.toml        # project metadata and tool configuration

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

ha_mqtt_device-1.0.0.tar.gz (51.9 kB view details)

Uploaded Source

Built Distribution

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

ha_mqtt_device-1.0.0-py3-none-any.whl (93.5 kB view details)

Uploaded Python 3

File details

Details for the file ha_mqtt_device-1.0.0.tar.gz.

File metadata

  • Download URL: ha_mqtt_device-1.0.0.tar.gz
  • Upload date:
  • Size: 51.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ha_mqtt_device-1.0.0.tar.gz
Algorithm Hash digest
SHA256 1dcb7f2cf85348bc5f34a23e635a35e3bc092fddfdab84f3f18fc90b2cac5db6
MD5 e7d6ddaa2bd283eb13ac08adac8089b5
BLAKE2b-256 b0f9a460cee2bf8644ce110dcc835fc0a155218d52c3c1dbd3afc2ec691f74e8

See more details on using hashes here.

File details

Details for the file ha_mqtt_device-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: ha_mqtt_device-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 93.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ha_mqtt_device-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d9005c0aacaa9943b359a4b0f01f4d126db5bdfb5003dbd2a011f14266e33a30
MD5 4ae9f6b1dc7e7d65aae2b44d4479027b
BLAKE2b-256 4b33afc2309ac2ea3b22688735373e28b01c4a02ebce2123182c99b67e125d44

See more details on using hashes here.

Release history Release notifications | RSS feed

1.2.0

2 files

1.1.0

2 files

1.0.1

2 files

This release

1.0.0 This release

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