I've setup everything in my home to talk to everything else, which is no small feat when nobody has fully open APIs. I have my media center, lights, music, switches, and more controlled with Home Assistant. Sonarr and Radarr download and organize movies & TV shows that Plex then streams to any device. I can press one button on my universal remote to dim the lights and turn on my TV and soundbar to the right input to start a movie, which is all I really wanted all along. This is what it takes to make that happen.
Most guides for Home Assistant assume you're using a generic Linux box or a Raspberry Pi. While many things are the same between Synology's Linux and Debian-based distros like Ubuntu and Raspbian, there's some differences when using a Synology device.
While you will need to use the command line to setup Home Assistant in docker, I still use the docker package that's available to easily manage my six other docker installs, which do not need the command line options to start. The Docker package doesn't support the
device argument, which is used to allow the docker container to read the Zigbee/Z-Wave USB stick. It's easy to do, just follow this guide to install the .spk.
You'll also need to enable SSH under
Control Panel > Terminal and SNMP
Installing home assistant requires a few steps with Docker and your NAS.
The Z-Wave/Zigbee USB stick requires some third-party drivers to function properly. Find the right version here. It will require a reboot once it's installed.
todo: fill in link
Docker "containers" are tiny operating systems built to run a specific program or set of programs. They're nice to use because they're easy to update and configure.
When Docker is upgraded, all data in the container is lost. To make sure you don't lost any data, make a folder in a Synology library. You'll tell the Home Assistant container to store configuration files in this folder. This will also make them much easier to edit.
todo: fill in screenshots
You can edit your files with the Synology text editor, or mount your file share on a PC and use your favorite text editing program. Another option is to use HASS Configurator, a web-based text editor than can load your config files. It also provides helpful links and verification that your files are formatted correctly.
To verify you've installed Home Assistant correctly, go to
http://your_Synology_IP:8123 and ensure you can see the Home Assistant welcome screen.
Now that Home Assistant is installed and running, we can work on configuring services for it to use.
I use the following services or devices:
I'll go through each and describe what I use it for and my configuration.
Adding your Zigbee devices takes some special command-line wizardry. First, SSH into your Synology devices. Run
cat /dev/tty*You should see
/dev/ttyUSB1. This mounts the USB devices inside the docker container. The below command assumes you downloaded the container names
home-assistant. I keep my config files in the Synology folder
/volume1/Vault/configs/ha/config. Make sure you keep the
:/config - this maps the Synology directory to a mounted directory in the container. Then, run the command below:
sudo docker run --name home-assistant --restart=always --net=host -itd -v /volume1/Vault/configs/ha/config:/config --device /dev/ttyUSB0 --device /dev/ttyUSB1 homeassistant/home-assistant
This should create the docker container with everything it needs to run Home Assistant with Zigbee and Z-Wave devices.
Zigbee should be
/tty/USB1. To add it to Home Assistant, active the Zigbee component in your config. You'll need to specify a complete path to store the zigbee.db file - it will be automatically created but the directory it's in must exist.
zha: usb_path: /dev/ttyUSB1 database_path: /config/zigbee.db
After doing this and possibly a reboot of Home Assistant, you should see the
zha.remove under the "Services" todo: add icon menu. Put your lights into pairing mode, and then click
call service. They should flash to confirm the pairing.
You'll want to set up your Harmony Hub & Remote with all your devices and activities first.
After making sure everything works the way you like with the app, you can never wait for it to load again - it's easier and much faster to trigger Activities with Home Assistant.
As of 1/3/2019, you'll need to enable Developer Mode on the Hub to use it with Home Assistant