Amazon Echo with HA-Bridge Setup

 

1. Install NOOB to SD card

2. Open SSH for putty

  • Login pi : raspberry
[email protected]:~ $ sudo raspi-config
  • Interfacing Options >> SSH >> Yes

3. Set Static IP

[email protected]:~ $ 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
[email protected]:~ $ sudo /etc/init.d/networking restart
[email protected]:~ $ sudo /etc/init.d/networking reload

4. Install JDK 8

[email protected]:~ $ sudo apt install openjdk-8-jdk

5. Install HA-Bridge

  • Install ha-bridge to /home/pi/habridge directory
[email protected]:~ $ mkdir habridge
[email protected]:~ $ cd habridge
[email protected]:~/habridge $ wget https://github.com/bwssytems/ha-bridge/releases/download/v4.2.1/ha-bridge-4.2.1.jar
  • Create habridge.service
[email protected]:~ $ cd /etc/systemd/system
[email protected]:~ $ 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
  [email protected]:~ $ sudo systemctl daemon-reload
  [email protected]:~ $ sudo systemctl start habridge.service
  [email protected]:~ $ 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