> For the complete documentation index, see [llms.txt](https://docs.buildings.ability.abb/collection/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.buildings.ability.abb/collection/german/pflichtbasis/platform-core/connect-hub/connectivity-as-a-service/connect-devices-via-mqtt.md).

# Geräte über MQTT verbinden

## Über MQTT

MQTT ist ein OASIS-Standard-Nachrichtenprotokoll für das Internet der Dinge (IoT). Es ist als leichtgewichtiges Publish/Subscribe-Nachrichtentransportprotokoll konzipiert, das ideal für die Verbindung entfernter Geräte mit kleinem Code-Footprint und minimaler Netzwerkbandbreite ist.

Das Protokoll basiert auf dem Publish/Subscribe-Modell (auch als Pub/Sub bekannt) und besteht aus 4 Hauptkomponenten:

1. **Publisher**: Ein Publisher ist eine Nachrichtenquelle. Er sendet Nachrichten an bestimmte "Topics" im Netzwerk. Topics sind benannte Kanäle oder Kategorien, die den Nachrichtentyp kennzeichnen. Eine Wetterstations-Sensor könnte beispielsweise Daten zum Topic "Weatherdata" veröffentlichen.
2. **Subscriber**: Ein Subscriber empfängt Nachrichten, indem er bestimmte Topics abonniert. Er gibt an, für welche Topics er sich interessiert, und erhält dann die entsprechenden Nachrichten von Publishern, die Nachrichten an diese Topics senden.
3. **Broker**: Ein MQTT-Broker ist ein Server, der alle Nachrichten von den Publishern empfängt und die Nachrichten anschließend an die entsprechenden Subscriber weiterleitet. Der Broker ist das Herz des MQTT-Protokolls.
4. **Topics** sind wie Kanäle oder Kategorien, unter denen Nachrichten gruppiert werden. Publisher senden Nachrichten an bestimmte Topics, und Subscriber empfangen Nachrichten, indem sie Topics abonnieren. Topics könnten beispielsweise Themen wie "Sensor Data/Temperature", "Messages/Warnings" oder "Control Commands/Light" sein.

## Vorgehensweise

Geräte werden in den folgenden Schritten über MQTT verbunden:

1. Zunächst wird eine Verbindung zu einem Broker hergestellt und konfiguriert.
2. Auf diesem Broker wird ein Abonnement für ein bestimmtes Topic erstellt.

{% hint style="warning" %}
Alle Schritte in diesem Dokument setzen voraus, dass ein korrekt funktionierender Broker verfügbar ist. Dieses Dokument erklärt nicht, wie ein Broker konfiguriert wird.
{% endhint %}

{% hint style="info" %}
Interne Broker-Version: mosquitto Version 2.0.11 Client-Version: MQTT 3.1/3.1.1 Proto
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.buildings.ability.abb/collection/german/pflichtbasis/platform-core/connect-hub/connectivity-as-a-service/connect-devices-via-mqtt.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
