Skip to main content

A CLI tool to send custom sensor data to Home Assistant via MQTT

Project description

Home Assistant MQTT CLI

PyPI version License: MIT Python Versions

A command-line interface (CLI) tool to easily send custom sensor data to Home Assistant using MQTT Discovery.

[!IMPORTANT] Rename Notice: This project has been renamed from ha-cli to hamqtt to avoid a name clash with an existing PyPI package. Legacy configurations in ~/.config/ha-cli will be automatically migrated to ~/.config/hamqtt on the first run.

Features

  • Easy Configuration: Interactive setup for MQTT broker connection. Supports --show to view and --reset to clear configuration.
  • Auto-Discovery: Automatically registers entities with Home Assistant.
  • Flexible: Supports sensors, binary sensors, and various device classes.
  • Scriptable: Output JSON payloads for use with other tools or scripts.

Installation

Install using uv (recommended):

uv tool install hamqtt

Or using pip:

pip install hamqtt

Quick Start

  1. Configure MQTT Connection:

    hamqtt configure
    

    Follow the prompts to enter your broker details.

  2. Register a Sensor:

    hamqtt register --unique-id my_temp_sensor --name "Living Room Temperature" --device-class temperature --unit "°C"
    
  3. Send Data:

    hamqtt send --unique-id my_temp_sensor --state 22.5
    

Documentation

Full documentation is available at https://HWiese1980.github.io/hamqtt/.

License

This project is licensed under the terms of the MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hamqtt-0.2.0.tar.gz (90.3 kB view details)

Uploaded Source

Built Distribution

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

hamqtt-0.2.0-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file hamqtt-0.2.0.tar.gz.

File metadata

  • Download URL: hamqtt-0.2.0.tar.gz
  • Upload date:
  • Size: 90.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.2

File hashes

Hashes for hamqtt-0.2.0.tar.gz
Algorithm Hash digest
SHA256 0c48ab140431aa893dde191f3b0be254955dc8a33c4b1f03aee30f3dbf29a5e0
MD5 cbaa27da0f141729d55a26586d8a2e91
BLAKE2b-256 265cfa1b381985bd432042f6fb4d4aa154eabe7a22bde17e2c36e652834f680c

See more details on using hashes here.

File details

Details for the file hamqtt-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: hamqtt-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 9.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.2

File hashes

Hashes for hamqtt-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 413f69b92a1f74e91af91a06c5c80343b64cfbb2d869c0220372ebbc23a5d1c5
MD5 9964a55b09c41671a967606274256c3c
BLAKE2b-256 85bc976b74d7d18fbb978d14b5018202baff68552d636b749868bd5c9d7e24ea

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page