Home Server Setup

💡 Light

Lighting. I suppose it really all started with lighting. I think my first connected light I really got, was a Philips Hue, bayonet bulb. I still have it, to this day, and the evidence it's super old is that it's cracked. The top of the bulb is actually made of glass, and the housing of a heavy metal. All of the modern bulbs are lightweight and the top and body are made of plastic. That, at the time, came with a Philips Hue Bridge to connect it to and an app experience that was actually quite delightful.

💡💡Lights

That expanded with more bulbs, as well as a Philips Hue Go bedside lamp. From memory, this came with a nice “candle” feature that would flicker a warm combination of LEDs to simulate what a candle would look like. This was a nice addition to the capabilities of my existing connected setup.

➕ MOAR?

So how did I do from a mere few bulbs, maybe 10 years ago, to a self-hosted Proxmox cluster under my desk hosting all manner of connected and self-hosted services?

🔈 Audio

Sonos was the next problem. That had a different app. Then came a Yamaha Receiver/Amplifier, yet another app. Following that came an Aranet4 climate sensor which only operated over BLE. Anyway, suffice to say, the complexity became exponentially more unhelpful and less delightful.

As much as I loved all of these connected devices, it was coming to the point where all the apps I needed to control them wouldn't fit inside a single folder view on my Home Screen on my phone. Not ideal.

