The steps below will build this out from HouseBot to Echo.
Create External Control Device
Create an External Control Device in HouseBot. Specify a unique port for this device. Do NOT use the ASCII protocol. Password is optional (not used in this example). External control devices are an easy and flexible way to control HouseBot from other systems.
Configure Webserver
Configure a webserver (either running on the HouseBot server machine, or on a machine that has network access to the HouseBot server) to use the HB_Control program via CGI. The online help for the External Control Device goes into more specifics on the setup, but much of the setup will depend on the webserver you are using. Essentially, you need a URL that points to the webserver to execute HB_Control.exe (or HB_Control.cgi, if you rename it).
Test this setup before going any further. You need to understand the URL format to fully configure the system at the end, so this will give you a good opportunity to make sure the webserver/cgi and external control device is setup correctly.
Generally, you should be able to enter a URL such as the one below and have it change the value of a Property in HouseBot.
Code: Select all
http://192.168.1.2:8000/cgi-bin/HB_Control.cgi?I=127.0.0.1&O=9876&C=SPV&D=Hall%20Light&P=Power%20State&V=On
Webserver IP:Port/path /HB Control EXE?HB Control Parameters (below)
I = HouseBot server IP address
O = Port configured in External Control Device (step 1)
C = SPV (Set Property Value). Other actions can also be used
D = Device to control
P = Property of Device to control
V = Value to set
You can use any of the different control options that the external control offers. For example, you could also execute a Task by creating a device in the echo bridge and using the On and Off URLs to call different execute task urls.
Install the Amazon Echo Bridge
The source and setup information for the bridge can be found in GitHub. The readme says that there is a pre-built jar file, but it's not in the current repository. I had to build it with Maven following the instructions in the readme. You will need to make sure you have Java installed to run it and the JDK to build it.
Build the jar file on the machine that is running HouseBot. It can run on any machine on the network, but to keep things simple (and follow these setup instructions) put it on the HouseBot machine.
Create a batch/command file (and add it to the startup group) to run the Echo Bridge with the following command.
Code: Select all
java -jar "<path to jar>\amazon-echo-bridge-0.2.1.jar" --upnp.config.address=192.168.1.100 --server.port=8081
--upnp.config.address should be set to the IP address of the machine that it is running on.
--server.port can be set to any available port.
Configure Bridge
After the Echo Bridge process has started and fully initialized, you can enter the URL below to access the device settings for the bridge.
Code: Select all
http://localhost:8081/configurator.html
This is the configuration page where the associations between the device name that you will ask Alexa/Echo to control and the URLs that will execute the action are setup. It only supports Off and On (and Dim) commands, but you can be a little creative and do anything that the External Control Device supports.
For example, to turn on the 'Foyer Light' (assuming you have a Device setup in HouseBot named 'Foyer Light'), you would enter Foyer Light in the Name field. The On URL would be something like:
Code: Select all
http://192.168.1.100:8000/cgi-bin/HB_Control.cgi?I=127.0.0.1&O=9876&C=SPV&D=Foyer%20Light&P=Power%20State&V=On
Code: Select all
http://192.168.1.100:8000/cgi-bin/HB_Control.cgi?I=127.0.0.1&O=9876&C=SPV&D=Foyer%20Light&P=Power%20State&V=Off
Test each of the URLs using the buttons on the configuration page to make sure they work as expected. Click the Add Device button to add the device to the bridge. Do this again for each device you want to be able to control using the Echo.
Discover Devices
After all of the devices have been setup in the bridge, have the Echo re/discover the devices by saying "Alexa, discover my devices" (or by using the app). After the discovery process is complete, you can control the devices. For example, to turn on the Foyer Light, you would just say "Alexa, turn on the Foyer Light".
There are a lot of technical details in this post, and it's possible that I forgot things or copied something down wrong. I realize that with the different processes, IP & Ports, URLs, etc., it can be confusing to setup initially. If you have any questions, feel free to ask in this post.