How To: Install Amazon Echo HA Bridge using Synology NAS

I wanted to write this up for people that want to use an Amazon echo to control Vera using bwssystems Home Automation Bridge and a Synology NAS using Docker instead of weeding through hundreds of pages of forum posts. This is pretty straight forward but you must complete each step.

First, a few notes:

At time of writing I am using Synology DSM 6.0.2.

You can find notes and additional information on bwssystems Home Automation bridge here: GitHub - bwssytems/ha-bridge: Home automation bridge that emulates a Philips Hue light system and can control other systems such as a Vera, Harmony Hub, Nest, MiLight bulbs or any other system that has an http/https/tcp/udp interface. This is a compact impl to run on small format computers. This is impl started from this project https://github.com/armzilla/amazon-echo-ha-bridge. and current releases in .jar here: Releases · bwssytems/ha-bridge · GitHub. Currently 3.1.0 is available.

The container is put together by aptalca. See GitHub - aptalca/docker-ha-bridge: Docker container for Home Automation Bridge

I have not been successful using the Docker GUI to install properly. This post will demonstrate how to install it using SSH. You will need a basic understanding of the Synology DSM to get this to work. Thanks to bwssystems and aptalca for making this possible.

Step one:

Use the Synology File Manager and create a folder to store the home automation bridge’s configuration file in. This can be any name and any location. You will need to know the path to this location and it does need to be a shared folder. I would suggest allowing all groups to have full access rights to it at least until you get the bridge setup. I called mine “vera-habridge” but it could be “ha-bridge” or whatever you like.

Step two:

Install Docker in the Package Center on your Synology NAS. You do not need to configure anything in it. Just install it.

Step three:

Make sure you have SSH turned on. You will find this under Control Panel >> Terminal & SNMP >> Enable SSH service. You can turn this off after installation is complete if you do not want to keep the service running.

Step four:

Download and install a SSH client. Putty is easy to use and free. Google putty and download and install it.

Step five:

Run putty and SSH into your Synology NAS. You should be familiar with the IP address and by default the port is 22. When you SSH in it will ask you for a name and password. Use admin as your login and your admin password.

You can go to the root directory using
“cd /” and you will want to find the folder you created in step one. You can google basic unix commands to navigate around if you don?t know how to. VERY IMPORTANT: Your shared folders are not in the root folder but generally under a volume. i.e. /volume1/vera-habridge. You must know the entire path from root to make this work correctly and it can and will (I found out the hard way) lock up your NAS if you use an incorrect path.

Step six:

Return to the root directory and type the following in replacing the parameters as necessary:

sudo docker run -d --name="Home-Automation-Bridge" --net="host" -e SERVERIP="192.168.X.X" -e SERVERPORT="8080" -v /volume1/vera-habridge/:/config:rw -v /etc/localtime:/etc/localtime:ro aptalca/home-automation-bridge

IMPORTANT:

Replace the “192.168.X.X” with your Synology NAS IP address. i.e. SERVERIP=“192.168.1.100”

Replace the “8080” with your port number (8080 is usually fine). i.e. SERVERPORT=“8080”

Replace the /volume1/vera-habridge/ with the path and folder you created in step one. i.e. /volume1/habridge/. Leave in the :/config:rw part.

You will be asked for your password to proceed.

Step seven:

Docker should run, download the latest version of the home automation bridge, and install it. You will see it work through the package and download the necessary files. This can take a little while.

Step eight:

After the download completes and you are returned to a prompt, verify the install by opening the docker package on the Synology DSM and under the “Container” section you should see Home-Automation-Bridge. It should already be running.

Step nine:

Test the installation by using your browser to go to the IP and port you used in step six. i.e. http://192.168.1.100:8080. If it is working the setup screen will appear. Follow the links at the beginning of the post to work through the rest of the setup.

Please let me know if I left anything out or if there are any errors. Thank you.

Quick question:

I seemed to have this same issue when originally setting up the HomeBridge for iOS HomeKit but I have not found a way to install Docker on my Synology DiskStation. For some reason, DiskStation is not available on certain Synology devices. Do you know if this Amazon Echo HA Bridge can be run directly on the Synology or using Debian Chroot instead of Docker?

I also assume I can have BOTH the iOS HomeKit Bridge and the Amazon Echo Bridge running on the same server?

Thanks!

Ironbar… thank you for the tutorial!

Do you know of a way to get HA-Bridge to run on port 80? HA-Bridge must be running on port 80 to work with Google Home.

Maybe the Container can be exposed to the network as a dedicated IP on the same subnet as the Syno NAS?

