Kurse › Raspberry Pi › Stufe 19
Raspberry Pi · Intermediate · Stufe 19 / 40
MQTT and Home Automation
Connect devices through an MQTT broker and automate them with a home-automation platform.
Intermediate freischalten · CHF 19.90 Stufen 14–26, einmalig, kein Abo
10 Lektionen in dieser Stufe
- Publish and Subscribe: How MQTT Decouples Devices
Explain brokers, clients and topics and why this beats direct connections. · Lab: Draw the message flow for three devices before and after adding a broker. - Running a Mosquitto Broker
Install a broker and exchange messages with the command-line clients. · Lab: Start Mosquitto and send messages between two terminals with mosquitto_pub and mosquitto_sub. - Designing a Topic Tree and JSON Payloads
Name topics so a system stays understandable as it grows. · Lab: Design topics for a three-room house and subscribe with + and # wildcards. - Publishing Sensor Data with paho-mqtt
Send readings from a Python service and react to command topics. · Lab: Publish BME280 values every thirty seconds and switch a relay from a command topic. - QoS, Retained Messages and Last Will
Choose delivery guarantees and report when a device drops offline. · Lab: Add a retained status topic and a last-will message, then pull the power to test it. - Broker Authentication and TLS
Require credentials and encrypt traffic on the broker. · Lab: Add users with an access-control list and enable TLS with your own certificate. - Running Home Assistant in a Container
Deploy the platform with Compose and complete first-time setup. · Lab: Add Home Assistant to your Compose stack with a persistent config volume. - MQTT Discovery: Making Your Devices Appear Automatically
Publish discovery messages so entities create themselves. · Lab: Add discovery payloads for a sensor and a switch and watch them appear. - Automations, Scenes and Notifications
Build trigger-condition-action rules and send alerts. · Lab: Turn on a light on motion only when it is dark and notify a phone on high humidity. - Adding Zigbee Devices with a USB Coordinator
Bridge a Zigbee mesh into MQTT and pair a device. · Lab: Run a Zigbee-to-MQTT bridge container, pair a plug and control it from an automation.
Abschlussprojekt
A smart-room hub in which your own sensors and outputs appear automatically in Home Assistant, automations react to motion and climate, and a Zigbee device joins the same system.
Teile für diese Stufe
- 1 × Raspberry Pi 5 or Pi 4 (4 GB or more recommended) set from Level 1
- 1 × Sensor node hardware from Level 11
- 1 × Relay module and LED strip from earlier levels
- 1 × PIR motion sensor module
- 1 × Zigbee USB coordinator dongle
- 1 × Zigbee smart plug or sensor
- 1 × Raspberry Pi Zero 2 W as a second node (optional)
In jeder Lektion legst du die passenden Teile direkt in den Warenkorb. Raspberry Pi →
Voraussetzung: Levels 11, 15 and 18: sensors, services and Docker Compose.