> For the complete documentation index, see [llms.txt](https://docs.kiloiot.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kiloiot.io/kilo-docs-de/kilo-center/kilo-mioty-service-center/integrations/mqtt-first-steps.md).

# MQTT-Erste Schritte

Erste Schritte mit KiloCenter-MQTT — aktivieren Sie den standardmäßig deaktivierten Broker, abonnieren Sie Ereignisse, veröffentlichen Sie Downlinks.

### Ziel

Aktivieren Sie die MQTT-Integration und validieren Sie den Ereignisempfang und das Veröffentlichen von Befehlen.

### Voraussetzungen

MQTT ist **standardmäßig deaktiviert** in KiloCenter. Vor der Verwendung von MQTT:

1. Stellen Sie sicher, dass der Mosquitto-Broker läuft (im Docker-Compose-Stack enthalten).
2. Aktivieren Sie MQTT in `kilocenter-modules/KC-Core/config.yaml`:

```yaml
mqtt:
  enabled: true
  host: "localhost"
  port: 1883
  username: "admin"
  password: "KiloCenter"
```

3. Starten Sie KC-Core neu, damit die Änderung wirksam wird.

### Lokale Broker-Standardwerte

| Einstellung  | Wert                                      |
| ------------ | ----------------------------------------- |
| Broker       | `localhost:1883`                          |
| Benutzername | `admin`                                   |
| Passwort     | `KiloCenter`                              |
| Themenpräfix | `mioty` (konfigurierbar in `config.yaml`) |

### Uplink-Ereignisse abonnieren

```bash
mosquitto_sub -h localhost -p 1883 \
  -u admin -P KiloCenter \
  -t 'mioty/+/device/+/event/up' -v
```

### Ein Downlink-Kommando veröffentlichen

```bash
mosquitto_pub -h localhost -p 1883 \
  -u admin -P KiloCenter \
  -t 'mioty/default/device/<EP_EUI_HEX>/command/down' \
  -m '{"data":"AQIDBA==","confirmed":false}'
```

Ersetze `<EP_EUI_HEX>` mit der EUI Ihres Endpunkts im Hex-Format.

### Ergebnis-Topic beobachten

```bash
mosquitto_sub -h localhost -p 1883 \
  -u admin -P KiloCenter \
  -t 'mioty/+/device/<EP_EUI_HEX>/event/downlink_result' -v
```

### Referenz für Themenvertrag und Payload

Die vollständige Themenstruktur und die Payload-Formate finden Sie unter:

* `kilocenter-modules/docs/mqtt-integration.md`


---

# 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.kiloiot.io/kilo-docs-de/kilo-center/kilo-mioty-service-center/integrations/mqtt-first-steps.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.
