Announcement

Collapse
No announcement yet.

HA-Bridge - EU/UK direct control of devices

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    HA-Bridge - EU/UK direct control of devices

    Hi all,
    after the recent myHS outage, some bright spark (integlikewhoa) suggested that we can use HA bridge to run a nice little jar locally on our servers to basically act as a gateway for our collective echoes and have direct control instead of the usual "tell homeseer to do x".

    To spread the wealth, here's some quick and dirty instructions to get started on windows, please feel free to add any comments or suggestions, especially need something straightforward for linux users.

    Info here:
    https://github.com/bwssytems/ha-bridge

    Download latest Jar/java here:
    https://github.com/bwssytems/ha-bridge/releases

    Firstly, enable JSON in Homeseer:
    Click Tools, Setup. Then select Network.
    Scroll down to Remote Control Settings, then tick the two boxes, leaving the other as default.

    All the below assumes you've already installed java, and have it in the system path.
    To confirm, run from a command prompt:
    java -version

    Create a directory and copy the ha-bridge-3.5.1.jar file into it.

    Run within the command prompt:
    java -jar -Dserver.port=85 ha-bridge-3.5.1.jar
    (This starts the process listening on port 85 - note it is case sensitive for the switch for the port)
    Note: configure your firewall to allow the ports - eg 85 for http control, and 50000 for the upnp stuff

    Point a browser at it (e.g.
    Code:
    http://192.168.x.x:85
    )

    Create all of your devices using the spoken name you want to call it - e.g. kitchen light, living room TV, etc
    the device creation page I used the following:
    device type: custom
    Map type: vera device
    On URL:
    Code:
    http://192.168.x.x/JSON?request=controldevicebyvalue&ref=7351&value=255
    Off URL:
    Code:
    http://192.168.x.x/JSON?request=controldevicebyvalue&ref=7351&value=0
    <this will depend on your device ref>
    Http verb: GET
    Content type: application/json

    Once created, test the actions by going to the home page of the bridge configuration, then click the test on/test off.

    After all have been created and tested, go into the alexa app and discover devices. It should find them all and you can
    then control them on and off. You can also create groups in the app to do mass on/off events.

    It's all json control, so if you want to fire an event instead of set a device:
    Code:
    http://192.168.x.x/JSON?request=runevent&group=Control&name=set%20nighttime%20mode%20on
    <replace spaces with url encoded %20>

    Once you're happy, you can save the config, it'll save in a subfolder where the .jar file is stored. Then, to start it
    create a batch/cmd file with just:
    Code:
    c:\ha-bridge\java -jar ha-bridge-3.5.1.jar
    and pop it into your startup folder (windows 10, run shell:startup to open the folder)
    Last edited by Furious; December 9, 2016, 01:38 PM. Reason: Added links for download and info

    #2
    Subscribing...

    This is very interesting. Does it have to run on the same server as HS?
    HS4Pro Running on a Raspberry Pi4
    68 Z-Wave Nodes, 175 Events, 359 Devices
    UPB modules via OMNI plugin/panel
    Plugins: Z-Wave, OMNI, HSTouch, weatherXML, EasyTrigger
    HSTouch Clients: 3 Android, 1 Joggler

    Comment


      #3
      Originally posted by rmasonjr View Post
      Subscribing...

      This is very interesting. Does it have to run on the same server as HS?
      Not at all, only requirement is that you can get to/from the echo devices and to/from the HS server

      Comment


        #4
        Thanks for posting. I'll give it a go this weekend

        Comment


          #5
          This looks good, just following through the instructions and can successfully turn on and off the Kitchen light from the HA Bridge webpage, but when I go into the alexa app and discover devices it doesn't find anything.

          Is there any skills or anything that I need to install/enable in the alexa app to be able to discover this?

          I've installed it on the same machine as homeseer and firewall is disabled.

          Thanks
          Simon

          Comment


            #6
            You're pretty much nearly there then - post a screencap of what you have configured, as the echo should be able to query the bridge and get the devices.

            Comment


              #7
              Originally posted by Furious View Post
              You're pretty much nearly there then - post a screencap of what you have configured, as the echo should be able to query the bridge and get the devices.
              Firewall is totally off on the server, screen shots below of configuration:
              Attached Files

              Comment


                #8
                Originally posted by Furious View Post
                You're pretty much nearly there then - post a screencap of what you have configured, as the echo should be able to query the bridge and get the devices.
                Just had a thought the Amazon Dots are all connected on a guest wireless network of 192.168.8.x whereas as everything else including the HS server is on 192.168.0.x, could this be the issue?

                Comment


                  #9
                  Yep, that'd do it if you've got your wireless set to isolate the guest network - the echoes need to get to the main network to do the discovery.

                  Comment


                    #10
                    Originally posted by Furious View Post
                    Yep, that'd do it if you've got your wireless set to isolate the guest network - the echoes need to get to the main network to do the discovery.
                    I've put them back on the same subnet and discover devices and found it :-)

                    Do you know what I would need to put in the Dim URL to dim the lights to the requested percentage?

                    Thanks
                    Simon

                    Comment


                      #11
                      Originally posted by Furious View Post
                      create a batch/cmd file with just:
                      Code:
                      c:\ha-bridge\java -jar ha-bridge-3.5.1.jar
                      and pop it into your startup folder (windows 10, run shell:startup to open the folder)
                      I couldn't get the above to work in a batch file, got errors.

                      I had to seperate into 2 lines before I could get it to work.

                      CD c:\ha-bridge\
                      java -jar ha-bridge-3.5.1.jar

                      Comment


                        #12
                        Originally posted by Simonk View Post
                        I've put them back on the same subnet and discover devices and found it :-)

                        Do you know what I would need to put in the Dim URL to dim the lights to the requested percentage?

                        Thanks
                        Simon
                        Something like this:
                        Code:
                        http://192.168.x.x/JSON?request=controldevicebyvalue&ref=7351&value=${intensity.percent}

                        Comment


                          #13
                          Originally posted by Furious View Post
                          Something like this:
                          Code:
                          http://192.168.x.x/JSON?request=controldevicebyvalue&ref=7351&value=${intensity.percent}
                          Thanks for that, works great.

                          Is it possible with this to pass information back from HomeSeer to be read by Alexa?

                          Comment


                            #14
                            Wow! I blinked for a second that this thread has taken off. Great work guys glad it could help a few people out.

                            Comment


                              #15
                              Originally posted by langenet
                              Can JSON be used to run a script or event?

                              Robert
                              Why ofcourse.

                              the documentation is here for all JSON
                              http://www.homeseer.com/support/home..._with_json.htm

                              But specificly you answer or command would be this to run by the event name or ID number:

                              /JSON?request=runevent&group=GROUPNAME&name=EVENTNAME

                              OR

                              /JSON?request=runevent&id=EVENT_ID

                              Comment

                              Working...
                              X