Page 2 of 6

Re: HouseBot and Amazon Echo

Posted: Sun Nov 29, 2015 1:52 pm
by Richard Naninck
Last week I built the exact same thing but with Apple Siri instead.
Used the HTTP plugin.
Easy to set up and works fine using an Apple Watch: Heh Siri, Garage door open

The http plugin can emulate a switch or a light giving it On/Off and Brightness control. Since I don't want to turn my Garagedoor On or Off I created Scenes which are called Garagedoor Open/Close containing the On/Off switches. Simple workaround with great effect. After putting an Apple TV in the loop, I can now also control the bridge from outside my localhost. Thus providing me THE feature which I desired most and that is telling Siri that I am getting home with my car when close to my house which pens the garagedoor, unlocks the locks etc.

https://github.com/cflurin/homebridge-s ... spberry-Pi
https://github.com/nfarina/homebridge
https://www.npmjs.com/browse/keyword/homebridge-plugin
https://www.npmjs.com/package/homebridge-http

Re: HouseBot and Amazon Echo

Posted: Mon Nov 30, 2015 9:28 am
by Steve Horn
My Echo-Alexa-Housebot implementation is still a work in progress. Some commands works, others not yet, probably due to URL string errors on my part. But what I've noticed so far is that the spoken device turn on/turn off command, which may actually trigger a task event, needs to have a unique "device" name different from normally recognized and accepted Alexa requests. That is, not good to have a HB "device" called Pandora built in the bridge (I.e. "Alexa, turn Pandora on" would trigger a HB task that does whatever to fire up Pandora on a Roku box in my system). Alexa instead fired up Pandora on the Echo. I had assumed that Alexa would distinguish echo destined commands from bridge commands by recognizing "play Pandora" from "Turn Pandora on". Apparently not, at least not yet, as I haven't learned the rules of using the echo Phillips hue bridge commands yet.

A question though on the echo bridge: where is the stuff stored? The voice recognition of the bridge devices is apparently stored on the echo, via the discover step. The translation to a HB URL string is stored on the echo ha bridge (in my case, a separate PC from the HB server). Is that right? Also, I'm a little fuzzy on the configurator UI. I've managed to create a bunch of "devices" and associated on/off URLs. But not sure about Load And Go Buttons. Is "Load" needed before the echo discovery step?and what does "Go" do?

Richard, your Siri implementation doesn't seem to have that phraseology limitation. Cool. But you have to push a button to wake Siri up. We echo users just holler "Alexa...". But we have to be within hollering range of an Echo. You can be anywhere within range of an iDevice. Regardless, both implementations are cool extensions of Housebot and that is good. (And I still need to get to your geofence project.)

Re: HouseBot and Amazon Echo

Posted: Mon Nov 30, 2015 11:40 am
by Richard Naninck
Steve, Siri wakes up just by saying: Heh Siri on both the Phone or the Watch or the Pad. So no pushing buttons here. Since I use the Watch, I don't have to get the Phone out of my pocket either.

Siri does have limitations. I wanted a scene called "Start Xbox" where it would start the Cinema Xbox script, but instead it launched the xbox app on the Phone. So the phrases need to be choosen carefully.

Re: HouseBot and Amazon Echo

Posted: Mon Nov 30, 2015 5:13 pm
by Steve Horn
Richard Naninck wrote:... So the phrases need to be choosen carefully.
Yes, I can relate to that. Didn't know about buttonless Siri. That's cool.

Re: HouseBot and Amazon Echo

Posted: Tue Dec 01, 2015 2:57 am
by Richard Naninck
Yesterday I kind of hacked the index.js script after studying which HomeKit services are available and added a GarageDoorOpener service. So the garagedoor previously labelled as Switch is now labelled GarageDoorOpener which changes the available phrases that go along with it. I can now call Siri and tell it to open or close the garagedoor rather than to turn the garagedoor on or off OR use a scene like described in a previous post. It was a simple hack. My garagedoor makes sense now :D

Re: HouseBot and Amazon Echo

Posted: Sun Dec 13, 2015 6:53 pm
by Steve Horn
Where is the data associated with on and off commands (URL strings) stored once its built through the configurator? I had a bunch built and functional and had to do a restart for an antivirus upgrade. And now the configurator is empty. I have a text file squirreled away with all the URL strings so rebuilding it wont be too bad... but should be unnecessary. :oops:

