diff --git a/Commands.md b/Commands.md index 7d4f40fd..6b5f4be6 100644 --- a/Commands.md +++ b/Commands.md @@ -213,7 +213,7 @@ StateText2|`` = set `ON` state text (10 chars max) StateText3|`` = set `TOGGLE` state text (10 chars max) StateText4|`` = set `HOLD` state text (10 chars max) SwitchRetain|`0` = disable use of MQTT retain flag *(default)*
`1` = enable MQTT retain flag on switch press -Subscribe|List all topics currently subscribed
`, [, ]`
The `` parameter is optional. It is specified to parse a key/value pair from a JSON payload in the MQTT message. In order to parse a value from a multi-level JSON pair, you can use one dot (`.`) syntax to split the key into sections.

Subscribes to an MQTT topic and assigns an [`Event`](#event) name to it. You must compile your own binary with `#define SUPPORT_MQTT_EVENT` in your `user_config_override.h` file.

**Examples:**
  • `Subscribe BkLight, stat/%topic%/POWER`
          `Rule1 ON Event#BkLight=ON DO ENDON`
  • `Subscribe DnTemp, stat/%topic%/SENSOR, DS18B20.Temperature`
          where the MQTT message payload is `{"Time":"2017-02-16T10:13:52", "DS18B20":{"Temperature":20.6}}`
          `Rule1 ON Event#DnTemp>=21 DO ENDON`
  • +Subscribe|List all topics currently subscribed
    `, [, ]`
    The `` parameter is optional. It is specified to parse a key/value pair from a JSON payload in the MQTT message. In order to parse a value from a multi-level JSON pair, you can use one dot (`.`) syntax to split the key into sections.

    Subscribes to an MQTT topic and assigns an [`Event`](#event) name to it. You must compile your own binary with `#define SUPPORT_MQTT_EVENT` in your `user_config_override.h` file.

    **Examples:**
  • `Rule1`
          `ON System#Boot DO Subscribe BkLight, stat/%topic%/POWER ENDON`
          `ON Event#BkLight=ON DO ENDON`
  • `Rule1`
          `ON System#Boot DO Subscribe DnTemp, stat/%topic%/SENSOR, DS18B20.Temperature ENDON`
          `ON Event#DnTemp>=21 DO ENDON`
          where the MQTT message payload is `{"Time":"2017-02-16T10:13:52", "DS18B20":{"Temperature":20.6}}`
  • SwitchTopic|`` = set MQTT switch topic (32 chars max)
    `0` = disable use of MQTT switch topic
    `1` = set MQTT switch topic to device `%topic%`
    `2` = reset MQTT switch topic to firmware default (`MQTT_SWITCH_TOPIC`) _(default = `0`)_
    [Read more](Buttons-and-switches) about this TelePeriod|`0` = disable telemetry messages
    `1` = reset telemetry period to firmware default (`TELE_PERIOD`)
    `10..3600` = set telemetry period in seconds *(default = `300`)* Topic|`1` = reset MQTT topic to firmware default (`MQTT_TOPIC`) and restart
    `` = set MQTT topic (32 chars max) **and** `ButtonTopic` and restart