A useful Salt Event returner for publishing messages to MQTT or AWS IoT
Project description
mqtt_return
A useful Salt Event returner for publishing messages to MQTT or AWS IoT
Quickstart
To get started with your new project:
# Create a new venv
python3 -m venv env --prompt mqtt_return
source env/bin/activate
# On mac, you may need to upgrade pip
python -m pip install --upgrade pip
# On WSL or some flavors of linux you may need to install the `enchant`
# library in order to build the docs
sudo apt-get install -y enchant
# Install extension + test/dev/doc dependencies into your environment
python -m pip install -e .[tests,dev,docs]
# Run tests!
python -m nox -e tests-3
# skip requirements install for next time
export SKIP_REQUIREMENTS_INSTALL=1
# Build the docs, serve, and view in your web browser:
python -m nox -e docs && (cd docs/_build/html; python -m webbrowser localhost:8000; python -m http.server; cd -)
# Run the example function
salt-call --local mqtt_return.example_function text="Happy Hacking!"
Configuration
For publishing to a standard MQTT broker
event_return: [mqtt_return]
returner.mqtt_return.output: mqtt
returner.mqtt_return.endpoint: mqtt
returner.mqtt_return.port: 1883
returner.mqtt_return.topic_prefix: "example/prefix"
For publishing to AWS IoT Core MQTT broker using boto3 and the iot-data client
event_return: [mqtt_return]
returner.mqtt_return.output: awsiot
returner.mqtt_return.endpoint: https://example.iot.amazonaws.com
returner.mqtt_return.topic_prefix: "example/prefix"
returner.mqtt_return.aws_access_key_id: "aaaaa"
returner.mqtt_return.aws_secret_access_key: "aaaaa"
Topic Re-writing
Allows you to re-write the topics with Regex and Python Substr
For example to remove the salt/
prefix from the topics:
returner.mqtt_return.topic_rewrite_regex: "salt/"
returner.mqtt_return.topic_rewrite_replace: ""
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
saltext.mqtt_return-0.1a6.tar.gz
(28.0 kB
view hashes)
Built Distribution
Close
Hashes for saltext.mqtt_return-0.1a6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef8296b2ec1c6f34567152f430d113deb65f13cef4950f4a4d11f592de9c9d02 |
|
MD5 | 6d872b7a9bc4da7333828f7e1c27df72 |
|
BLAKE2b-256 | 19d6b3c91b42fbf4fc486dc67864e7dff37d498ede22f16d2b81259423b38d21 |
Close
Hashes for saltext.mqtt_return-0.1a6-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 07e4b3e1ecdb35277855c479c8bafac9e7f8937de177578c9f3659217ed12996 |
|
MD5 | 3ee1a48b2ad63e83239b48fcacb53d78 |
|
BLAKE2b-256 | 88cc7c957852f512292685c8efda455ddb7b0cd982fe13903da59c650b35eaaf |