Skip to main content

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


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-1.1rc3.tar.gz (28.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

saltext_mqtt_return-1.1rc3-py2.py3-none-any.whl (9.6 kB view details)

Uploaded Python 2Python 3

File details

Details for the file saltext_mqtt_return-1.1rc3.tar.gz.

File metadata

  • Download URL: saltext_mqtt_return-1.1rc3.tar.gz
  • Upload date:
  • Size: 28.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for saltext_mqtt_return-1.1rc3.tar.gz
Algorithm Hash digest
SHA256 fa71e76869c5435c3510b7dddcb3eac25e7ba3e77dfac6d3deb6fa2c528f714b
MD5 da8c193901b919159d9bff2dde840643
BLAKE2b-256 e324b9dc708f96b232d478c44ca45abaf94be7520575bb0de2f11ee8f997efd0

See more details on using hashes here.

File details

Details for the file saltext_mqtt_return-1.1rc3-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for saltext_mqtt_return-1.1rc3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 4512f70679f58e79e1d9dccefc8571c16d1f956c645a8a97c2ba87e23cbcaac5
MD5 bfeb4ee1dc3b9b19bcf9656cbcc41cb7
BLAKE2b-256 a19871403bf6fc1820acf4c29964cf9f4d43b5c0623dac60fc81bc334051ed01

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page