aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md10
1 files changed, 7 insertions, 3 deletions
diff --git a/README.md b/README.md
index 8bf7818..24c635f 100644
--- a/README.md
+++ b/README.md
@@ -55,14 +55,19 @@ The routes follow the following format:
On startup, `mqttr` will read the config file and subscribe to all the topics.
When a message is received, `mqttr` will match the message topic against the
routes and execute every program which is part of a matching route. Each program
-will have the message topic appended as an additional argument and will receive
-the message on stdin.
+will have the message topic as well as the DUP, QoS, RETAIN and Packet
+Identifier (when applicable) appended as an additional arguments (in that order)
+and will receive the message on stdin.
An example program is this script:
```bash
#!/usr/bin/env bash
topic=$1
+dup=$2
+qos=$3
+retain=$4
+((qos == 1 || qos == 2)) && pkid=$5
action=$(jq --raw-output .action)
[[ $action == "toggle" ]] || exit 0
mosquitto_pub --topic "zigbee2mqtt/light/set" --message '{"state":"TOGGLE"}'
@@ -75,7 +80,6 @@ it being ran every time a new MQTT message is published to this topic.
* Configurable timeouts (eventually configurable per process)
* Configurable QoS for each subscription (default is 0 (at most once))
-* Pass message metadata via the environment (QoS, retain, dup)
* Configurable logging
* Ability to configure programs with non-UTF-8 in paths
* Maybe config reloading on SIGHUP