Integrating Home Assistant into your QNAP X86 System NAS
Home Assistant is an open-source home automation platform running on Python 3 and Raspberry Pi. It is very easy and beneficial to combine QNAP X86 System NAS and Home Assistant.
Notes : This tutorial only support on X86 system NAS, If you want to use it on ARM system, You should build docker image yourself, or search Home Assistant for ARM version on docker hub.
Home Assistant can be easily installed on QNAP X86 System NAS by using Container Station app. For more information regarding Container Station, please check https://www.qnap.com/solution/container_station/en/index.php
Follow these steps to install Home Assistant:
- If you have not already installed Container Station on your NAS, you can find it in the NAS App Center.
- Open Container Station and go to “Create Container”. Search for ” homeassistant/home-assistant” with docker hub, and click ” Install “.
- In Version, choose ” latest” and click ” Next”.
- Enter a name for the container (for example: ” homeassistant” )
- Click “Advanced Settings”. Go to ” Environment ” and click add twice :
- In ” Name “, enter ” variable ” ; in ” Value ” enter “ tz “
- In ” Name “, enter ” value ” ; in ” Value ” enter “ Europe/London”
Other timezone values can be found at https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
- Go to “Network” :
- In “ Network Mode “, choose ” Host “
- Go to “Shared Folders” :
- In ” Volume from host “, click ” Add ” and choose an existing folder or add a new folder (for example: HomeA)
- In “ mount point “, enter “/config “. Home Assistant will use this folder for configurations information and logs
- Click ” Create ” and wait for the NAS to finish creating the container
- After container has been created, open a new web browser window and go to http://<NAS IP>: 8123 ” (for example: ” http://192.xx.xx.xx : 8123″. Your Home Assistant will be displayed.
Remark: to update your Home Assistant on your Docker within Qnap NAS, you just remove container and image and do steps again(Don’t remove “config” folder)
If you want to use a USB Bluetooth adapter or Z-Wave USB Stick with Home Assistant on Qnap Docker, Fallow this step:
Z-wave:
- Connect to your NAS over SSH
- Load cdc-acm kernel module(when nas restart need to run this command)
1insmod /usr/local/modules/cdc-acm.ko - Find USB devices attached. Type command:
1ls /dev/tty*
The above command should show you any USB devices plugged into your NAS. If you have more than one, you may get multiple items returned. Like :ttyACM0
- Run Docker command:
1docker run --name home-assistant --net=host --privileged -itd -v /share/CACHEDEV1_DATA/Public/homeassistant/config:/config -e variable=TZ -e value=Europe/London --device /dev/ttyACM0 homeassistant/home-assistant
-v
is your config path
-e
is set timezone - Edit configuration.yaml
12zwave:usb_path: /dev/ttyACM0
That will tell Home Assistant where to look for our Z-wave radio.
Bluetooth:
- Connect to your NAS over SSH
- Run Docker command:
1docker run --name home-assistant --net=host --privileged -itd -v /share/CACHEDEV1_DATA/Public/homeassistant/config:/config -e variable=TZ -e value=Europe/London -v /dev/bus/usb:/dev/bus/usb -v /var/run/dbus:/var/run/dbus homeassistant/home-assistant
First-v
is your config path
-e
is set timezone - Edit configuration.yaml
12device_tracker:- platform: bluetooth_tracker
This tutorial only support on X86 system NAS, If you want to use it on ARM system, You should build docker image yourself, or search Home Assistant for ARM version on docker hub.
Thank you very much for this! Maybe QNAP can come up with a better method of USB support then having to manually set it each time?
Hello have you been able to also map and use the audio jack of the QNAP NAS to output sound from Hass.io ? like us it as a media_player out ?
Excellent. A well written and informative description.
Could you please tell me where I could find a good source of information for beginners on the principles of how Home Assistant operates when inside a Docker container on QNAP (compared to say installed on a Raspberry Pi or another Linux server?
In particular, what I have been struggling to understand is how and where on my QNAP I need to be logged in via SSH to run shell commands and scripts with Home Assistant, such as simple routine maintenance tasks like verifying/checking the configuration.yaml file and restarting home assistant, as clearly it works very differently when installed in a Docker container.
Also, the ordinary route to update Home Assistant is via a shell command but (as you mentioned in your article) I have had to stop and remove the current container version and install the new version from scratch. Can you please help me to understand why this is?
Thanks for your help.
Hi I need same help, after ls /dev/tty* I can not see nothing like “ttyACM0” I saw /dev/tty to /dev/tty59
[~] # insmod /usr/local/modules/cdc-acm.ko
[~] # ls /dev/tty*
/dev/tty /dev/tty12 /dev/tty17 /dev/tty21 /dev/tty26 /dev/tty30 /dev/tty35 /dev/tty4 /dev/tty44 /dev/tty49 /dev/tty53 /dev/tty58 /dev/tty62 /dev/ttyS0
/dev/tty0 /dev/tty13 /dev/tty18 /dev/tty22 /dev/tty27 /dev/tty31 /dev/tty36 /dev/tty40 /dev/tty45 /dev/tty5 /dev/tty54 /dev/tty59 /dev/tty63 /dev/ttyS1
/dev/tty1 /dev/tty14 /dev/tty19 /dev/tty23 /dev/tty28 /dev/tty32 /dev/tty37 /dev/tty41 /dev/tty46 /dev/tty50 /dev/tty55 /dev/tty6 /dev/tty7 /dev/ttyS2
/dev/tty10 /dev/tty15 /dev/tty2 /dev/tty24 /dev/tty29 /dev/tty33 /dev/tty38 /dev/tty42 /dev/tty47 /dev/tty51 /dev/tty56 /dev/tty60 /dev/tty8 /dev/ttyS3
/dev/tty11 /dev/tty16 /dev/tty20 /dev/tty25 /dev/tty3 /dev/tty34 /dev/tty39 /dev/tty43 /dev/tty48 /dev/tty52 /dev/tty57 /dev/tty61 /dev/tty9
[~] # lsusb
Bus 001 Device 004: ID 10c4:8a2a Cygnal Integrated Products, Inc.
Bus 001 Device 003: ID 1005:b155 Apacer Technology, Inc.
Bus 001 Device 002: ID 1c05:2074
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 002: ID 1c05:3074
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Hi EMERSON VIER:
We use this Z-wave device to test :”Aeotec Z-Stick Gen5″. Maybe your z-wave dongle not support “cdc-acm” driver. So you can’t saw “ttyACM0”.
Could you please advise how to setup SSL certificates?
Hi Will Carter :
You can refer this page to setting SSL certificate from home-assistant official website :
https://www.home-assistant.io/docs/ecosystem/certificates/tls_self_signed_certificate/
https://www.home-assistant.io/docs/ecosystem/certificates/tls_domain_certificate/
If you want to key command in home-assistant container, can go to home-assistant container info page, click “Terminal”, key in “bash”, it will open terminal on your browser.
If you want to edit config, the config file will in you set “Volume from host” path.
I used https://hub.docker.com/r/linuxserver/letsencrypt/ to generate my certs – pretty slick!
Quickfix: Zigbee/Z-Wave USB on QNAP https://www.sysrun.io/2017/10/20/quickfix-zigbeez-wave-usb-on-qnap/
Can you enable Hassio on docker running home assistant version 0.84.5.
Hi Ramana Kumar Pisupati Sai,
You can try to follow this tutorial to install HASS.IO with LXC container:
https://qiot.qnap.com/blog/2019/01/15/install-hass-io-qnap-nas/
Thank you.
I found something they call “docker-compose”, which should make life eaisier when you have multiple installations in Docker.
But this docker-compose seems to be a separate module, instead of Docker.
Has somebody tried to run this in Qnap?
What was/is the experience ??
FYI [How To] integrate a Tasmota device in Home Assistant using MQTT https://forum.qnap.com/viewtopic.php?f=364&t=150607