Please login or register.

Login with username, password and session length

Author Topic: Pi newbie HA-Bridge Guide  (Read 12246 times)

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 282
  • Posts: 10493
  • I don't work for X10, I use it successfuly!
Pi newbie HA-Bridge Guide
« on: August 18, 2018, 02:49:55 PM »

COs, Please don't post to this thread unless it is to add info for this setup.
Setting up The Ha-Bridge on a Pi is straight forward and should be as simple on any SBC running Linux for the Experienced PI user, 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 before you start!
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.3.0/ha-bridge-5.3.0.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.3.0.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
If all of the above seems to much then you can just use the installer I created.
http://forums.x10.com/index.php?topic=30450.msg175271#msg175271

Once you have ha-bridge installed and running open your web browser on your Pi 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,  See attached.

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 (hubs or software) 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 you wish access.
I'll post how to add devices in this thread in another post.
 >!
« Last Edit: December 06, 2019, 06:12:07 PM by Tuicemen »
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 282
  • Posts: 10493
  • I don't work for X10, I use it successfuly!
Re: Pi newbie HA-Bridge Guide
« Reply #1 on: August 18, 2018, 02:51:10 PM »

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


Setting up Mochad to call X10 devices in HA-Bridge

This assume you have made the script file called X10cmd and placed it in the ha-bridge folder
1- on command is: ./x10cmd pl a1 on
2- off the command is: ./x10cmd pl a1 off
3- AllLightsOn is ./x10cmd pl a all_lights_on
4- AllLightsOff is: ./x10cmd pl a all_lights_off
5- One step Dim is: ./x10cmd pl a1 dim
« Last Edit: August 24, 2018, 01:08:27 PM by Tuicemen »
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 282
  • Posts: 10493
  • I don't work for X10, I use it successfuly!
Re: Pi newbie HA-Bridge Guide
« Reply #2 on: August 18, 2018, 02:53:46 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 controlled by HG. You may need to download and enlarge it to see all details
To control devices with mochad the entries are a bit different as we'll be using a script not sending a http call
Adding Broadlink RM devices is a bit different as are other devices you may be controlling from other software or hubs.
« Last Edit: August 24, 2018, 01:34:16 PM by Tuicemen »
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 282
  • Posts: 10493
  • I don't work for X10, I use it successfuly!
Re: Pi newbie HA-Bridge Guide
« Reply #3 on: August 20, 2018, 02:52:20 PM »


Setting up HA-Bridge for sending calls to mochad!
mochad can be setup a couple of different ways depending on if it is on the same pi or on another device.
Here I'll be assuming your using the x10cmd script  and a copy of it is in the ha-bridge folder.
As with the HG setup you need to navigate to the Add/Edit tab  attached is a sample of my same wolf lamp configured to use Mochad you may need to download it(recommended) to see all details
« Last Edit: August 24, 2018, 01:49:48 PM by Tuicemen »
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 282
  • Posts: 10493
  • I don't work for X10, I use it successfuly!
Re: Pi newbie HA-Bridge Guide
« Reply #4 on: August 24, 2018, 01:35:07 PM »


I've split and removed comments to a separate thread ( http://forums.x10.com/index.php?topic=30444.30 ) to make any additions easier to find. If you wish to comment or need help please start a new thread or post to the above linked thread.
COs, Please don't post to this thread unless it is to add info for a setup.
Logged
Please Read Topic:
General Forum Etiquette
Before you post!
 

X10.com | About X10 | X10 Security Systems | Cameras| Package Deals
© Copyright 2014-2016 X10.com All rights reserved.