update recommendation

arendst 2017-05-08 13:06:27 +02:00
parent 5c11cad093
commit 4c30c64ccf
1 changed files with 7 additions and 3 deletions

@ -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<x>`` 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.
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**