I was unable to find a full yet short description on how to install and run a fully dockerized Home Assistant (HA) setup. Knowing myself, I will probably also not deliver on keeping in short but I will do my best.
So what do I mean by fully dockerized Home Assistant? There are numerous ways to get HA up and running on anything from a Raspberry Pi to a normal Windows, Linux or Mac computer. There is fairly exhaustive documentation on all the different installation methods, with the “Home Assistant Operating System” option on a Raspberry the easiest and probably most used choice.
This is also how I started gathering my first experience with HA and it’s great to get started and learn just how powerful HA is when it comes to bringing together all those “smart” devices in your home.
However, the ease of setup using the “Home Assistant Operating System” approach on a Raspberry has some disadvantages which eventually led me down a different path. The biggest issue for me was “poor” performance of the Raspberry compared to standard PC hardware, especially with respect to storage. The standard Raspi install on an SD card is just not a great storage solution when it comes to speed, size or reliability. With a small HA setup this does not matter, but as I added more and more devices and functionality, my databases grew and my system was less and less responsive.
Of course one can find ways to connect better and faster storage to a Raspi, but I decided to rather use a dedicated mini PC. As of the time of writing this, Raspis are very hard to find for a good price while older mini PCs can be found fairly cheaply on the used market.
My goal was to find a PC that can not only run HA and all the other services I’d like for home automation, logging and graphing but also act as a sort of general purpose home server to run for example a PLEX server which serves media to our TV or mobile devices. I also wanted enough power under the hood to maybe do some simple AI on images or videos streams should the need arise one day.
In short, my hardware requirements were (in decreasing order of importance):
- fast CPU – enough speed for video transcoding (ideally hardware accelerated) and simple AI
- fast storage – SSD hard drive for fast and reliable storage
- power consumption – less than 15 W on average, as this will run 24/7
- connectivity – 1000 MBit ethernet, WIFI is not recommended for the HA server, USB 3 for optional external devices such as Zigbee dongles etc
- size – smallish, not super important but I don’t want a server rack yet…
Being from Germany, eBay Kleinanzeigen was the way to go and after a short search I purchased a “Fujitsu ESPRIMO Q910”.
1. Getting started with Debian
2. Setting up Docker and Docker compose
First, install Docker, or to be precise the Docker Engine. I followed these instructions.
sudo apt-get update sudo apt-get install \ ca-certificates \ curl \ gnupg \ lsb-release curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
3. Maintaining our Docker
4. Setting up Home Assistant
4. Setting up Grafana for use with InfluxDB / FLUX
Configuration > Data sources
Add data source > InfluxDB
Query Language: Flux (in beta but work splendid for me)
HTTP > URL: http://[your_IP_here]:8086, eg. http://192.168.178.3:8086, localhost did not work for me
Basic Auth Details > User and Password as defined in the docker-compose.yaml and the corresponding .env file
InfluxDB Details: Organization, Token and Default Bucket have all been define in the previous step when we setup our InfluxDB database.