www.homeseer.com    
 

Go Back   HomeSeer Message Board > HomeSeer Products & Services > HomeSeer Software > HomeSeer Amazon Echo Connected Home API

HomeSeer Amazon Echo Connected Home API Discussions related to the Amazon Echo native support for connected home products

Reply
 
Thread Tools Display Modes
  #1  
Old December 9th, 2016, 10:03 AM
Furious Furious is offline
Seer Deluxe
 
Join Date: Apr 2011
Location: United Kingdom
Posts: 406
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 9th, 2016 at 02:38 PM. Reason: Added links for download and info
Reply With Quote
  #2  
Old December 9th, 2016, 10:11 AM
rmasonjr's Avatar
rmasonjr rmasonjr is offline
OverSeer
 
Join Date: May 2001
Location: Brookhaven, MS USA
Posts: 6,160
Subscribing...

This is very interesting. Does it have to run on the same server as HS?
__________________

HS3Pro Running on a Raspberry Pi2 (Raspbian)
61 Z-Wave Nodes, 162 Events, 293 Devices
UPB modules via OMNI plugin/panel
Plugins: Z-Wave, BLRF, HAI, HSTouch, weatherXML, EasyTrigger
HSTouch Clients: 3 Android, 1 Joggler
Reply With Quote
  #3  
Old December 9th, 2016, 10:13 AM
Furious Furious is offline
Seer Deluxe
 
Join Date: Apr 2011
Location: United Kingdom
Posts: 406
Quote:
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
Reply With Quote
  #4  
Old December 9th, 2016, 10:23 AM
JimBob's Avatar
JimBob JimBob is offline
Seer Master
 
Join Date: Mar 2002
Location: UK
Posts: 806
Thanks for posting. I'll give it a go this weekend
Reply With Quote
  #5  
Old December 9th, 2016, 10:51 AM
Simonk Simonk is offline
Seer Master
 
Join Date: Jul 2001
Location: Stevenage, UK
Posts: 666
Question

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
Reply With Quote
  #6  
Old December 9th, 2016, 11:00 AM
Furious Furious is offline
Seer Deluxe
 
Join Date: Apr 2011
Location: United Kingdom
Posts: 406
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.
Reply With Quote
  #7  
Old December 9th, 2016, 11:10 AM
Simonk Simonk is offline
Seer Master
 
Join Date: Jul 2001
Location: Stevenage, UK
Posts: 666
Quote:
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 Images
  
Reply With Quote
  #8  
Old December 9th, 2016, 11:14 AM
Simonk Simonk is offline
Seer Master
 
Join Date: Jul 2001
Location: Stevenage, UK
Posts: 666
Quote:
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?
Reply With Quote
  #9  
Old December 9th, 2016, 11:22 AM
Furious Furious is offline
Seer Deluxe
 
Join Date: Apr 2011
Location: United Kingdom
Posts: 406
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.
Reply With Quote
  #10  
Old December 9th, 2016, 11:38 AM
Simonk Simonk is offline
Seer Master
 
Join Date: Jul 2001
Location: Stevenage, UK
Posts: 666
Quote:
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
Reply With Quote
  #11  
Old December 9th, 2016, 12:02 PM
Simonk Simonk is offline
Seer Master
 
Join Date: Jul 2001
Location: Stevenage, UK
Posts: 666
Quote:
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
Reply With Quote
  #12  
Old December 9th, 2016, 12:12 PM
Furious Furious is offline
Seer Deluxe
 
Join Date: Apr 2011
Location: United Kingdom
Posts: 406
Quote:
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}
Reply With Quote
  #13  
Old December 9th, 2016, 12:49 PM
Simonk Simonk is offline
Seer Master
 
Join Date: Jul 2001
Location: Stevenage, UK
Posts: 666
Quote:
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?
Reply With Quote
  #14  
Old December 9th, 2016, 02:15 PM
integlikewhoa integlikewhoa is offline
Seer Master
 
Join Date: Jan 2015
Location: California
Posts: 1,075
Wow! I blinked for a second that this thread has taken off. Great work guys glad it could help a few people out.
Reply With Quote
  #15  
Old December 9th, 2016, 02:20 PM
integlikewhoa integlikewhoa is offline
Seer Master
 
Join Date: Jan 2015
Location: California
Posts: 1,075
Quote:
Originally Posted by langenet View Post
Can JSON be used to run a script or event?

Robert
Why ofcourse.

the documentation is here for all JSON
https://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
Reply With Quote
  #16  
Old December 9th, 2016, 02:25 PM
langenet's Avatar
langenet langenet is online now
Super Seer
 
Join Date: May 2003
Location: Ottawa, Ontario, Canada
Posts: 2,439
Quote:
Originally Posted by integlikewhoa View Post
Why ofcourse.

the documentation is here for all JSON
https://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
Man you're fast... realizing I found the answer to my question, I deleted my post to save the embarrassment

Robert
__________________
HS3PRO 3.0.0.318 as a Fire Daemon service, Windows 2016 Server Std Intel Core i5 PC HTPC Slim SFF 4GB, 120GB SSD drive, WLG800, RFXCom, TI103,NetCam, UltraNetcam3, BLBackup, CurrentCost 3P Rain8Net, MCsSprinker, HSTouch, Ademco Security plugin/AD2USB, various Oregon Scientific temp/humidity sensors, Z-Net, Zsmoke, Aeron Labs micro switches, Amazon Echo Dot, WS+, WD+ ... on and on.
Reply With Quote
  #17  
Old December 9th, 2016, 02:33 PM
langenet's Avatar
langenet langenet is online now
Super Seer
 
Join Date: May 2003
Location: Ottawa, Ontario, Canada
Posts: 2,439
So just had a thought and wondered if this would work with Jon00's Alexa helper script (2.0)?... That would be way cool!

Jon??

Robert
Reply With Quote
  #18  
Old December 9th, 2016, 02:34 PM
integlikewhoa integlikewhoa is offline
Seer Master
 
Join Date: Jan 2015
Location: California
Posts: 1,075
Quote:
Originally Posted by langenet View Post
Man you're fast... realizing I found the answer to my question, I deleted my post to save the embarrassment

Robert
No embarrassment intended, but I do think its a good idea to leave this info up for anyone else that might have the same question. I'm sure your not the only one.

I also don;t think anyone has had this problem yet but for some of the newer users it should be noted that "Allow Control by JSON" should be checked or enabled in the HS3 network settings page or none of this will work.
Reply With Quote
  #19  
Old December 9th, 2016, 02:39 PM
Furious Furious is offline
Seer Deluxe
 
Join Date: Apr 2011
Location: United Kingdom
Posts: 406
Quote:
Originally Posted by integlikewhoa View Post
No embarrassment intended, but I do think its a good idea to leave this info up for anyone else that might have the same question. I'm sure your not the only one.

I also don;t think anyone has had this problem yet but for some of the newer users it should be noted that "Allow Control by JSON" should be checked or enabled in the HS3 network settings page or none of this will work.
Nice catch, I've added that to the first post
Reply With Quote
  #20  
Old December 9th, 2016, 02:40 PM
integlikewhoa integlikewhoa is offline
Seer Master
 
Join Date: Jan 2015
Location: California
Posts: 1,075
Quote:
Originally Posted by langenet View Post
So just had a thought and wondered if this would work with Jon00's Alexa helper script (2.0)?... That would be way cool!

Jon??

Robert
I know you or someone mentioned it in the other thread yesterday, but I have never heard of it or used it myself. I did look it up but I didn't put any time into reading it.

I also noticed you guys were using ALEXA way more then I like too. Honestly I'm not a huge voice control fan myself. I use it very basically and every once in awhile. Mostly lights and tv control

Kid watching tv when hes supposed to be cleaning up..... If feel like I might what to beat him with the remote after I get it from him I don't even ask for it I just tell Alexa to turn off the tv and walk away putting an end to the whole deal.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to add devices in homekit bridge? Carlyle Harper Homekit bridge (3P) 1 November 2nd, 2016 07:49 PM
HS3 Serial RS232 Direct Control xxrzdxx HomeSeer General Discussion Area 19 August 14th, 2015 01:09 AM
URL for direct device control jgreeno HS2 / HSPRO 1 February 4th, 2014 09:23 PM
Direct HTTP (Remote Control) DrDoo HSTouch™ 1 September 23rd, 2011 05:45 PM


All times are GMT -4. The time now is 12:36 AM.


Copyright HomeSeer Technologies, LLC