Re: HouseBot and Amazon Echo

Posted: Sun Dec 13, 2015 8:33 pm
by ScottBot
I'm not exactly sure where it's stored, but it's stored by the echo-ha-bridge. Since it's running in Java, I'm guessing it's in a file somewhere under the directory where the jar file lives.

Re: HouseBot and Amazon Echo

Posted: Fri Jan 01, 2016 8:23 pm
by Steve Horn
I never have found where the metadata is stored. And if the host Echo HA server, which is running the java bridge/configurator, is rebooted, then (in my experience anyway) all the device and URL data is lost. Rebuilding it is possible with good notes but shouldn't be necessary. I suspect the "Load" and "Go" buttons in the configurator do something with the metadata but I haven't figure out what. (Clicking Go opens a a browser tab that displays the metadata in XML like format. But looking at date/time stamps in Windows File Explorer did not show any files with recent date/times that might indicate its the repository.)
Anyone else run into this? I looked at some of the other user community info but found nothing that describes how the configurator's back end works. Its clearly not in the Echo, because once the configurator is down Alexa is dumb.

Re: HouseBot and Amazon Echo

Posted: Sat Jan 02, 2016 3:17 pm
by ScottBot
Steve,

I'm able to reboot the machine and the echo bridge and have all the settings retained. I wonder if it's because you are just running the JAR file without the rest of the directory structure that is included with the full package.

It looks to me like the data is stored in the "\data\elasticsearch\nodes\0\indices\device\0\index" directory that is relative to the location of the jar file.

Re: HouseBot and Amazon Echo

Posted: Sat Jan 02, 2016 6:47 pm
by Steve Horn
Could be. I don't recall seeing that directory structure but I'm away from the box at the moment. Will check. And frankly, don't recall any specific installation instructions that came with the download. But that would explain it. I did find an alternative last night that bypasses configurator.html and does allow saving the metadata. But I didn't have time to get it fully functional yet and, ideally, will allow me to move the bridge back to the HB server instead of on the sandbox.

Re: HouseBot and Amazon Echo

Posted: Sun Jan 03, 2016 4:44 pm
by Steve Horn
No such directory structure here. When I downloaded the jar file from here: https://github.com/armzilla/amazon-echo ... e/releases all I get/got was the jar executable; no installation info, etc. So I left the jar in the Downloads subdir and just point to that path with a bat file that runs it on startup.
My other method is a slick program that gives one a way of doing POSTs to the emulator, bypassing the configurator.html. And it allows saving of the metadata, which would solve my non-saving issue with configurator. Of course, solving the path issue may correct that if I can get the jar installation down. And I ran into a problem with this POST method in that it needs to have a clear shot at 3 ports, one of which (1900) is for upnp. And I haven't been able to kill that svchost process.
Probably the most appropriate solution is to get the jar paths set up as you describe. But looking on the net for info on the jar's installation was fruitless. Where did you find that info?

Re: HouseBot and Amazon Echo

Posted: Sun Jan 03, 2016 5:38 pm
by ScottBot
I found that path by looking through the directory structure and looking into the files that had recent dates. They are binary files, but I saw names of the Devices that were created in the configuration.

I'll have an official HouseBot alexa skill at some point in the future that will be much easier to setup.

I'm not sure where that directory structure came from. Must have been created during the build process or something. Here's the complete structure (with file names), if you want to try and recreate.

Code: Select all

