MQTT

The MQTT plugin enables communication with an MQTT broker (server) within a network. The Miniserver always acts as a "client" and supports receiving ("subscribe") and sending ("publish") data to/from the broker.

MQTT (Message Queuing Telemetry Transport) is a simple and lightweight protocol that can be used for communication between devices. It is widely used in the "Internet of Things (IoT)" domain, e.g., for collecting data from sensors or controlling smart devices.

An external broker is therefore required, into which the Miniserver can be integrated. The Miniserver can manage up to 16 subscriptions as well as 16 publish inputs and outputs.

Please note that the Miniserver Gen. 1 is not supported.

Table des matières


Creating and Configuring an Object

The MQTT plugin can be integrated via the network peripherals:

A plugin instance can only connect to one broker instance at a time and therefore has the following settings:


Sending/Receiving Data

To receive data from the broker (Subscription) or send data to the broker (Publish), IO objects must be created:

Sending/receiving always operates on so-called topics, which represent a path/address to data identity. Subscriptions can listen to multiple topics simultaneously (Wildcards), while Publish does not support wildcards.

Example of a Topic:
If data needs to be sent to a temperature sensor in the living room, the corresponding topic could look like this:
haus/wohnzimmer/temperatur

Subscription:

Subscribe (Receiving):
Receives value changes on the specified topic from the broker.
Another device or application can subscribe to this topic to receive the transmitted messages. For example, a thermostat could subscribe to the topic home/livingroom/temperature to obtain the temperature data.

If JSON data or similar is received, it is recommended to use the "Command Recognition Block" to extract the analog value from the data.

Value changes of a subscription are evaluated at most every 2 seconds. If the last value change was received less than 2 seconds ago, additional changes will be cached. After the 2-second interval, the most recently received change will be processed. This measure is designed to relieve the Miniserver, especially when multiple changes per second are sent to a topic.

Wildcards in Subscriptions:
To avoid having to subscribe to each topic individually, MQTT offers so-called wildcards, which allow multiple topics to be subscribed to simultaneously:

Single-Level Wildcard (+): Replaces exactly one level in the topic path.

Example:
home/+/temperature

This subscription receives messages from all rooms in the house that send temperature data, such as:
home/livingroom/temperature
home/kitchen/temperature

Multi-Level Wildcard (#): Covers all following levels in the topic path and must appear at the end.

Example:
home/#

This subscription receives all messages starting with home/, regardless of the number of subsequent levels, such as:
home/livingroom/temperature
home/kitchen/humidity
home/garage/car/battery

Wildcards can only be used when subscribing (Subscribe), not when publishing (Publish). This means that a device can only send messages to a specific topic, not to multiple topics simultaneously.

Publish:

Publish (Sending):
A device (client) sends a message to a specific topic. In the example above, the temperature sensor would send the current temperature to home/livingroom/temperature.


Capteurs

Résumé Unité
Subscription Texte




Actionneurs

Résumé Unité
Publish Texte




Entrées diagnostic

Résumé Description Unité Valeurs
Onlinestatus Indique si l'appareil est accessible par le miniserveur.
Diagnostics for Air devices
Diagnostics pour les appareils Tree
Diagnostics pour les extensions
Numérique 0/1




Propriétés

Résumé Description Valeurs Valeur défaut
Adresse du broker Adresse réseau du broker MQTT - -
Port du broker Port réseau du broker MQTT (par défaut : 1883) 0...65535 -
Version du protocole Version du protocole MQTT prise en charge par le broker MQTT (par défaut : MQTTv5) - -
ID Client L'ID de ce client MQTT. L'ID doit être unique lors de la connexion au broker MQTT ! Lors de l'utilisation du protocole MQTTv3, l'ID est tronqué à 23 caractères. - -
Nom d'utilisateur Nom d'utilisateur pour l'authentification sur le broker MQTT. Laisser vide pour une connexion anonyme (si autorisé par le broker MQTT). - -
Mot de passe Mot de passe pour l'authentification sur le broker MQTT. Laisser vide pour une connexion anonyme (si autorisé par le broker MQTT). - -
Utiliser SSL/TLS Utiliser une connexion SSL/TLS avec le broker MQTT. - -
Surveiller le service Si coché, vous serez informé par l'état système ou par e-mail si ce service n'est plus disponible ou hors ligne. - -