thx!

I had this working fine but last night DSM updated to version 6.0.2-8451 Update 9 and also Docket package was updated to 1.11.2-0270 and although the container is running I cannot access the web interface. The Details view shows the serverIP and port twice under Environment, but nothing under port settings on the other side of the page.

There is just one error in the log file

Error 2017/01/19 04:19:16 admin Start container Home-Automation-Bridge failed: rpc error: code = 2 desc = “oci runtime error: container with id exists: 3b62afc6b66fe06f47af4efa12672e16769685171292db2b95c6b4e3e9134024”

possibly when it was updating. Any ideas how to fix?

edit: Ok Fixed it, stopped Container, deleted container. ssh to diskstation and deleted just the files in vera-habridge and re ran the installation. was very fast and was running ok after.

[quote=“Aaron, post:3, topic:193728”]Ironbar… thank you for the tutorial!

Do you know of a way to get HA-Bridge to run on port 80? HA-Bridge must be running on port 80 to work with Google Home.

Maybe the Container can be exposed to the network as a dedicated IP on the same subnet as the Syno NAS?

thx![/quote]

That was my original thought. Until I found this thread: https://github.com/bwssytems/ha-bridge/issues/349

Now I’m happy to report that for me, everything is working as intended (i.e. the ha-bridge runs within the container at port 8810 for me, but visiting http://localhost/api/ proxies all requests to the ha-bridge container/port).

[quote=“facreby, post:5, topic:193728”][quote=“Aaron, post:3, topic:193728”]Ironbar… thank you for the tutorial!

Do you know of a way to get HA-Bridge to run on port 80? HA-Bridge must be running on port 80 to work with Google Home.

Maybe the Container can be exposed to the network as a dedicated IP on the same subnet as the Syno NAS?

thx![/quote]

That was my original thought. Until I found this thread: https://github.com/bwssytems/ha-bridge/issues/349

Now I’m happy to report that for me, everything is working as intended (i.e. the ha-bridge runs within the container at port 8810 for me, but visiting http://localhost/api/ proxies all requests to the ha-bridge container/port).[/quote]

Hello, could you please tell how you exactly did this? cause i cannot get this to work on my Synology (I’ve got habridge running on port 8880, but cannot get nginx to use the /api forward). What exactly did you do pls? :slight_smile:

Great tutorial. I deviated somewhat and have run into an issue on install. Since I have an older synology DS210j running DSM5.2, I first installed headless Java 8 SE embedded. Then I put amazon-echo-bridge-0.4.0.jar into /volume1/@appstore/Amazon_HA_Bridge. As root in SSH, I then ran the following:
nohup java -jar /volume1/@appstore/Amazon_HA_Bridge/amazon-bridge.jar --upnp.config.address=192.168.1.XXX --server.port=80XX

At that point I got the following in my putty SSH terminal:
nohup: appending output to nohup.out
and then the terminal just hangs. And of course I don’t get the configuration screen at 192.168.1.XXX:80XX, I just get a whitelabel error page. Port is open. Any suggestions?

To answer my own question… I was using the HA bridge from the older branch. So once I switched over to bwssystems branch, all seems to be in order. On my synology, I use:

nohup java -jar -Djava.net.preferIPv4Stack=true -Dserver.ip=192.168.1.XXX -Dserver.port=80XX /volume1/@appstore/Amazon_HA_Bridge/ha-bridge-4.5.6.jar > /volume1/@appstore/Amazon_HA_Bridge/habridge-log.txt 2>&1 &

Ok, I installed this on DS216 II with DSM 6.1.7-15284, but the Docker container quits as soon as it starts. I get an error message “Docker container: Home-Automation-Bridge stopped unexpectedly.” The log reads as follows:

*** Killing all processes…
stderr
02:39:19
Traceback (most recent call last):
stderr
02:39:19
File “/sbin/my_init”, line 346, in
stderr
02:39:19
main(args)
stderr
02:39:19
File “/sbin/my_init”, line 265, in main
stderr
02:39:19
export_envvars()
stderr
02:39:19
File “/sbin/my_init”, line 88, in export_envvars
stderr
02:39:19
f.write(value)
stderr
02:39:19
UnicodeEncodeError: ‘ascii’ codec can’t encode characters in position 0-2: ordinal not in range(128)
stderr
02:40:05

Any ideas what I am doing wrong?

ASGGOLD - What diskstation do you have? Docker wasn’t listed as an available package for my DS418Play but it can be side loaded and works great. I’ll look and see if I can find the list and how to post again…