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.3.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e19c1064235b71a01f9f06d73246fcff813ef6ac41e0c9543793eabad0720499 |
|
MD5 | e38f4c2e8d1b254634c18b71edfe0d43 |
|
BLAKE2b-256 | eb299b0d4d6d51cb8c3e9e323c6d78838d33aeed49070cb33e0ae7e4a022e838 |
Hashes for ha_mqtt_discoverable_cli-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 38a9d2f8b6f486f489ab17dd2a340f816cbef4c45ad483cf1170de69f907d3ec |
|
MD5 | 5a3588f2485e59467cc565b0e5101422 |
|
BLAKE2b-256 | 77675628d0997a7e00b40502766843349cb4c8b9d7412a49289fe57fa7b097a3 |