
Day 21: House automation
In today’s test, we’ll illuminate the characteristics and possibilities of MQTT in more detail by creating a practical scenario. In the example, there is a building with two rooms, each of which has a light switch, a light and an alarm sensor. The light switch switches the light of the respective room on or off. The alarm sensors activate a building-wide alarm. Normally, seven different devices would be used here, which are all connected to each other through an MQTT broker. But since we probably have only one NanoESP, this will simulate all devices. For this reason, today’s layout looks somewhat complicated. The LED D3 is used today as the second light. Therefore, today it won’t show you whether you’re connected to the WLAN. The tilt sensors are used on the extension cables as alarm sensors. A person could, for example, attach them to doors or windows so that they trigger an alarm if the entry opens. Behind today’s door is the second sensor. ...
