MQTT input| The function block MQTT input is used to read any MQTT messages for which there is no dedicated block. In the settings dialog a list is created with the outputs button: one topic per line and optionally the name of a field in the JSON. One output is created for every line. This allows integrating third-party devices, Node-RED or your own scripts, for example. The received values are converted: on and true result in 1, off and false result in 0, everything else is read as a number. If a text address is assigned to the output, the content is taken over unchanged as text. |
Outputs |
||
| A0 | Value 0 | Value of the first line of the list. One further output is created for every further line (A1, A2 and so on). |
Parameters |
||
| MQTT topic | Not required for this block, the topics are entered per line in the list. | |
| Outputs | Opens the list of topics. Per line a topic and optionally JSON data are entered. If the JSON field is left empty, the whole message is used as the value. Up to 128 lines are possible. | |
| Server type | Internal (default): The MQTT broker of the controller is used, as with all Shelly blocks. It has to be switched on, see MQTT devices - general. External: The block connects to another broker in the network itself, for example a Mosquitto on a server that Zigbee2MQTT also uses. The following parameters only appear with External. |
|
| Server | IP address or name of the external broker. | |
| Server port | Port of the broker, default 1883. With TLS usually 8883. | |
| User / Password | Login at the external broker. Leave empty if the broker does not require one. | |
| TLS | Encrypted connection to the external broker. | |
| Verify certificate | With TLS, additionally checks the certificate of the broker. | |
| The topic has to match exactly here. Unlike with the Shelly blocks a part of the topic is not sufficient. With an external broker the block subscribes exactly to the topics of the list. Blocks with the same external broker (MQTT input, MQTT output, MQTT Addresses I/O) share one connection. If the broker cannot be reached, the error messages of the diagnostics show EXTERNAL MQTT BROKER NOT REACHABLE with server and blocks; the controller retries every 10 seconds. |
See also MQTT devices - general.
See also general parameters of all function
blocks.