Everything about my smart home and homelab setup
I've written a couple of posts in the past about how my home network and home automation setup is laid out, but it changed so much over time that it's now time for an updated post! This time I'll put everything together in the same post.
Part 1: Network stack
My network infra is entirely Ubiquity hardware for a simple reason: I wanted something that was designed for power users, but also that didn’t have too much of a learning curve. While I usually fit the criteria of a mega power user for this type of stuff, modern networks are extremely complicated, so I preferred to stop somewhere in the middle of the curve to avoid the stress of being unable to use the internet due to misconfigurations.
By the way, before starting, I would like to note that this setup is extremely overkill for the average home network! I went for this simply because I thought it was cool, so if you’re reading this because you’re looking for equipment recommendations, keep in mind that something considerably less powerful would most likely already do the trick for you.
Router: Cloud Gateway Fiber
For the router, I chose the Cloud Gateway Fiber as this router is a complete bargain for what it brings to the table. Not only does it have three 10 Gbps ports (one of them being RJ45), including one for WAN, it even has a PoE+ port that can power an AP. Usually something like this would be extremely expensive, but for some reason it just… isn’t, and I guess the market agrees, because finding one of these is a massive challenge. They are constantly sold out almost everywhere as of writing.
AP (WiFi): U7 Pro XG
For the AP, I chose the U7 Pro XG, which is a WiFi 7 router with support for the 6 GHz band. This thing even has a 10 Gbps uplink for some reason which I can’t even use as the PoE+ port on the router is “only” 2.5 Gbps, but it was a very cheap upgrade compared to the regular version, so it seemed like a no-brainer. Luckily I do have WiFi 7 devices around already (the newest iPhones), so I can and am already making use of it.
Switch: Flex 2.5G
I prefer connecting things via Ethernet for maximum performance and reliability, so I chose a Flex 2.5G switch particularly because it has the same SFP+ port that the router has, allowing me to connect the two via fiber and get a clean 10 Gbps connection between them. I also have a second switch of the smaller variant on the opposite end of the apartment. Naturally this means I have long Ethernet cables running through the ceiling to reach all the different rooms of the apartment.
DNS: Pi-Hole
I have a simple Raspberry Pi 3b running Pi-Hole to act as my personal DNS server. It runs Unbound and has a cron job to update the root DNS server list every month. I do not enable it globally though; only certain devices make use of it because I want to prevent guests from having issues as the Pi-Hole makes certain types of websites a bit harder to navigate (sometimes it blocks more than it should and breaks the website).
VPN: WireGuard
My router has native WireGuard support, so I use it to have my phone connect to my home network whenever I'm not connected to my home Wi-Fi. The main use for this is for me to make use of the Pi-Hole anywhere, so as a result the VPN automatically sets the Pi-Hole as the DNS server for its connected devices. I also sometimes use it to access the router's admin console remotely. Nothing else is routed through this VPN.
IP Stack: IPv4 and IPv6 Dual Stack
I went through the trouble of enabling and configuring IPv6 on my network for no reason other than I thought it would be cool. Every VLAN and firewall feature mentioned below then accounts for both IPv4 and IPv6. When it comes to IPv6, the internal networks use SLAAC to distribute the prefixes and have ULAs set up to make writing the IPv6 variant of each firewall rule easier.
VLAN and Firewall setup
My network today consists of a combination of “regular” devices (like my phone), servers, and random IoT devices. To connect these effectively and securely, I went for the following setup:
- VLAN1: Management
- Contains only the Ubiquity hardware. Has full access to everything.
- VLAN10: Trusted
- Phones, computers, and my local servers (Pi-Hole, etc). Has mostly full access to everything, apart from gateway / admin console access which I have made so that only certain devices can access.
- VLAN20: IoT
- Everything home automation related that works via Wi-Fi. This VLAN is completely locked down from everything. It has no external internet access, and they cannot even contact each other (via Wi-Fi client isolation). They are only allowed very specific IP+port exceptions that I control at the firewall level, such as allowing some of the devices to send specific bits of information to my Home Assistant for automation purposes. Otherwise they cannot do anything.
- VLAN90: VPN
- Powers the WireGuard integration mentioned above. Fully locked down by default, with only a set of minimal firewall rules to allow my phone's IP to access the Pi-Hole and the admin console.
Wi-Fi
My AP exposes three Wi-Fi SSIDs:
- "Max" network: 5GHz and 6GHz bands, WPA3, Wi-Fi 7 features, basically a network that only has modern features enabled for modern devices.
- "Legacy" network: 2.4GHz band and none of the modern stuff enabled. Used for older devices like the Nintendo Switch that cannot connect to the "Max" network for some reason (either because it only supports 2.4Ghz or because one of those modern features causes it to not work properly)
- "IoT" network: Similar to the "Legacy" network, but even more stripped down. Connects the device to the isolated IoT VLAN.
To maximize performance and efficiency, every once in a while I use the AP's radio scanning features to find the most optimal settings for things such as channel selection and transmit power for each band.
Final thoughts on Part 1
I’m very satisfied with my hardware and setup choices. As I mentioned above this is all extremely overkill for what I actually use my home network for, but doing so resulted in me vastly increasing my networking knowledge and capabilities and that was my main goal here :)
Part 2: Smart Home / Home Automation
Everything in my smart home revolves around two main devices: A Home Assistant server and an Alexa.
I use Home Assistant OS like many others. The way I like to describe HA is that it's an Alexa on steroids. With an Alexa, you buy smart devices, link them with the Alexa, and then set up automations to control those devices based on conditions like time, weather, and so on. But the problem with Alexas is that 1) the devices must support Alexas specifically, and 2) the automations themselves are very limited, only allowing you to do simple things.
Home Assistant doesn't have such limitations. HA is open-source and has a thriving community, meaning you can find plugins that enable integrations for pretty much anything you can think of, and if you don't, you can build such plugins yourself assuming you have the programming chops to do it! HA is very extensible, and thus perfect for power users who want to set up complex automations or integrate unusual devices in unusual ways.
Primary Main Server: Raspberry Pi 5 w/ Zigbee Dongle running HAOS
For a long time, my hardware for running HAOS used to be a simple Raspberry Pi 3b and an SD card. The HA community tells you that this is a bad idea (The 3b is weak and SD cards can die if you use them too much), but in my experience this is fine as long as you don't have too many devices / automations / integrations. It's a good starting point, and it did the trick for me for a couple of years until I started wanting to do more complicated integrations.
Nowadays, I've retired the 3b in favor of a Raspberry Pi 5 w/ 8GB RAM, with a 256GB official RPi NVMe SSD and enclosed in the Argon One V3 case. This gives HA enough power and cooling to do everything that I need with ease.
Today I run the server via a wired connection, but there was a long period of time where I was running it through Wi-Fi. The community says that this is a bad idea for latency reasons, but I never had any such issues. While the wired connection is definitely much faster, the Wi-Fi latency never really bothered me, so I can confirm it's totally fine to run HA over Wi-Fi if you can't run a cable to it.
The server has a Sonoff ZBDongle-E USB antenna plugged into it to allow HA to recognize and drive Zigbee devices, which I'll mention in more detail further below.
Secondary Main Server: Amazon Alexa for voice control and Matter bridging
In conjunction with the HA server, I use an Alexa to do two things my HA server can't do by itself: voice control and Matter bridging. Since I don't have the HA's dedicated Matter antenna, I use the Alexa to host any Matter devices I purchase and then use HA's Matter Hub custom integration to allow the Alexa to "share" these devices with my HA server. This allows me to control everything via the HA UI even though in practice some of the devices are actually "owned" by the Alexa itself. I then also use the same integration to do the opposite (share devices "owned" by HA with the Alexa), allowing me to control everything and anything via voice commands.
Dashboard Tablet
I'm using a generic Huawei Android tablet under my TV to serve not only as a physical dashboard, but also as a digital photo album when idle:
The dashboarding functionality itself is achieved by using Wallpanel to expose the tablet's controls to HA, while the photo album logic is handled via HA's lovelace-wallpanel custom integration. I host the photos on HA itself. Since this is a Wi-Fi device, it connects to the IoT VLAN to fully isolate it from the external world (especially because this is a Chinese Android device).
Communication: Wi-Fi, Bluetooth, Zigbee, Matter (Thread)
My smart devices implement different protocols depending on the type of device, with Zigbee currently comprising the great majority of them and Matter via Thread (the Matter "equivalent" of Zigbee) slowly catching up.
If you have no idea what these words mean, Zigbee and Thread are alternative wireless radio communication systems made specifically to be used by IoT devices. Unlike Wi-Fi, they use very little energy and lay out a mesh network where the devices can propagate information to each other (as opposed to Wi-Fi's "star" network where everything has to go through the router), making them perfect for home automation setups.
Matter on the other hand is simply a protocol designed to accommodate the fact that different devices might require communication capabilities. Back in the day there would be no straightforward way to make a Wi-Fi device talk (for example) to a device that didn't also use Wi-Fi, but today if both these devices implement Matter, they will be able to communicate as long as you have a third device somewhere that can act as a "translator" between these two two devices (referred to in the protocol as a "border router"). That's why when you purchase a Matter device that uses Thread you'll see a note that you need a "Thread border router" to use it; your home is primarily a Wi-Fi/Ethernet network, so something needs to be able to translate that from-and-to Thread commands for you to be able to plug it on said network. Most modern smart home hubs like the Alexa can act as such routers and are advertised as such.
The reason I use Zigbee the most is simply that Matter via Thread was not yet a thing when I first bought these devices. Most new devices nowadays seem to not support Zigbee at all (opting to use solely Matter via Thread instead), so I expect that little by little my Zigbee usage will reduce until everything operates via Matter.
Proxying Bluetooth with ESP32s
Another critical component of my smart home worth mentioning is Bluetooth Proxying. Some of my devices operate via Bluetooth (curtain motors, plant monitors), but because the HA server itself is in a cabinet, they get zero signal that way.
The solution to that is to have a device that acts as a bridge between Wi-Fi and Bluetooth and place it near the Bluetooth devices. That way most of the data flows via Wi-Fi, and the Bluetooth connection itself gets a perfect signal since the bridge will be right next to the devices in question.
I use a single small inexpensive ESP32 S3 device to do this job. This is a very common use case, so the ESPHome addon for HA has built-in utilities to flash such devices with the right firmware and connect them to HA itself. It was very easy to set up this functionality.
Devices and Automations
Detailing every device I own would take too much time and probably not be interesting in the slightest, so here's a small summary: I got lamps, door sensors, buttons, remote controls, CO2 and air quality sensors, plant monitors, configurable displays to show whatever I want, smart switches, motion sensors, smart TV, a robot vacuum, the list goes on. Everything is connected to HA and used in unison to provide a bunch of automations that I use to make my life easier. I also use the Home Assistant app itself to provide even more automation surfaces (mostly GPS and the ability to receive push notifications).
Some of my favorite automations are:
- Adjusting the color temperature of my hall lights depending on the sun's current position
- Turning off the dashboard's screen when the TV is turned on, and on again when it's turned off, unless the "Time to Sleep" automation has been triggered very recently, in which case the automation should avoid turning it on again
- Turning on / off the hall's lights based on motion, except if it's too late in the night or if the remote control has been used to manually adjust the light, in which case the automation should do nothing
- Automatically turn on the living room lights when it starts getting late, and the later it gets, the more red the lights become to reduce my exposure to blue light before I go to sleep
- Using HA's scripting functionality to expose an arbitrary set of commands as a dedicated entity that can be exposed to Alexa as a device (and thus enabling the script to be triggered via voice)
- "Travel mode": A script / voice command that disables any and every time-based automation, plus turns off the entire home, to be used to save energy when I'm going to sleep somewhere else
- Having physical buttons around the house and assigning pre-programmed actions to them such as opening / closing all curtains, or turning off everything when it's sleep time
- Showing alerts on one of my smart displays if e.g. one of my plants needs water
- Getting phone notifications when the 3D Printer finishes printing
Important: No Smart Locks
I do not use smart locks because they make me uncomfortable. Sometimes I think it could be cool to be able to open my door with the same RFID tag I use to open the building's gate, but I also feel that I would be constantly stressed out when traveling thinking that the door would spontaneously unlock itself. So this became effectively a section of life where I explicitly do not want any tech or automation.
Final thoughts on Part 2
As you can see, this is no different than coding any software. The biggest hurdle is providing an abstraction that allows HA to gather and send data to things that are not natively supported by the platform, but in my experience, even the most niche devices out there already have plug-and-play solutions developed by the community, which is amazing.
When it comes to smart homes and homelabs the important thing is to make sure you're making your life easier. A mistake I see people make a lot is to make their networks and setups so overcomplicated that it actually becomes harder to live. The reason everything detailed here works for me is that it was meticulously organized to serve me, so I never feel that my home is working against me! :)