Files
ESPEasy/docs/source/Controller/C005.rst
T

76 lines
2.0 KiB
ReStructuredText

.. include:: _controller_substitutions.repl
.. _C005_page:
|C005_typename|
==================================================
|C005_shortinfo|
Controller details
------------------
Type: |C005_type|
Name: |C005_name|
Status: |C005_status|
GitHub: |C005_github|_
Maintainer: |C005_maintainer|
Description
-----------
The ``Home Assistant (openHAB) MQTT`` controller is one of the most standard "MQTT" controllers.
It has a very basic way of interacting with a MQTT broker and thus is not limited to "Home Assistant" or "OpenHAB".
Command Handling
----------------
This controller can also be used to receive commands via the broker.
For this, there are several syntax formats to receive these commands:
* Subscribe to the configured subscription topic, with ``/cmd`` as the last part of the topic.
For example:
* Topic: ``ESP_Easy/Bathroom_pir_env/cmd``
* Message: ``gpio,14,0``
* Full command: ``gpio,14,0``
* Format the command as part of the topic, with the last parameter as data.
For example:
* Topic: ``ESP_Easy/Bathroom_pir_env/GPIO/14``
* Message: ``0`` or ``1``
* Full command: ``gpio,14,0``
* Format the command as part of the topic, with a specific parameter as data. (added: 2022-03-01)
This format allows the message to be a single parameter which will be inserted at the indicated position.
For example:
* Topic: ``ESP_Easy/Bathroom_pir_env/cmd_arg1/GPIO/0``
* Message: ``14``
* Full command: ``gpio,14,0``
These topics used to receive commands do rely on the topic wildcard ``/#`` at the end of the subscribed topic string.
This wildcard is used in the default subscription topic for this MQTT controller.
If the format of the subscription topic is changed by the user, make sure to keep this wildcard in place for the command handling to work.
Change log
----------
.. versionchanged:: 2.0
...
|added|
Major overhaul for 2.0 release.
.. versionadded:: 1.0
...
|added|
Initial release version.