The many things you can accomplish with an Unraid server is one of the operating system’s greatest strengths. Just want network attached storage? Unraid has you covered. Need a bunch of VMs for testing purposes or to run certain applications? Again, Unraid has you covered. Want to host your own applications and keep your data local and private? The Community Applications have you covered. In this guide, I will be elaborating one potential function of Unraid in particular: turning it in to the ultimate home automation server.
If you have been following this blog for some time, it should come at no surprise to you that I am deep in to the home automation rabbit hole. Just sitting at my desk, there are two Zigbee lights illuminating my workspace, there is an NFC sticker on my monitor stand to control those lights, and an ESP8266 is hooked up to my laptop for a DIY project. There are many reasons as to why running your own home automation on Unraid is better than buying in to a commercial product. Not just do you have broader compatibility, but everything can be locally controlled.
- The case for local — Why you should be self-hosting
- Home Assistant: The controlling platform
- Moquitto: The MQTT broker
- Zigbee2MQTT: The only Zigbee hub you need
- Node-RED: Visual automation
- Frigate: NVR with real-time object detection
The case for local — Why you should be self-hosting
I am aware that Unraid isn’t just aimed at advanced users such as you and me, but is also seen as an entry in to self-hosting. It sits somewhere between a pre-built NAS and more complex operating systems such as TrueNAS CORE. Before introducing any applications, I want to explain why local is better, for those just starting out on this wonderful journey.
Picture this: You are hosting all of your data on Google’s cloud serves, including important documents you might need for next year’s taxes and photos of your children growing up. One day, you receive an obviously automated message: Your Google account has been shut down for an unnamed terms-of-service violation. And because you were travelling, you missed the generous three-day window to download your data. Everything you once had saved is gone: Your Google Drive files, your Google Photos uploads, and any purchases you might have made on the Google Play Store. The most frightening part of this thought experiment is that it actually happens all the time.
Your data isn’t relevant to them
A prominent case of what I just describe was the one of Terraria lead-developer Andrew Spinks. They were in luck because they had something Google wanted as leverage: Google wanted Terraria on their dying Stadia platform. Do I have leverage? Certainly not. Do you? Most likely not, either. Google couldn’t give two hoots what happens to our data. Once Google has banned you from their platform, you are unlikely to even get the opportunity to speak to a human.
The alternative is to host your data locally. With local data, you are the one in control. No big, soulless company can sever your access to your data. And if you have everything set up the way it should be, your data is just as safe from hackers, ransomware, and natural disasters as it would be in a cloud host’s data centre.
Internet connectivity isn’t a necessity
Another reason as to why local is better, is the fact that when you self-host the applications you use, everything you want to stay local, stays local. Don’t want a stranger to randomly see your camera feed, as was the case with eufy security cameras not too long ago? Don’t let that stream leave your own four walls. Want to use your smart switches to turn on a light when the internet goes down? Make sure they are controlled locally.
Not every integration with Home Assistant, my home automation of choice, is run locally. When considering a new purchase, I highly suggest you make sure it allows local control and isn’t reliant on an internet connection.
This isn’t just important in case your internet goes down. Vendors will frequently decide that they are no longer interested in supporting a certain product. Others might decide to suddenly introduce a monthly subscription to a service that was previously free. In these situations, you will either be left with an expensive paperweight or, as is the case in the latter example, an unlockable paperweight tied to a monthly payment. With local control, you are not reliant on any company’s cloud servers or services. The device you paid for is yours, and no one can take its functionality away.
Home Assistant: The controlling platform
Home Assistant is the do-it-all platform that has gone from strength to strength in the last year or so, and it is now the second most popular Python project on GitHub. Its popularity has even led it to be featured on the Linus Tech Tips YouTube channel not once, but twice, exposing it to millions of viewers. Home Assistant takes over the role of the central hub of an Unraid-powered home automation server.
Not only does Home Assistant integrate with physical objects in your smart home, such as lights, locks, and shutters, but also other applications you might be hosting on your Unraid server. You can control Transmission’s turtle mode, check the activity of your Plex Media Server, or enable one of AdGuard’s many functions.
What Home Assistant can do for you
Home Assistant gives you the power of home automation without having to connect to any cloud services. There are no required subscription fees and the software is yours to keep. If you want to support the development, there is the option of signing up to Home Assistant Cloud, but it is not a necessity. Home Assistant integrates with over 1800 services, which allows you to do just about anything using your smart devices. Thanks to Unraid, even you can run the best home automation software on your own home automation server.
Want to combine Zigbee, Wi-Fi, and Z-Wave under one roof? With Home Assistant, you can. Want to turn on your Nanoleaf light panels whenever you boot your PC or turn on the TV? With Home Assistant, you can. Want to tune those lights depending on the weather, the current brightness of the room, or whether the film you are watching on Plex is playing or paused? Again, Home Assistant makes it possible. Or perhaps you are interested in monitoring the Unraid home automation server powering the platform and receiving a notification whenever the CPU reaches a certain temperature? You guessed it, Home Assistant is the answer.
Home Assistant scripts and automations
On a very basic level, Home Assistant can do two things, besides integrating and monitoring other services: It can run scripts, and it can automate your home. Scripts have to be executed manually and are a sequence of events. These can be triggered by virtual buttons in the Home Assistant Lovelace dashboard or any physical device that can be toggled. For example, my bedtime script, which dims the lights for five minutes and starts playing white noise on a Google Home smart speaker, is triggered by tapping my phone to an NFC sticker.
While it is technically possible to run Frigate using your CPU, it will likely take up most of your available resources. A Google Coral Accelerator, a device smaller than most external SSDs, is recommended for smooth operation. You can either buy a Coral Accelerator as an external, USB accessory, or as an internal, M.2 compatible addition to your motherboard. The latter has the benefit of being hidden away, a lower price, and double the performance.
- A USB accessory that brings machine learning inferencing to existing systems. Works with Raspberry Pi and other Linux systems.
- Performs high-speed ML inferencing: the on-board edge TPU Coprocessor is capable of performing 4 trillion operations (tera-operations) per second (tops), using 0.5 watts for each tops (2 tops per watt).