How to test smart home software using Docker

You don’t know what home automation software choose to create your installation, Docker is a good way to test easily and quickly without having to configure a machine every time. We’ll see how to test Jeedom, Domoticz, openHAB and Home Assistant. In this article, we will use Kitematic (included in the Docker Toolbox) which adds an interface graphic Docker for Windows or MAC OS X  macOS.

For those who do not yet know Docker

We will not make a detailed presentation of Docker in this article, there are already a lot of articles that deal with the subject on the internet very well. Here are a few (in French):

You can also start by watching this video of Grafikart which shows how use Docker on Windows.

Docker offers many advantages over traditional Virtualization:

  • Less resources. Docker uses the resources of the host (Linux) machine or start a light Linux (on PC and Mac).
  • Very flexible containers management. You can start, stop a container very quickly (a few seconds)
  • Very simple design of the machines. A simple text file is sufficient to describe the machine to build.
  • You can tie the containers between them.

And it’s just a start. Let’s see how Docker can now help us test simply several software home without having to monopolize a machine.

Material:

Docker works on many platforms (if not all). Linux naturally but now Windows and macOS. In this case Docker starts in a small virtual machine that runs a very lightweight Linux system. Docker works also on NAS and Raspberry PI.

To test Docker using the Toolbox (which contains Kitematic), you will need a PC to less than 8 years equipped with 10 64 bit Windows. The Toolbox works on Pro, Enterprise or Education versions.

If you have a Mac, it must meet the following criteria Docker to function:

  • Model dating from 2010 to a minimum in order to have the game instruction MMU (Memory Management Unit) of Intel processors.
  • macOS 10.10.3 Yosemite or more recent
  • At least 4GB of RAM.

For this article, I used a Mac Mini 2012 (really old !) equipped with a processor intel i7 and 8 GB of RAM.

Software: Kitematic, a GUI for Docker

As we are not all bearded, I therefore propose to use Kitematic which adds a GUI to Docker. Download and install the Docker Toolbox that contains Kitematic depending on your environment (Mac or Windows). Kitematic is only available in English but is very easy to use.

docker kitematic

Test Jeedom with Docker

To test Jeedom, we will have to install two containers. I know not the reason (probably due to lack of time), but he must first have a functional mysql database. Let’s install it.

Installation of the mysql database

Click on + NEW and enter mysql in the search field or click Recommended . Complete the creation by choosing the official image.

docker-kinematic-recherche-mysql

If you start the mysql machine, you will get the following error message. It’s normal, we must define at least one password to mysql. docker-kinematic mysql erreur demarrage mysql_root_password

Before you start the image, go to the Settings-> General tab. Go to end of the list of environment variables (see Environment Variables) and then add a key MYSQL_ROOT_PASSWORD . In the field Value , specify the password for the database. We will need to configure Jeedom and why not go see what is happening in the database later. Don’t forget to save the configuration by pressing Save .

docker kinematic mysql root password

You can now start mysql. At first launch, mysql will complete the installation and configuration of the environment. On the first page of the machine (Home), you find its ip address will be required for Jeedom. In my case it is 192.168.99.100. 3306 MySQL port is moved on the 32795 port. The port is assigned randomly at first launch, but you can set you even.

docker kinematic mysql ip machine

it is over for mysql, go to Jeedom.

Install Jeedom

By doing a search on the word Jeedom, you can find several images. Official image is published by the Jeedom team. As you can see, there are images with a prefix of rpi. They are intended to work with the version Raspberry of Docker.

docker jeedom image officielle

Create a container from the development team maintained not image. At first startup, Jeedom finishes the installation and retrieves the latest packages. Be patient, it is a bit long for the first time. When you see appear the Jeedom interface in the Web Preview tab, click the icon to open the browser by access Jeedom.

docker kinematic accéder jeedom

It starts badly! We have some work to do with the version 2.3 of this image.

docker jeedom erreur premier lancement

Turn on Kitematic and open the Terminal by clicking on the button Exec .

docker kinematic terminal

Run this first command

sudo su - 
echo "root ALL=(ALL) NOPASSWD: ALL" | (EDITOR="tee -a" visudo)

Then the one above

sudo su -
croncmd="su --shell=/bin/bash - root -c '/usr/bin/php /var/www/html/core/php/jeeCron.php' >> /dev/null 2>&1"
cronjob="* * * * * $croncmd"
( crontab -l | grep -v "$croncmd" ; echo "$cronjob" ) | crontab -

To refresh the page. If all went well, there is error, and you should arrive on the page to set up the connection to the mysql database. If the errors are always present, try to restart the machine from Kitematic.

Fill in the fields according to your configuration:

  • Database hostname : replace localhost with the ip address of the mysql machine previously created
  • Database port: the port assigned by Docker or one chosen. In my case, it will be 32795.
  • Database username : let root
  • Database password : the one you chose for the key MYSQL_ROOT_PASSWORD
  • Database name : jeedom

Click Proceed to complete.

docker jeedom configuration mysql

Jeedom finishes its installation.

docker jeedom fin configuration

Follow the link Click here to access the login page of Jeedom. By default, a user admin with the admin password has been created.

docker kinematic jeedom login

And now you are ready to test Jeedom very easily. Small flat, however, the installation script that is executed every time you start is long enough.

Click on + NEW and enter domoticz in the search field. At the time of the writing of this article, the (installed) sdesbure image shows an error of installation (on Mac OS, at least). So I opted for with cyrilix. The installation can be quite long (all depends on your internet connection), since the image weighs 540Mo.

docker kinematic image domoticz

Once the image has been recovered, start the pressing Start and then open the browser as for Jeedom.

docker kinematic domoticz start

It’s over already!

Attention. Domoticz does not support the movement of the data files on the host machine.

Test OpenHAB with Docker

Install the official image of OpenHAB. docker openhab image officielle

Open the browser from Kitematic and add ?sitemap=demo at the end of the url and then refresh the page. The OpenHAB demo is installed in the Docker image.

openhab demo docker kinematic

openHAB2

It is so simple to install an application with Docker u’ it would be a shame not to take advantage to test version 2 of OpenHAB which is under development.

Images are quite numerous. By myself, I tried the image of wetware (434 MB). Once started, go to the interface of OpenHAB2 as usual since Kitematic. You can test the demo interface in classic mode (Classic UI) or in the new mode (Paper UI).

openhab2 docker

This new version brings a more current interface and the ability to configure OpenHAB directly from the browser. For now, do not expect to use version 2 on a daily basis, yet he has too little hardware and services supported:

openhab2 docker paper ui

Test Home Assistant with Docker

Finally, the latest software that I propose to install and test is Home Assistant.

home assistant docker

Once installed and started, the best is to move the directory on the host machine. To do this, click on the the path of the volume (/config) and confirm. The machine restarts and HA recreated a new configuration.

Warning. This solution run on macOS. On Windows, you need to start as administrator (but not run really well).

home assistant chemin repertoire local docker

Before you can test Home Assistant, we still need to configure a port forward (which is not made in the dockerfile). Go to the Settings of the container to the Ports tab. In the Docker Port field, enter 8123 and 8123 (or another) in the field MAC incase . Click on the + then Save .

home-assistant-configuration-port-docker

Now in a browser enter the following address

 http://IP_DE_VOTRE_PI:8123/states

home-assistant-interface-docker

You can test Home Assistant!

You just have to play with the file configuration.yaml using a simple text editor on your Mac or PC. The updates are not taken into account in real time, simply restart the container to take them into account.

Subscribe to the weekly newsletter

No spam and no other use will be made of your email. You can unsubscribe anytime.

Tags:

DIY Projects