Amazon Echo with HA-Bridge Setup

 

1. Install NOOB to SD card

2. Open SSH for putty

  • Login pi : raspberry
pi@raspberrypi:~ $ sudo raspi-config
  • Interfacing Options >> SSH >> Yes

3. Set Static IP

pi@raspberrypi:~ $ sudo nano /etc/network/interfaces
  • Add this to the file
# The loopback interface
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
#your static IP
address 192.168.1.118  
#your gateway IP
gateway 192.168.1.1
netmask 255.255.255.0
  • Ctrl+x, Y, Enter to save file
pi@raspberrypi:~ $ sudo /etc/init.d/networking restart
pi@raspberrypi:~ $ sudo /etc/init.d/networking reload

4. Install JDK 8

pi@raspberrypi:~ $ sudo apt install openjdk-8-jdk

5. Install HA-Bridge

  • Install ha-bridge to /home/pi/habridge directory
pi@raspberrypi:~ $ mkdir habridge
pi@raspberrypi:~ $ cd habridge
pi@raspberrypi:~/habridge $ wget https://github.com/bwssytems/ha-bridge/releases/download/v4.2.1/ha-bridge-4.2.1.jar
  • Create habridge.service
pi@raspberrypi:~ $ cd /etc/systemd/system
pi@raspberrypi:~ $ sudo nano habridge.service
  • Copy this into file
[Unit]
Description=HA Bridge
Wants=network.target
After=network.target

[Service]
Type=simple

ExecStart=/usr/bin/java -jar -Dconfig.file=/home/pi/habridge/data/habridge.config /home/pi/habridge/ha-bridge-4.2.1.jar

[Install]
WantedBy=multi-user.target
  • Ctrl+x, Y, Enter to save file
  pi@raspberrypi:~ $ sudo systemctl daemon-reload
  pi@raspberrypi:~ $ sudo systemctl start habridge.service
  pi@raspberrypi:~ $ sudo systemctl enable habridge.service

Using HA-Bridge

Lighting

On

  http://user:password@HCIP/api/callAction?deviceID=xxx&name=turnOn

Dim

  http://user:password@HCIP/api/callAction?deviceID=xxx&name=setValue&arg1=${intensity.percent}

Off

  http://user:password@HCIP/api/callAction?deviceID=xxx&name=turnOff

Air Condition

On

  http://user:password@HCIP/api/callAction?deviceID=xxx&name=setThermostatSetpoint&arg1=10&arg2=25

Dim (Set Temperature)

  http://user:password@HCIP/api/callAction?deviceID=xxx&name=setThermostatSetpoint&arg1=10&arg2=${intensity.percent}

Off

  http://user:password@HCIP/api/callAction?deviceID=xxx&name=setMode&arg1=0