HA, MQTT, Let's Encrypt, and Unifi Controller Docker containers on a Raspberry Pi

Hi all,

I’m new here, but previously had a Home Assistant setup running properly when the recommended method was a Python venv (so, last week—things seem to be changing at light speed here, which is awesome). My Pi setup got corrupted a couple of months ago, and I had to start over, but now, with everything recommended to run in a docker container, I’m a bit lost as to what the least insecure setup would be.

I’m perfectly comfortable on the Linux command line, and am moderately familiar with Python, but am just coming up to speed on Docker, and I feel I may have several complicating factors. The things I want to configure are as follows:

  • Home Assistant
    • With a connection to Alexa
    • And Google Home
    • With a custom component that requires access to the command line and a serial port (X10 controlled through heyu and a CM11A - the built-in X10 component doesn’t work properly, so I modified it)
    • As well as a switch that runs commands on the command line that need access to another serial port (to control a Panasonic Projector via RS232)
    • On my own domain (DNS hosted by Namecheap)
    • On a dynamic IP address
    • Preferably with a frontend exposed to the Internet (unless this is REALLY frowned upon)
  • MQTT
    • For Owntracks
    • And potentially other stuff
  • Let’s Encrypt
    • Because everything should be SSL
  • Unifi Controller

I previously had EVERYTHING listed working on the venv setup, aside from the Unifi Controller (the Ubiquiti gear is very new), and still have all the config files and components. What’s confusing me at this point is how all this works with Docker, how the various Docker containers would work together, and how to use things like heyu and the python scripts I wrote to control the projector, which don’t have Docker containers.

The Unifi Controller is working fine, and can update the DNS entries at Namecheap. I don’t think that needs any work. I have Home Assistant running, and can access it internally via HTTP (or externally if I were to forward the port). I have certbot running natively getting certificates. I can control the X10 devices and the projector via the command line. The place I need help is getting everything configured properly with Home Assistant.

Does anyone have any recommendations on where to start? Links to guides and the like would be greatly appreciated.

TL;DR My wife misses our smart home that stopped working months ago, and everything is moving so quickly with Home Assistant that I can’t keep up.

Watch the unifi on the raspberry pi with all that other stuff. It may crash. I had it on a pi and it would give up. Later I moved it to an odroid c2 (bit more power and memory). It also crashed.

But I found a memory limit setting for the mongo db. Perhaps if I found that sooner it could have run on the pi. But it can be hungry for memory.

Hassio and Unifi installed in Docker containers on a mini PC running Ubuntu Server LTS. Lets Encrypt and Mosquitto installed as Hassio addons. All as per the alternative installation instructions.

Cheap mini pcs

Thanks for the heads up, psyciknz, I’ll keep an eye on that.

Thanks, Tom. Is there a reason you’d recommend I run this on a mini PC rather than a Raspberry Pi?

Also, does Hassio have support for Alexa?

Finally, how do I handle the custom components that run command line applications?

Unifi. No personal experience but took note of @psyciknz’s advice above.

Yes it does. Though I don’t use it so am not much help in telling you how. Check the docs. Amazon Alexa - Home Assistant

Mostly the same as for non Hassio installs, though you might find some permission issues and lack of installed esoteric commands. In this case skip Hassio, keep everything else the same except install Mosquitto manually in it’s own docker container and use the non Hassio install on the same server. Not an expert at this (I use Hassio) but just stuff I’ve read here.

Thanks, Tom. I’m going to give it a shot on the RPi first, but I’ll watch out for resource usage. This should get me going. My wife is excited for the house to be smart again.