Y:\Amazon Echo Bridge\amazon-echo-bridge-0.2.1.jar
Y:\Amazon Echo Bridge\classes
Y:\Amazon Echo Bridge\data
Y:\Amazon Echo Bridge\dir-structure.txt
Y:\Amazon Echo Bridge\generated-sources
Y:\Amazon Echo Bridge\generated-test-sources
Y:\Amazon Echo Bridge\maven-archiver
Y:\Amazon Echo Bridge\maven-status
Y:\Amazon Echo Bridge\StartEchoBridge.cmd
Y:\Amazon Echo Bridge\surefire-reports
Y:\Amazon Echo Bridge\test-classes
Y:\Amazon Echo Bridge\classes\com
Y:\Amazon Echo Bridge\classes\static
Y:\Amazon Echo Bridge\classes\com\armzilla
Y:\Amazon Echo Bridge\classes\com\armzilla\ha
Y:\Amazon Echo Bridge\classes\com\armzilla\ha\api
Y:\Amazon Echo Bridge\classes\com\armzilla\ha\dao
Y:\Amazon Echo Bridge\classes\com\armzilla\ha\devicemanagmeent
Y:\Amazon Echo Bridge\classes\com\armzilla\ha\filters
Y:\Amazon Echo Bridge\classes\com\armzilla\ha\hue
Y:\Amazon Echo Bridge\classes\com\armzilla\ha\SpringbootEntry.class
Y:\Amazon Echo Bridge\classes\com\armzilla\ha\upnp
Y:\Amazon Echo Bridge\classes\com\armzilla\ha\api\Device.class
Y:\Amazon Echo Bridge\classes\com\armzilla\ha\api\hue
Y:\Amazon Echo Bridge\classes\com\armzilla\ha\api\hue\DeviceResponse.class
Y:\Amazon Echo Bridge\classes\com\armzilla\ha\api\hue\DeviceState.class
Y:\Amazon Echo Bridge\classes\com\armzilla\ha\api\hue\HueApiResponse.class
Y:\Amazon Echo Bridge\classes\com\armzilla\ha\dao\DeviceDescriptor.class
Y:\Amazon Echo Bridge\classes\com\armzilla\ha\dao\DeviceRepository.class
Y:\Amazon Echo Bridge\classes\com\armzilla\ha\devicemanagmeent\DeviceResource.class
Y:\Amazon Echo Bridge\classes\com\armzilla\ha\filters\SpringBootCorsFilter.class
Y:\Amazon Echo Bridge\classes\com\armzilla\ha\hue\HueMulator.class
Y:\Amazon Echo Bridge\classes\com\armzilla\ha\upnp\UpnpListener.class
Y:\Amazon Echo Bridge\classes\com\armzilla\ha\upnp\UpnpSettingsResource.class
Y:\Amazon Echo Bridge\data\elasticsearch
Y:\Amazon Echo Bridge\data\elasticsearch\nodes
Y:\Amazon Echo Bridge\data\elasticsearch\nodes\0
Y:\Amazon Echo Bridge\data\elasticsearch\nodes\0\indices
Y:\Amazon Echo Bridge\data\elasticsearch\nodes\0\node.lock
Y:\Amazon Echo Bridge\data\elasticsearch\nodes\0\_state
Y:\Amazon Echo Bridge\data\elasticsearch\nodes\0\indices\device
Y:\Amazon Echo Bridge\data\elasticsearch\nodes\0\indices\device\0
Y:\Amazon Echo Bridge\data\elasticsearch\nodes\0\indices\device\_state
Y:\Amazon Echo Bridge\data\elasticsearch\nodes\0\indices\device\0\index
Y:\Amazon Echo Bridge\data\elasticsearch\nodes\0\indices\device\0\translog
Y:\Amazon Echo Bridge\data\elasticsearch\nodes\0\indices\device\0\_state
Y:\Amazon Echo Bridge\data\elasticsearch\nodes\0\indices\device\0\index\segments.gen
Y:\Amazon Echo Bridge\data\elasticsearch\nodes\0\indices\device\0\index\segments_w
Y:\Amazon Echo Bridge\data\elasticsearch\nodes\0\indices\device\0\index\write.lock
Y:\Amazon Echo Bridge\data\elasticsearch\nodes\0\indices\device\0\index\_x.fdt
Y:\Amazon Echo Bridge\data\elasticsearch\nodes\0\indices\device\0\index\_x.fdx
Y:\Amazon Echo Bridge\data\elasticsearch\nodes\0\indices\device\0\index\_x.fnm
Y:\Amazon Echo Bridge\data\elasticsearch\nodes\0\indices\device\0\index\_x.nvd
Y:\Amazon Echo Bridge\data\elasticsearch\nodes\0\indices\device\0\index\_x.nvm
Y:\Amazon Echo Bridge\data\elasticsearch\nodes\0\indices\device\0\index\_x.si
Y:\Amazon Echo Bridge\data\elasticsearch\nodes\0\indices\device\0\index\_x_es090_0.blm
Y:\Amazon Echo Bridge\data\elasticsearch\nodes\0\indices\device\0\index\_x_es090_0.doc
Y:\Amazon Echo Bridge\data\elasticsearch\nodes\0\indices\device\0\index\_x_es090_0.pos
Y:\Amazon Echo Bridge\data\elasticsearch\nodes\0\indices\device\0\index\_x_es090_0.tim
Y:\Amazon Echo Bridge\data\elasticsearch\nodes\0\indices\device\0\index\_x_es090_0.tip
Y:\Amazon Echo Bridge\data\elasticsearch\nodes\0\indices\device\0\index\_x_Lucene49_0.dvd
Y:\Amazon Echo Bridge\data\elasticsearch\nodes\0\indices\device\0\index\_x_Lucene49_0.dvm
Y:\Amazon Echo Bridge\data\elasticsearch\nodes\0\indices\device\0\translog\translog-1444242221935
Y:\Amazon Echo Bridge\data\elasticsearch\nodes\0\indices\device\0\_state\state-30
Y:\Amazon Echo Bridge\data\elasticsearch\nodes\0\indices\device\_state\state-3
Y:\Amazon Echo Bridge\data\elasticsearch\nodes\0\_state\global-15
Y:\Amazon Echo Bridge\generated-sources\annotations
Y:\Amazon Echo Bridge\generated-test-sources\test-annotations
Y:\Amazon Echo Bridge\maven-archiver\pom.properties
Y:\Amazon Echo Bridge\maven-status\maven-compiler-plugin
Y:\Amazon Echo Bridge\maven-status\maven-compiler-plugin\compile
Y:\Amazon Echo Bridge\maven-status\maven-compiler-plugin\testCompile
Y:\Amazon Echo Bridge\maven-status\maven-compiler-plugin\compile\default-compile
Y:\Amazon Echo Bridge\maven-status\maven-compiler-plugin\compile\default-compile\createdFiles.lst
Y:\Amazon Echo Bridge\maven-status\maven-compiler-plugin\compile\default-compile\inputFiles.lst
Y:\Amazon Echo Bridge\maven-status\maven-compiler-plugin\testCompile\default-testCompile
Y:\Amazon Echo Bridge\maven-status\maven-compiler-plugin\testCompile\default-testCompile\createdFiles.lst
Y:\Amazon Echo Bridge\maven-status\maven-compiler-plugin\testCompile\default-testCompile\inputFiles.lst
Y:\Amazon Echo Bridge\surefire-reports\demo.DemoApplicationTests.txt
Y:\Amazon Echo Bridge\surefire-reports\TEST-demo.DemoApplicationTests.xml
Y:\Amazon Echo Bridge\test-classes\demo
Y:\Amazon Echo Bridge\test-classes\demo\DemoApplicationTests.class