I first heard about Home Assistant through a blog post somewhere (I can't find the original article), and it described a this idyllic, simple, single interface to control all of your connected home hardware. I needed to investigate.

I was planning on using an old Raspberry Pi to run the setup, but on closer inspection, although it might be capable of running a simple instance, it wasn't future proof and would not likely be able to handle multiple self-hosted services. I'd read that the SD card wasn't fit for the large number of read and writes that HA (Home Assistant) would require.

I found an old Lenovo ThinkCentre on Facebook Marketplace and zoomed over to pick it up.

I had read about this magical software, built for enterprise, but free for most people called Proxmox. It is an open source server management platform for enterprise virtualization. Essentially, it would allow me to create a number of virtual machines for a range of purposes.

I formatted the hard drive and installed Proxmox.

🖥️ VMs

🏠 Home Assistant OS

Home Assistant OS is a flavour of Home Assistant that isn't running as a python script, or inside another OS, it IS the OS. This comes with a handful of additional features, importantly, Add-ons. Typically, you'd have to install these separately on your VM and hook it up to HA, which I didn't really want the hassle of.

I created a Home Assistant OS VM using the insanely helpful Proxmox Helper Scripts. This provides a single line you can run on the console of your PVE (Top level Proxmox shell)

After running that command, in a matter of seconds, I had my very first VM on my Proxmox server. I then played with this for a few hours, adding as many of my connected devices as I could. This was made especially easy due to the nature of HA and the way it just automatically detects and suggests devices it finds on your network. This was my Hue system, my Sonos speakers, and my Brother Printer.

The Aranet4 devices however weren't being discovered, this was due to another problem I hadn't anticipated. BLE. I'll come onto that a little later…

🔒 Wireguard

HA offers a paid subscription that allows you to access it remotely and as much as I love the HA community and all the folks that created it, I wanted to control that myself, and perhaps use it for a wider range of services remotely, outside of HA.

My work happened to use Wireguard for some things, and I thought I would give it a try.

It was a quite complex to setup, and I tried and failed for various reasons perhaps 5 times. Finally, after correcting all my mistakes and doing all the things in the right order, I got it working.

I added my Phone as a Peer as well as my laptop. If this works, I can access my Proxmox cluster, all the VM's and other devices on my home network remotely.

🎬 Plex

I had an handful of old hard drives that weren't being used in a box in my utility room, as well as a USB 3.0 SATA dock. I wired all that into my Proxmox server, forwarded the USB to the new Plex VM (Also created with the help of those scripts) and set up my home media provider.

I initially wanted a more high-res audio experience on my Yamaha amp as it has some very nice speakers attached and the sound from my record player is beautiful. I wanted to also have the same digital experience. Although the Yamaha has AirPlay, and also Spotify built in, those are inherently low-quality (especially as I don't use Apple Music, or Tidal for example).

Once the Plex VM was up and running, I added some .flac media I had as well as some .wav files and connected the receiver to the IP. It worked as expected! The UI on the receiver has much to be desired, but I was now able to stream that audio locally.

💬 OpenWebUI

This was the most recent VM I span up.

The reason I added this was because I was constantly flipping between chatting with ChatGPT and Claude. Each had their own front-end and I had different conversations in both, so it was sometimes hard to find the one I was looking for.

Again, the scrips came in handy here as that got most of it set up for me.

OpenWebUI comes with an OpenAI integration out of the box, but didn't support Anthropic models (Claude), so I had to root around to find out how to add their models in there too.

After half an hour or so, I had it up and running, and I now have a consolidated range of OpenAI models and Anthropic models in the same UI which I an toggle between simply.

🤔 The BLE problem

BLE, which stands for Bluetooth Low Energy, is a flavour of Bluetooth that my Aranet4 sensors use to communicate with my phone.

As my trusty Proxmox server, installed on an old ThinkCentre didn't have any Bluetooth capabilities, and the range of the Aranet4's was short at best, I had to find another solution.

⚡ ESP32

An ESP32 is a very small microcontroller with a bunch of stuff built in. I chose some cheap boards from Amazon which arrived a few days later.

There is an Add-on in HA you can get called “ESPHome”. This allows you to provision, and flash ESP devices and integrate them with HA.

The boards I had bought had a Bluetooth and a WiFi antenna. I just needed to connect the 2 together (not literally of course).

I read a bunch of stuff online and felt confident it was possible and proceeded to fail maybe 8 times to get it set up right.

The idea was that, if done correctly, the HA instance would think it had Bluetooth and could see across the house.

Finally I got it working, and low and behold, my Aranet4 devices appeared in my HA. I created 2 ESP32 BLE Proxies and have them in strategic places in the house to achieve maximum coverage. I even tried 3D printing an enclosure for them, but that left much to be desired. Perhaps I'll come back to that project at another date.

🤷‍♂️ Dumb Lights

In my kitchen, there is an LED strip under the counter that illuminates the sink and worktops. This was just on an in-line switch which you could toggle by hand. Well, that was ripe for a project.

I bought a Sonoff Basic R2. This is WiFi connected switch. Knowing what I know now, I would do this differently, but this was a project nonetheless and I learnt a bunch from it.

The wire going to to the light from the mains was interrupted with an in-line switch. The wire was only 2 core. 1 live and 1 neutral. The Sonoff Device accepted 2 inputs and 2 outputs, the same configuration as the inline switch.

I turned off the power, cut the wire and wired it into the Sonoff device.

The setup was painful as it required another separate app, an account and a bunch of other stuff (hence the thought that I would do it differently if I did it again), but after playing around, finally I had it set up with my HA instance, and I could control it from my dashboards!

🎛️ 🛏️ Bedside Buttons

In my bedroom, I have a pair of Hue bulbs, one in a lamp on either side of the bed. These could be controlled by the Hue app, as all Hue bulbs act as a mesh booster, so as long as there were enough (but not too many) bulbs nearby, the range is pretty much not a problem.

I could have bought a few more Hue Dimmer Switches, which I quite like but I had previously seen some from IKEA that were simple looking and provided the opportunity for another project.

These, like the Hue switches, and the Hue lights used the Zigbee connection method. Problem was, they weren't Hue products, so I didn't think I'd be able to add them to the Hue App.

I bought a Sonoff Zigbee 3.0 USB Dongle Plus from Amazon which promptly arrived and decided to learn a bit more about using it in the house.

I plugged it into the back of my Proxmox server, forwarded it to the VM and voila, HA now had a Zigbee capability.

Problem was, the server was really far from the bedroom, and although I could set up the switches next to the server, they wouldn't work when in the bedroom.

I realised that the problem was with the antenna being in the back of the server, and not in a more central location.

I didn't want to move the server, as it was wired into ethernet and didn't have WiFi and was already in a socially-acceptable location in the office. I didn't want it in the living space or anywhere else it could really be noticed.

In comes that old Raspberry PI I mentioned earlier…

🛜 Zigbee2MQTT

At the time of writing this, I'm still very much at the start of my journey with this product/technology and I'm sure it will prove to me even more fruitful later on, and perhaps even replace my Hue bridge all-together, but that's perhaps a future challenge.

I installed a very light version of Raspberry OS, 32-bit, on my pi, and installed zigbee2mqtt.

I also unplugged the Zigbee antenna from the server, and plugged it into the PI.

The setup was fairly simple and at this point I've very much not afraid of sudo nano and modifying yaml files etc.

I got it set up and connected to my HA instance and then proceeded to pair the IKEA switches to that.

Once paired, I was able to see them in HA and could create some automations that would be triggered by various button presses on the remotes.

Neat!

🖌️ Hue Signe Gradients

The Hue integration in HA is neat and simple. It allows you to leverage the Hue API to make calls to your lights. It offers scenes and a bunch of other stuff, but it's also just limited when it comes to the Signe Gradient lamp. I presume this extends to other gradient lights as well, by the way.

I wanted more granular control over the beautiful gradient capability of the light and read that using MQTT was just a better alternative all together.

I detached the light from my Hue app/bridge and then looked for it thought the eyes of my Zigbee2MQTT setup. It spotted it right away and began “interviewing” is and added it to my HA setup, super fast!

I found that I had a much wider range of gradients, and with the help of Claude (with my OpenWebUI interface) I was able to pass custom gradients to the light!

In the future, I plan to perhaps build a more complex set of automations, but for now, knowing that I have more control over my expensive light was enough for me.

🏹 Conclusion

As the saying goes, had I known back then when I bought my first Hue bulb, that it would trigger an obsession with self-hosting, bla bla bla, but curiosity was really the key. Wondering “could that connect to that” and “how can I use this piece of hardware to add value…” etc is my main takeaway from this

Thanks for reading 🤝