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.1.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.1-py3-none-any.whl (93.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ha_mqtt_device-1.0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 d1f1ce35211d7ea70fe03cd2b80233d20d9c1a8ceae59619363a4bf101808e28
MD5 2e6e6de9336c579edec58497e6994278
BLAKE2b-256 9bc3ee9ee2e89c0397475604b17a7ebf94f84b17ba3ecf93e61773e90c15387b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ha_mqtt_device-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 93.8 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 91cc0de68ed55c79a453c62d0f06d1e0d5f450425daa4f731840b5f14841a71e
MD5 384a0cb1285314125c8af38c40b0016a
BLAKE2b-256 f0b527ed09943dc960c6f68a5577f3a36d5892b11ebd786047747e9aabd973ec

See more details on using hashes here.

Release history Release notifications | RSS feed

1.2.0

2 files

1.1.0

2 files

This release

1.0.1 This release

2 files

1.0.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