Want to control your Vera, Harmony hub or Home Assistant entities with your Amazon echo or Google Home? ha-bridge is the best way to achieve that and installation is actually quite easy and takes less than 5 minutes. Here are the steps.
- On your Raspberry Pi, make sure you are in the Pi home folder:
- Then make a habridge folder:
- Now change to the folder and download the latest ha-bridge jar file:
- Create a ‘data’ holder inside the habridge folder:
- Now you have to create the systemd service file:
- Then copy and paste the following:
ExecStart=/usr/bin/java -jar -Dconfig.file=/home/pi/habridge/data/habridge.config /home/pi/habridge/ha-bridge-4.1.4.jar
- Now, to save the file, hit CTRL-X, then hit Y and RETURN
- You need Java 8 JDK to be able to run ha-bridge
sudo apt-get update && sudo apt-get install oracle-java8-jdk
- Then run:
sudo update-alternatives --config java and select the JDK 8 version (/usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/bin/java) if asked.
- Then run the following to confirm you have the right Java version:
- Next you need to enable the systemd service so it will automatically start every time you reboot your Raspberry Pi (ignore the Shell script instructions on the ha-bridge ReadMe as newer Debian builds [Jessie] work best with systemd):
sudo systemctl enable /home/pi/habridge/habridge.service
- Now that it is enabled, you have to start it. Since it is enabled, you don’t need the full path to run it:
sudo systemctl start habridge
- The default port for HA Bridge is 80, so open your browser and go to your RPI address, port 80:
- Stop ha-bridge either via the GUI or using sudo systemctl stop habridge.service
- Change into the ha-bridge directory cd /home/pi/habridge
- Edit the service file nano habridge.service
- Save the change then run sudo systemctl daemon-reload
- Start the service using sudo systemctl start habridge.service
- Check the status after a few seconds with sudo systemctl status habridge.service
Immediately after configuring the bridge and all of you devices, I would run a backup at the bottom of the "Bridge Devices" tab and the "Bridge Control" tab. If you do not choose a name, ha-bridge will automatically create one for you.
Bridge Devices is all of the individual actions you've created and if the defaults are left, the backup file will be located in /data and look something like device.db-2017-02-07-20-28-06.bk.
Bridge Control contains the actual bridge configuration like your Harmony Hubs IP, Vera, MQTT etc. The backup is located in /home/pi/habridge/data and looks something likes habridge.config-2017-02-07-20-28-19.cfgbk.
I strongly encourage you to remote in to your Pi using WinSCP and save these backup files locally just in case your Pi's SD card goes duff as mine has on three occasions now. Popping these backups into the appropriate folders after a rebuild certainly makes getting ha-bridge live again much simpler.