Author Topic: How To: Install Amazon Echo HA Bridge using Synology NAS  (Read 15435 times)

Offline Ironbar

  • Sr. Newbie
  • *
  • Posts: 29
  • Karma: +8/-6
How To: Install Amazon Echo HA Bridge using Synology NAS
« on: September 16, 2016, 01:26:33 am »
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: https://github.com/bwssytems/ha-bridge and current releases in .jar here: https://github.com/bwssytems/ha-bridge/releases.  Currently 3.1.0 is available.

The container is put together by aptalca.  See https://github.com/aptalca/docker-ha-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:
Code: [Select]
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.

<see attached>

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.
« Last Edit: September 16, 2016, 01:31:43 am by Ironbar »

Offline asggold

  • Jr. Member
  • **
  • Posts: 67
  • Karma: +0/-0
Re: How To: Install Amazon Echo HA Bridge using Synology NAS
« Reply #1 on: November 26, 2016, 02:40:56 pm »
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!

Offline Aaron

  • Hero Member
  • *****
  • Posts: 1984
  • Karma: +61/-193
Re: How To: Install Amazon Echo HA Bridge using Synology NAS
« Reply #2 on: December 18, 2016, 11:12:01 pm »
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!

Offline stephenmhall

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
Re: How To: Install Amazon Echo HA Bridge using Synology NAS
« Reply #3 on: January 19, 2017, 02:16:19 pm »
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.
« Last Edit: January 20, 2017, 12:36:27 pm by stephenmhall »

Offline facreby

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
Re: How To: Install Amazon Echo HA Bridge using Synology NAS
« Reply #4 on: February 04, 2017, 10:11:18 am »
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!

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).

Offline mbnn

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
Re: How To: Install Amazon Echo HA Bridge using Synology NAS
« Reply #5 on: March 22, 2017, 05:17:59 pm »
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!

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).

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? :)

Offline holger_40

  • Sr. Newbie
  • *
  • Posts: 32
  • Karma: +0/-0
Re: How To: Install Amazon Echo HA Bridge using Synology NAS
« Reply #6 on: October 25, 2017, 06:59:59 pm »
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. 

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?

Offline holger_40

  • Sr. Newbie
  • *
  • Posts: 32
  • Karma: +0/-0
Re: How To: Install Amazon Echo HA Bridge using Synology NAS
« Reply #7 on: November 13, 2017, 09:02:28 pm »
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 &