Setup HomeAssistant with Z-Wave on QNAP Container using Docker

Undefined Programming

Setup HomeAssistant with Z-Wave on QNAP Container using Docker

Lets begin by making the initial Home Assistant installation, find it on QNAP Container Station. Look for homeassistant/home-assistant.

Add a new “TZ” environment to set your TimeZone, check out the List of tz database time zones

Set a static volume for the container to use, I just use QNAP “New Volume” directory. You can make your own volume using “Volume from host”, though I find permissions being a problem on some docker.

Remember to expose the container 8123 port to any host port, can set it as 8123 if you wish.

You should have the basic installation ready at [I.P Address]:[Port].

Enabling Z-Wave USB Adaptor on QNAP
Plug in your Z-Wave USB to your QNAP, I’ve got the AEON AEOEZW090-C Aeotec Z-Stick Gen5.

Telnet or SSH into your QNAP, check out what’s USB is currently available to the system

ls /dev/tty*

Install the cdc-acm kernel module

insmod /usr/local/modules/cdc-acm.ko

Check list again, you will find the “/dev/ttyACM0”

ls /dev/tty*

Let’s recreate the home-assistant docker using the newly found device, QNAP does not allow to connect a device to the docker with the GUI you have to do this by command line. First we need the directory of the config folder, by going into Settings > Advanced Settings > Shared Folder.

Stop the home-assistant-1 docker, run this command to re-create the docker.

docker run --name [NAME] --net=bridge --privileged -itd -v [CONFIG_DIRECTORY]:/config -e TZ=[TIMEZONE] --device [USB] homeassistant/home-assistant

For this example use this command

docker run --name home-assistant --net=bridge --privileged -itd -v /share/CE_CACHEDEV1_DATA/Container/container-station-data/lib/docker/volumes/homeassistant-config/_data:/config -e TZ=Europe/London --device /dev/ttyACM0 homeassistant/home-assistant

You should have your Z-Wave USB available within your docker.

To double check if the USB is available you can access the docker

docker exec -it [DOCKER_ID] bash

Check the list if ‘/dev/ttyACM0’ is available

ls /dev/tty*

Please note that the installed module setting is lost upon restarting or shutdown, to enable it just run this command. The docker should continue to use the same USB “/dev/ttyACM0” without making the docker again.

insmod /usr/local/modules/cdc-acm.ko

Leave a Reply

Your email address will not be published. Required fields are marked *