The Protocol Zoo
Smart homes are a mess of protocols. Philips Hue uses Zigbee, Samsung things use Z-Wave, and cheaper devices use WiFi. They don't talk to each other. This project builds a Universal Gateway running on a Raspberry Pi to bridge them all.
Architecture
The hub acts as a translation layer.
- Hardware: Raspberry Pi 4 + Zigbee/Z-Wave USB Dongle.
- Software: Node.js service utilizing
zigbee2mqttandzwave-js. - Bus: MQTT (Mosquitto broker) serves as the central nervous system.
The Logic Layer
We built a rule engine in Node.js.
IF [Motion Sensor] triggers AND [Time] is > 6PM THEN [Turn on Living Room Lights]
Because everything publishes to MQTT topics (e.g., home/living-room/motion), the logic engine doesn't care if the sensor is Zigbee or WiFi. It just listens to the topic.
Local First
Privacy is key. Unlike Alexa or Google Home, this hub processes everything locally. No cloud dependency means:
- Speed: Latency is < 20ms.
- Reliability: Works even if the internet goes down.
- Privacy: No audio/data leaves the house.
Conclusion
This project evolved into a fully automated home environment, proving that open standards (MQTT) generally beat walled gardens in the long run.