Re: HouseBot and Amazon Echo

Posted: Sun Jan 03, 2016 6:06 pm
by Steve Horn
Gad, what a mess. Thanks!

Re: HouseBot and Amazon Echo

Posted: Sun Jan 03, 2016 7:07 pm
by ScottBot
yeah. I'd start with just creating the data paths.

Re: HouseBot and Amazon Echo

Posted: Tue Mar 01, 2016 10:44 pm
by edgar
Hi all,

I hope everyone is well!

I pulled the string and should have my echo arriving soon. I wanted to report out that the java program that functions as a HUE bridge emulator (previously described by Steve) has an updated version (2.1) that is quite decent for registering and saving devices.

Steve posted the link: https://github.com/armzilla/amazon-echo ... e/releases

Version 2.1 saves all your devices and even allows for editing them (works well). I used an earlier version the first time and I had lots of trouble with it (Could be the same version Steve was having issues with).

I have the emulator running and about 12 devices loaded and set up to direct information to the Eventghost Webserver plugin. The events created by the emulator are received by the Eventghost Webserver. These events trigger macros in Eventghost using the Eventghost - HB plugin (also upgraded and now supports opening/closing of remotes and some other things!) which was a nice move away from my python scripts.

I will let everyone know how it works. (The test buttons on the emulator work so far). The Hue bridge does have limitations. Its nice that we have a fairly simple hackable interface to Echo, but the Hue bridge only does Turn On/Off and Dim right now. (not sure we will see a Open/Close action from Hue any time soon).

If all works as planned it will take about 5 minutes to set things up....and I think all I have to say is:

Alexa, Discover My Devices

then

Alexa, Turn on the Den Light..fingers crossed...not betting the farm :)

-Kevin