Node-RED Home Automation: Building Visual Automations for Realm Labs
Node-RED has become one of the key automation tools behind Realm Labs.
Home Assistant provides the central smart-home platform, MQTT provides a lightweight way for devices to communicate, and Node-RED sits between them as the logic engine — deciding what should happen, when it should happen and which device should respond.
What started as a simple way of controlling GPIO pins on a Raspberry Pi has gradually evolved into a much more flexible automation platform running across the home lab.
Today, Node-RED is used to coordinate everything from scheduled events and Home Assistant entities to Raspberry Pi hardware, ESP32 devices, lighting and audio.
Where Node-RED Fits
The current Realm Labs automation architecture looks roughly like this:
Home Assistant → Node-RED → MQTT → Raspberry Pi / ESP32 → Physical Hardware
Not every automation travels through every layer, but separating the system in this way has several advantages.
Node-RED handles the automation logic. Home Assistant manages devices, entities and dashboards. MQTT provides communication between systems, while Raspberry Pi and ESP32 devices deal with the hardware itself.
This means the automation logic no longer needs to live on the same device as the hardware being controlled.
How the Setup Evolved
Originally, I ran Node-RED directly on a Raspberry Pi 4.
That made sense at the time because Node-RED could communicate directly with the Pi’s GPIO header using nodes such as rpi-gpio. Lighting, scripts and audio could all be controlled locally from a single device.
It worked, but it also meant the automation platform and hardware controller were tightly coupled.
As Realm Labs grew, Node-RED was moved into the central home-lab infrastructure and the Raspberry Pi was simplified into a dedicated hardware controller.
Instead of Node-RED manipulating GPIO pins directly, commands can now be sent across the network using MQTT. A lightweight agent running on the Raspberry Pi receives those commands and performs the required GPIO, Python or audio action.
That separation has made the system considerably easier to maintain, expand and troubleshoot.

