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.2.0.tar.gz (58.0 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.2.0-py3-none-any.whl (105.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ha_mqtt_device-1.2.0.tar.gz
  • Upload date:
  • Size: 58.0 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.2.0.tar.gz
Algorithm Hash digest
SHA256 c3e3d63483f8115c0466ea7fb67bc61249be25ac67bc900e5836e6b2c53ed848
MD5 70e353de2b63805e5bfb53990374fd8d
BLAKE2b-256 34dd9d917669b950492aad2bebc9ef1a467721ec2435fe00ccc1f6f4dc8652e1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ha_mqtt_device-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 105.7 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ba88f2b2ef35791baa376800486081931219cd3ad43c516e2d25b188b0f42aae
MD5 1db7c20d8a23d0b62d1dab83262e85f5
BLAKE2b-256 0055de2876a78fcc6f11b24636699b27fd88bf24fa6efa7f13bedc21c42d414b

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.2.0 This release

2 files

1.1.0

2 files

1.0.1

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