
The Architecture of HomeGenie (Ep. 4) - Intelligence at the Edge
Welcome back to the dev diary! In our last episode, we talked about "The Great Rewrite" and how moving to .NET Core and Angular gave HomeGenie a modern, fast, and structured foundation.
With the server-side architecture (the brain) and the user interface (the canvas) finally in perfect harmony, my focus naturally shifted toward the physical world. The sensors, the switches, the actuators.
Today, we're talking about taking intelligence out of the central server and pushing it to the "Edge".
The Problem with "Dumb" Nodes
In a traditional smart home architecture, the central hub does all the heavy lifting, while the peripheral devices (like a temperature sensor or a motion detector) are essentially "dumb". They just wake up, shout their current state into the void, and go back to sleep.
While this centralized approach is easy to manage, it lacks resilience. If the network lags, or the central server is busy, the peripheral device is useless. I wanted the HomeGenie ecosystem to be truly cooperative, and in a cooperative ecosystem, every participant should have a degree of autonomy and intelligence.
Enter HomeGenie Mini
This thought process led to the creation of HomeGenie Mini, a lightweight SDK and firmware designed specifically for microcontrollers like the ESP32 and ESP8266.
Instead of writing monolithic, hard-coded scripts for every single ESP32 board around the house, I brought the same component-based philosophy of zuix.js and the modularity of the HomeGenie server directly into C++ for microcontrollers.
With the HomeGenie Mini SDK, an ESP32 becomes a fully fledged, multitasking node that natively understands the HomeGenie Universal API Bus. It doesn't just send raw data; it presents itself as a structured device.
To make the integration as fluid as possible, I recently updated the HomeGenie Panel (our Android companion app) to handle the onboarding process seamlessly:
commit d56c2e5cd06a9cc63a8fbdcaa64c682df100b346
Date: Wed Feb 28 02:16:19 2024 +0100
- Added support for HG-Mini configuration via Bluetooth LEYou just power up a new HomeGenie Mini node, open the Android app, configure its Wi-Fi credentials via Bluetooth Low Energy (BLE), and it instantly joins the ecosystem, syncing its TimeZone and broadcasting its capabilities via MQTT. Pure plug-and-play harmony.
Project "Lunar": A Multitasking Touch UI on a Microcontroller
To push the HomeGenie Mini SDK to its limits, I needed a practical experiment.
I designed a 3D-printed housing for a GC9A01 round touch display paired with an ESP32-S3 chip, along with a suite of sensors (motion, DS18B20 temperature, and humidity). Because its shape vaguely resembled a spaceship passing by the moon, I codenamed it Lunar.
Lunar is much more than a sensor node. It is a standalone smart device. By utilizing the HomeGenie Mini SDK, I was able to implement a fluid, multitasking user interface directly on the tiny ESP32 screen. It can operate as a smart thermostat, evaluating motion detection locally to optimize its own algorithm efficiency, while simultaneously sharing its state with the main HomeGenie server.
It thinks for itself, but it acts as part of the whole.
💡 Developer Takeaway
Don't centralize everything just because it's the standard way of doing things.
When you design an IoT system, try to distribute intelligence. If a local device has enough computational power (and an ESP32 has plenty!), let it handle its own local logic, UI, and state management. The central server should act as a peaceful orchestrator, not a micro-manager. A resilient ecosystem is one where nodes can still function, adapt, and communicate even when the orchestrator is looking away.
Now that our peripheral nodes have their own intelligence, we have set the perfect stage for the final piece of the puzzle. What happens when the central orchestrator stops being a simple router of commands and becomes an actual Agent capable of reasoning, seeing, and understanding human language?
We'll dive into the world of Local AI and Vision in the next, massive episode.
Time to fire up the 3D printer for some new enclosures =)