First off, the official Home Assistant “Getting Started” page has a bunch of information that is VERY useful. The problem with options is that sometimes it take a lot of trial and error (which could take a significant amount of time and virtually limitless frustration) before you find out what is “right” for you. Note that what is “right” for me may not be “right” for you, but I’ll explain what I did, the lessons I learned, and the reasons I went with the solution I did.
If you want to play around with Home Assistant, all you need is a Raspberry Pi 3 B+ or higher, an Application Class 2 microsd card (at least 32GB), a case, and a power supply that will give you at least 2.5A. It’s also recommended to connect this to your home network via ethernet rather than WiFi. Alternatively, you can use an Intel NUC i3 or higher (though I’d suggest an i5 or i7). I didn’t have a Pi handy, and I had some of the other options below readily available, so I went down that route instead.
The next option is a virtual machine. VMs give you a lot of benefits (snapshots, ease of setup, ease of management, ability to run multiple lower-powered computers on one piece of hardware, reduced electrical and heat considerations, speed of setup, ability to migrate VMs to another physical host, etc.
Round One: The Experiment
That’s the option I went with first: a Ubuntu workstation running on Windows Hyper-V, running Home Assistant in Docker. That was a fantastic setup and I learned quite a bit, but didn’t have access to the USB ports on the host, so I couldn’t use any USB Zigbee or ZWave hubs. This was an experimental build which I didn’t intend to be a long-term solution, but there’s no reason why it couldn’t be (other than the USB port access)
Round Two: The Hassio Virtual Machine
My second setup used Hassio as a virtual appliance in Windows Hyper-V. The Home Assistant website even provides a .VHDX file to make setup super-quick and easy (a little too quick): https://www.home-assistant.io/hassio/installation/
Just like the last VM, this one didn’t give me access to the USB ports (if you’re using ESX, that’s probably not going to be a problem for you, but I was running Hyper-V). This version was where I really started to get integrations and automations set up. Everything would have been great and I probably would have stayed with this solution if it weren’t for one fatal flaw: the supplied .VHDX is set to have a working partition of 6GB. After a month I ran out of space (with all my logging, snapshots, and plugins).
This shouldn’t be a problem since I have a total of 45TB (yes, TB) of disk space on the server hosting. So, I expanded the space in the .VHDX, and rebooted the VM… Nope, it still wouldn’t boot into Home Assistant – apparently, Hass.io only expands its volume to fill the available disk space on install, and no one I asked could figure out how to get to a command prompt that would allow me to execute a command to expand it. I could have mounted the .VHDX in Windows and deleted enough files to get the VM to boot, but this would only delay the inevitable on that VM. Rather than starting over on the .VHDX solution, and since I had a couple bare-metal computers laying around, I opted for a physical solution.
Round Three: Ubuntu with Hassio running in Docker (updated 4/7/2020)
Since the best solution for me (thus far) has been Ubuntu with Hassio running in Docker, that’s how I proceeded with this round. I started with Ubuntu Server and went through the software setup, but Home Assistant always hung at the “setting up… this may take up to 20 minutes” screen… An hour and multiple reboots later, I decided to go back to Ubuntu Workstation. Here’s the setup that my buddy TJ put together (based on work by Frenck and others).
After installing Ubuntu run:
sudo apt update
sudo apt upgrade
After the updates have completed, run:
sudo add-apt-repository universe
sudo apt update
sudo apt install -y apparmor-utils apt-transport-https avahi-daemon ca-certificates curl dbus jq network-manager socat software-properties-common
sudo systemctl disable ModemManager
sudo apt purge modemmanager
sudo curl -fsSL get.docker.com | sh
sudo curl -sL "https://raw.githubusercontent.com/home-assistant/supervised-installer/master/installer.sh" | sudo bash -s
Once that’s done, you should have a fully updated Ubuntu installation, Docker installed, and Hassio installed into a docker container.
One thing I could never get to work on the Docker configuration was USB: I couldn’t figure out how to get my Zigbee and Z-Wave-Plus sticks recognized in Home Assistant. Everything else worked pretty well. I did have difficulty updating Home Assistant via the HA user interface, and often an upgrade would just hang. Because I did most of my work remotely (while on my lunch break at work), when HA wouldn’t come back online after an update, I was stuck until I got home and could reboot the host computer.
It got so bad that I finally just put a TP-Link Kasa smart outlet inline with the power to the Linux computer so I could use the Kasa app to power cycle the whole box. I know, I know, that’s not a good idea – but I was frustrated, and it worked, but it wasn’t a long-term solution.
Round Four: The Current (updated 6/1/2020)
I didn’t really want to go the route of a Raspberry Pi because the Pi 4 doesn’t have a a stable boot from USB option (at the time of this writing), and I didn’t want to wear out a micro-SD card and have to start all over again. So I figured I’d run Home Assistant OS on an old computer – but there’s not a generic image for that – but there is an image for the Intel NUC!
I went on Amazon to look into how much a NUC would cost. Ideally I wanted an i5, but I figured an i3 would be faster than a Pi, so I started digging. Most were in the $300 range (which isn’t bad when you consider the cost of a Rasperry Pi 4, a high-end micro-sd card, a power supply, and a case/enclosure with cooling). But then I found something awesome: an Intel NUC i5, with 4GB RAM (and an empty slot for more, if needed), a 128GB NVME m.2 drive, a 1TB rotational SATA hard drive, USB 3.2 ports, ethernet port, Thunderbolt port, WiFi, Bluetooth, case and power supply included, and a copy of Windows 10 Pro – all that for $64.00. Yes, sixty-four US dollars! I bought it figuring there must be something wrong with it… It arrived, it worked as a Windows machine fantastically, and after I pulled the NVME and flashed Home Assistant on it (and removed the 1TB SATA drive), I was in business!
Both my USB sticks worked great, it booted fast, and all was happy. So happy that I decided to buy a few more. Apparently there was a typo with the listing, and the current cost is $644.00 – not the $64.00 that I was charged. Even still, for that price, it’s a fantastic machine for home use, but WAY over-powered for Home Assistant. Regardless, that’s what I’m using now.
If you’re not willing to spend $644, this is the NUC I’d suggest for now. With under 20W power consumption, it’s only a matter of time before it pays for itself over my 350W PC.
Setup and Configuration
From here, from any computer on your network, navigate to your server at the Home Assistant port: http://18.104.22.168:8123 (using your server’s IP address, of course). That may take up to 20 minutes, but mine took significantly less time (like under 2 minutes — this will depend on the speed of your CPU, etc.).
From there, I set everything up locally, but that sounds like information for another post. 😉