diff --git a/MQTT-Features.md b/MQTT-Features.md index f44d5731..575b7e00 100644 --- a/MQTT-Features.md +++ b/MQTT-Features.md @@ -28,8 +28,8 @@ Telemetry data will be sent by prefix ```tele``` like ```tele/sonoff/SENSOR {"Ti Until version 5.0.5 the MQTT topic was defined rigidly by using the commands ``Prefix`` and ``Topic`` resulting in a command topic string like ``cmnd/sonoff/Power``. Starting with version 5.0.5 the MQTT topic is more flexible using command ``FullTopic`` and tokens to be placed within the user definable string up to 100 characters in size. The provided tokens are: -- %prefix% to be dynamically substituted by one of three prefixes as defined by commands ``Prefix1``, ``Prefix2`` and ``Prefix3``. -- %topic% to be dynamically substituted by one of the five topics as defined by commands ``Topic``, ``GroupTopic``, ``ButtonTopic``, ``SwitchTopic`` and ``MqttClient``. +- ``%prefix%`` to be dynamically substituted by one of three prefixes as defined by commands ``Prefix1``, ``Prefix2`` and ``Prefix3``. +- ``%topic%`` to be dynamically substituted by one of five topics as defined by commands ``Topic``, ``GroupTopic``, ``ButtonTopic``, ``SwitchTopic`` and ``MqttClient``. Using the tokens the following example topics can be made: - ``FullTopic %prefix%/%topic%/`` being the legacy situation up to version 5.0.5 @@ -37,4 +37,8 @@ Using the tokens the following example topics can be made: - ``FullTopic tasmota/bedroom/%topic%/%prefix%/`` - ``FullTopic penthouse/bedroom1/bathroom2/%topic%/%prefix%/`` -To solve possible MQTT topic loops I strongly suggest to use the %prefix% token in all of your FullTopics. It may work without %prefix% as I implemented some validation by forcing the use of a prefix in commands send to the device but status and telemetry do not need a prefix. Just play with it and report strange problems I might solve in the future. \ No newline at end of file +To solve possible MQTT topic loops I strongly suggest to use the ``%prefix%`` token in all of your FullTopics. It may work without %prefix% as I implemented some validation by forcing the use of a prefix in commands send to the device but status and telemetry do not need a prefix. Just play with it and report strange problems I might solve in the future. + +The use of the ``%topic%`` token is also mandatory in case you want to use ``ButtonTopic`` and/or ``SwitchTopic``. It also provides for grouptopic and fallback topic functionality. + +Recommendation: **Use both tokens at all time within your FullTopic string** \ No newline at end of file