Docker based Home Assistant and CCU on Raspbian

Michael Dipper 03.05.2020

While setting up my smarthome solution the intention was to run all components on a single Raspberry Pi 3B+. Various componente had to be integrated:

Hardware

  • Raspberry PI 3B+
  • ELV “Charly” Case with RPI-RF-MOD
  • External antenna
  • SML Smart Meter adapter
  • Various (wireless) Homematic IP sensors and actors

Software

  • Home Assistant Supervised
  • Homematic CCU3

To get a flexible and modularized system I decided to have all components in docker containers. Therefore solutions like Raspberymatic are no option since they use a different container/virtualization technique.

The following script describes how to setup the environment.

Prepare

  • Flash Debian Buster Lite to SDcard
  • Enable “ssh” on SDcard
  • Boot Raspi and SSH to the system
  • Start raspi-config and set timezone and WiFi zone

Initial system update

apt update
apt upgrade

Adjust hostname in the following files:

/etc/hosts
/etc/hostname  
reboot

Install Home Assistant

These steps are taken from the official Home Assistant documentation:

apt-get install -y software-properties-common apparmor-utils apt-transport-https avahi-daemon ca-certificates curl dbus jq network-manager socat
systemctl disable ModemManager
systemctl stop ModemManager
curl -fsSL https://get.docker.com | sh
curl -sL "https://raw.githubusercontent.com/home-assistant/supervised-installer/master/installer.sh" | bash -s -- -m raspberrypi3

Wait for 10-20 minutes …

Tip: The deploy.sh script will try to install the pivccu packages for you. If it does not work please follow the instructions to install pivccu-modules-dkms, pivccu-devicetree-armbian (if you are on Armbian) and pivccu-modules-raspberrypi (if you use a Raspberry with Raspbian).

Install CCU

Furtunately there is a docker image for CCU available:

cd ~
apt-get install git  
git clone https://github.com/angelnu/docker-ccu
cd docker-ccu
./deploy.sh

Verify

Check if all containers are up and running:

root@charly:/home/pi# docker ps
CONTAINER ID        IMAGE                                              COMMAND                  CREATED             STATUS              
PORTS                                                                                                              NAMES
a143659d70f3        angelnu/ccu:3                                      "/entrypoint.sh"         3 hours ago         Up 3 hours          0.0.0.0:80->80/tcp, 0.0.0.0:2001->2001/tcp, 0.0.0.0:2010->2010/tcp, 0.0.0.0:8181->8181/tcp, 0.0.0.0:2222->22/tcp   ccu
e8dadfe4acb6        homeassistant/armv7-addon-configurator:5.0.0       "/init"                  3 hours ago         Up 3 hours                                                                                                                             addon_core_configurator
90bec76d90c5        homeassistant/armv7-addon-mosquitto:5.1            "/run.sh"                3 hours ago         Up 3 hours          0.0.0.0:1883-1884->1883-1884/tcp, 0.0.0.0:8883-8884->8883-8884/tcp                                                 addon_core_mosquitto
35c1a817bbe8        homeassistant/armv7-hassio-audio:14                "/init"                  3 hours ago         Up 3 hours                                                                                                                             hassio_audio
b5aad12045c6        homeassistant/armv7-hassio-cli:25                  "/init /bin/bash -c …"   3 hours ago         Up 3 hours                                                                                                                             hassio_cli
8b5de93f7ca1        homeassistant/armv7-hassio-multicast:2             "/init"                  3 hours ago         Up 3 hours                                                                                                                             hassio_multicast
43504a759b8b        homeassistant/armv7-hassio-dns:9                   "/init coredns -conf…"   3 hours ago         Up 3 hours                                                                                                                             hassio_dns
158c6d910913        homeassistant/raspberrypi3-homeassistant:0.109.3   "/init"                  4 hours ago         Up 11 minutes                                                                                                                          homeassistant
b1a44d2dc5c6        homeassistant/armv7-hassio-supervisor              "/init"                  5 hours ago         Up 3 hours                                                                                                                             hassio_supervisor

Connect to the systems: