Announcement

Collapse
No announcement yet.

Control house modes using Alexa (HA-bridge only)

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

    Control house modes using Alexa (HA-bridge only)

    I wanted to control devices in my house using modes to set thermostats and arming my security system just by speaking to my Amazon Echo. What I found was I could do this by setting up HS events and HA-bridge devices to control house modes and run events based on the mode set. Below is a tutorial for others who are interested in doing the same.

    A big thanks to HS user rmohsen for the help in getting me started

    Since there is not a dedicated sub section for the HA-bridge I am posting it in the general section. Mods if this is not the right section, please move.



    Requirements:Overview:
    1. Create a virtual device in HS3 to use for setting house mode
    2. Create events to control devices for house modes and set virtual device to desired house mode
    3. Create devices on HA-bridge
    4. Test

    1. Create virtual device in HS3 to use for setting house modeClick image for larger version

Name:	1.jpg
Views:	1
Size:	87.9 KB
ID:	1210128







    2. Create events to control devices for house modes and set virtual device to desired house mode

    I will cover creating and configuring the "Home Mode" in this post.
    Create 2 HS events. One will set the virtual occupancy device mode. The other will control devices based on the virtual occupancy mode setting.

    Click image for larger version

Name:	2.jpg
Views:	1
Size:	29.4 KB
ID:	1210129
    Click image for larger version

Name:	3.jpg
Views:	1
Size:	85.0 KB
ID:	1210130





    3. Create devices on HA-bridge

    In order to change the occupancy mode with Alexa, create a device in the HA-bridge that represents the mode. Now copy the following in the "ON URL" field replacing the <HS3_IP> and <EventID> with your own values:

    http://<HS3_IP>/JSON?request=runevent&id=<EventID>

    To get the EventID number, run the following replacing the <HS3_IP> address with yours: http://<HS3_IP>/JSON?request=getevents

    Example output:

    {"Group":"Home","Name":"Home Mode for Alexa","id":3584}

    Now replace <EventID> with the event you want to run. In my case this would be the "Home Mode for Alexa" event (3584).

    Click image for larger version

Name:	4.jpg
Views:	1
Size:	23.9 KB
ID:	1210131



    Now re-initialize the HA-bridge

    Click image for larger version

Name:	5.jpg
Views:	1
Size:	36.7 KB
ID:	1210132


    Go to the Echo configuration web page or use the Alexa app and tell Alexa to discover devices. The new devices should show up in your smart home devices.

    Click image for larger version

Name:	6.jpg
Views:	1
Size:	23.0 KB
ID:	1210133


    4. Test

    Now you can say "Alexa, Turn on Home Mode". Alexa will respond "OK" and the virtual occupancy device will be changed to "Home" mode by the HS event "Home Mode for Alexa". Then the HS event "Home Mode" will trigger and control the devices that you set up for that event.


    Hopefully this post will help those like me who were confused about how to accomplish controlling HS events using Amazon Echo.

    Thanks,
    Andy

    #2
    New API format

    I just installed the Ha-bridge and and its running ok, even detected by echo, Logitech and somfy :-)

    I am having a hard time to invoke the REST APIs though, even though they perfectly work well from my browser.

    I am trying to figure out the settings that you use to pass such a function in ha-bridge?

    Code:
    [url]http://[address:port]/JSON?user=[/url][user]&pass=[pass]&request=controldevicebyvalue&ref=4&value=101
    I am replacing the pats in the square brackets with my details of course.

    what would you use under the HA-Bridge parameters:
    • Device Type (Informational)? I selected "execute script"
    • Map Type (Legacy)? I selected "execute script"
    • On Items / Type ? I selected "execute script"
    • Target Item?
    • Http Verb?
    • Http Body?
    • Http Headers?
    • Content Type? I select app/JSON



    Seeking your help, I am not sure why its not simple as indicated previously e.g. copy/paste your REST API.
    Last edited by ofird; March 16, 2018, 03:54 PM.

    Comment


      #3
      i managed when using a local ip address instead of a no-ip domain name

      Comment


        #4
        Might be an idea to share your experience of installing HA Bridge with others who may not be as familiar with it as you. I'm assuming you installed the HA Bridge on the same host as HS3.

        Comment


          #5
          HomeSeer Version: HS3 Pro Edition 3.0.0.368, Operating System: Microsoft Windows 10 - Home, Number of Devices: 373, Number of Events: 666, Enabled Plug-Ins
          2.0.83.0: BLRF, 2.0.10.0: BLUSBUIRT, 3.0.0.75: HSTouch Server, 3.0.0.58: mcsXap, 3.0.0.11: NetCAM, 3.0.0.36: X10, 3.0.1.25: Z-Wave,Alexa,HomeKit

          Comment

          Working...
          X