CLI tools for the ha-mqtt-discoverable module
Project description
ha-mqtt-discoverable-cli
Table of Contents
This repository contains CLI scripts for CRUD operations on MQTT entities that will be autodetected by Home Assistant.
It is a group of wrappers for the ha-mqtt-discoverable python module.
Installing
Native install
pip install ha-mqtt-discoverable-cli
will install the cli tools. If you prefer to keep your system python clear of extra modules, use the unixorn/ha-mqtt-discoverable-cli
docker image.
Docker
If you only need to use the command line tools, the simplest way is to use them with docker
or nerdctl
. It won't interfere with your system python and potentially cause you issues there.
You can use the unixorn/ha-mqtt-discoverable-cli image on dockerhub directly, but if you add $reporoot/bin
to your $PATH
, the hmd
script there will automatically run the command line tools inside a docker container with docker
or nerdctl
, depending on what it finds in your $PATH
.
Scripts Provided
The ha_mqtt_discoverable-cli
module installs the following helper scripts you can use in your own shell scripts.
hmd
Uses the gitlike-commands module to find and execute hmd
subcommands. Allows you to run hmd create binary sensor
and hmd
will find and run hmd-create-binary-sensor
and pass it all the command line options.
hmd create binary sensor
Create/Update a binary sensor and set its state.
Usage: hmd create binary sensor --device-name mfsmaster --device-id 8675309 --mqtt-user HASS_MQTT_USER --mqtt-password HASS_MQTT_PASSWORD --client-name inquisition --mqtt-server mqtt.unixorn.net --metric-name tamper --device-class motion --state off
hmd create device
Create/Update a device and set the state of multiple metrics on it.
Usage: hmd create device --device-name coyote --device-id 8675309 --mqtt-user HASS_MQTT_USER --mqtt-password HASS_MQTT_PASSWORD --mqtt-server mqtt.example.com --model 'Rocket Skates' --manufacturer 'Acme Products' --metric-data '{"name":"Left Rocket Skate","value":93}' --metric-data '{"name":"Right Rocket Skate","value":155}' --unique-id 'hmd-26536'
Contributing
Please run black
on your code before submitting. There are git
hooks already configured to run black
and other checks before every commit, please run pre-commit install
to enable them.
Contributors
Made with contributors-img.
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
Built Distribution
File details
Details for the file ha_mqtt_discoverable_cli-0.5.0.tar.gz
.
File metadata
- Download URL: ha_mqtt_discoverable_cli-0.5.0.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.9.18 Darwin/23.4.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ae305ec4063adbe9e70adce7e4d6a1cbdd96e91f87f21ab8cb975e23abf5962 |
|
MD5 | eaf06d4ded7aeac7c260bf65eff6737d |
|
BLAKE2b-256 | 431c8bc9bf2f4f7e00f861bfe3536e3012e864916be675b301518b742c6e331f |
File details
Details for the file ha_mqtt_discoverable_cli-0.5.0-py3-none-any.whl
.
File metadata
- Download URL: ha_mqtt_discoverable_cli-0.5.0-py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.9.18 Darwin/23.4.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7eb9036823fff7f731284374b79f8c1926e9622a5b8e6ea9879ed9f616496f5 |
|
MD5 | 40251ccf8e4e2be1de9b4cec32578b0d |
|
BLAKE2b-256 | f5f0bd7afa3bf2e230f79ca4f0ad99adac2d6ad23cba374c8b2856f226343dc8 |