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
Hashes for ha_mqtt_discoverable_cli-0.4.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4b90f21a8433e0d8a9003c4cfbf887c8d70aff6ccfd5a385cd7f17af7b7b877 |
|
MD5 | f5cffbdfd53a47e179e6c0002087eaf9 |
|
BLAKE2b-256 | b7a634371b53deb26e49cf5780d6b374303d3729e458d2f334a76f8f2b7fe702 |
Hashes for ha_mqtt_discoverable_cli-0.4.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1c438b99a68ac3b753b8508ff727c061dc7e8d11ce7847e8d6a8b1b4b064832 |
|
MD5 | 1fd77d0cd369eea2541319675242cb69 |
|
BLAKE2b-256 | 7547e8033edf7200a0d238eef4f872ee98953f8cbc793bc275af6d08041f057c |