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.2.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0bbea54726442cd96d725c7dc1d8df4db50cc40ca49531a57c9d3c8d1baa2483 |
|
MD5 | b2ab7901a4c6b13557bae3fe5ebf40b0 |
|
BLAKE2b-256 | e45f356792dfb741f72b8743346860ec02b7a44316ccf9df9c4ed6573cce236b |
Hashes for ha_mqtt_discoverable_cli-0.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | df5fd4e8f347bf83fc509d26b0ecb2b198786d95ccfea99191788492066ab7bc |
|
MD5 | 76a1859132cd5f6883d91e4f73074b49 |
|
BLAKE2b-256 | 2252852f18fecd7745ffb8c1d0a568ea65fc2cef927e24b4771b9b600b6139df |