Tuicemens

Pages: [1]

Author Topic: setup of the ha-bridge on a SBC  (Read 783 times)

Tuicemen

  • Administrator
  • Hero Member
  • *****
  • Helpful Rating: 26
  • Offline Offline
  • Posts: 3711
  • Making Home Automation Fun!
    • Tuicemen.com
setup of the ha-bridge on a SBC
« on: April 25, 2018, 10:05:40 AM »

Setting up The Ha-Bridge on a Pi is straight forward and should be as simple on any SBC running Linux..
just follow the directions posted in the HA-Bridge readme:
https://github.com/bwssytems/ha-bridge/blob/master/README.md#manual-installation-of-ha-bridge-and-setup-of-systemd-service
For the absolute PI Beginner the instructions may look a bit confusing (they did to me ay first too)
For this reason I'll do a step by step
 this assumes you have no other server running using port 80 as HA-bridge initially starts using that port. if so change the port in the other servers
1: in your PI open a terminal window (this is Basicaly a command prompt)
2: copy or type below into the terminal and hit enter (this makes the ha-bridge folder)
Code: [Select]
mkdir ha-bridge3: copy or type below into the terminal and hit enter (this moves you into the ha-bridge folder)so the program can be placed there.
Code: [Select]
cd ha-bridge4:copy or type below into the terminal and hit enter( this downloads the required file.
Code: [Select]
wget https://github.com/bwssytems/ha-bridge/releases/download/v5.2.1/ha-bridge-5.2.1.jar5:copy or type  below  and hit enter(this changes the name to just ha-bridge.jar it helps with updates )
Code: [Select]
mv ha-bridge-5.2.1.jar ha-bridge.jar6: if you plan to run as a service (meaning you want this to run on every boot up) then
copy or type below and hit enter( this moves you to the folder where services are handled
Now to create the HA-Bridge service:
Code: [Select]
cd /etc/systemd/system7: copy or type and hit enter (this opens a text editor to create the HA-Bridge service.)
Code: [Select]
sudo nano ha-bridge.service8: with the nano text editor screen open, copy or type exactly the below text into the new screen
Code: [Select]
[Unit]
Description=HA Bridge
Wants=network.target
After=network.target

[Service]
Type=simple

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

[Install]
WantedBy=multi-user.target
Save the file in the editor by hitting CTL-X and then saying Y to update and save. Hit Enter  and this should close the nano window and return you to the terminal window to enter more commands
 
9:type or copy below and hit enter (this reloads all service files, ha-bridge.service included so the Pi knows they are here)
Code: [Select]
sudo systemctl daemon-reload10: copy or type below and hit enter (this loads the service and starts HA-Bridge)
Code: [Select]
sudo systemctl start ha-bridge.service
Now we want to load the service so it starts for every boot
11: copy or type below and hit enter ( this tells the pi to run HA-Bridge at every start up)
Code: [Select]
sudo systemctl enable ha-bridge.service
For those that find the above just to much to handle, do, or comprehend there is an event simpler route (read on)  ;>

I created a simple script which requires one line to be pasted into a terminal window then just hit enter and sit back and wait for the confirmation the install is done.
Here it is:
Code: [Select]
[code]wget -qO- http://tuicemen.com/downloads/pi/ha-bridge/HA-BridgeInstaller.sh | bash[/code]

Once you have ha-bridge installed and running open your browser to localhost. Once HA-Bridge is displaying click on the Bridge Control tab.
If you wish to change your port scroll down to Web Server Port and edit the 80 to what ever port you wish to use.
If you have a Broadlink RM continue to scroll down until you see Broadlink Support. click the false button so it turn to true.
If you have any other things supported by the bridge set their info as well then scroll to the top and click save.
When the bridge restarts you'll be at the Devices screen go back to the Bridge control tab (screen) and click Update Security Settings
This will allow you to setup users and password so access to the bridge so it is restricted to only those users.
I'll post how to add devices in this thread in an other post. ;>
« Last Edit: August 18, 2018, 05:59:36 PM by Tuicemen »
Logged
Get the inside scoop and member perks in the
Members Only Section!

Please don't email me Automation questions 
The forum is for that!

Tuicemen

  • Administrator
  • Hero Member
  • *****
  • Helpful Rating: 26
  • Offline Offline
  • Posts: 3711
  • Making Home Automation Fun!
    • Tuicemen.com
Re: setup of the ha-bridge on a SBC
« Reply #1 on: May 02, 2018, 11:09:42 AM »

Setting up HG controlled X10 devices in HA-Bridge
Depending on what HA software your running on your Pi will affect  what your on/off/dim commands will be
for HomeGenie which I currently have running here are some popular ones:
1- on command is: http:// your Home genie IP & Port/api/HomeAutomation.X10/A3/Control.On
2- off the command is http:// your Home genie IP & Port/api/HomeAutomation.X10/A3/Control.Off
3- AllLightsOn is http:// your Home genie IP & Port/api/HomeAutomation.X10/A/Control.AllLightsOn
4- AllLightsOff is http:// your Home genie IP & Port /api/HomeAutomation.X10/A/Control.AllLightsOff
5- one step Dim http:// your Home genie IP & Port/api/HomeAutomation.X10/<module_address>/Control.Dim
« Last Edit: August 16, 2018, 02:19:27 PM by Tuicemen »
Logged
Get the inside scoop and member perks in the
Members Only Section!

Please don't email me Automation questions 
The forum is for that!

Tuicemen

  • Administrator
  • Hero Member
  • *****
  • Helpful Rating: 26
  • Offline Offline
  • Posts: 3711
  • Making Home Automation Fun!
    • Tuicemen.com
Re: setup of the ha-bridge on a SBC
« Reply #2 on: August 16, 2018, 05:39:54 PM »

Adding devices to HA-Bridge
From the ha-bridge interface click on add/edit and enter your device info.
Note: you must click the add button to the right of the on/off or dim items lines prior to scrolling to the top and clicking Add Bridge Device attched is a screen shot for my x10 Wolf Lamp clicking on it will enlarge it but you may need to download and enlarge it to see all details
Adding Broadlink RM devices is a bit different.
« Last Edit: August 16, 2018, 05:42:32 PM by Tuicemen »
Logged
Get the inside scoop and member perks in the
Members Only Section!

Please don't email me Automation questions 
The forum is for that!
Pages: [1]