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.
Telnet or SSH into your QNAP, check out what’s USB is currently available to the system
Install the cdc-acm kernel module
Check list again, you will find the “/dev/ttyACM0”
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
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.