Jump to content

Amazon Echo and ISY


madmartian

Recommended Posts

Posted (edited)

I have run into a minor snag and perhaps someone with more Linux smarts than I have can help me.

 

I have the Hue emulator running on a RPi, in fact I have 2 of them so running but only have loaded data into one of them. To ensure the emulator is running on a reboot of the RPi I added the following into the RC.local full that is run every time the system starts up (as instructed in the excellent installation doc referenced in post 1 of this thread.

 

  nohup java -jar < full path address of the jar> --upnp.config.address=192.168.1.81 > /dev/null 2>&1 & which works.

 

If I do a ps -ef | grep java I get the correct line displayed which shows the correct IP address.

 

Now I would like to get the startup entry above to be IP address independent so if for example the DHCP address changes it will adjust to that at next reboot.  I changed the --upnp.config.address=192.168.1.81 (that is the address of the RPi) to 

--upnp.config.address="$_IP" where "#_IP"  as shown by a prior line in the script (printf "My IP address is %s\n" "$_IP" to be the machines current IP address.  If I then do a ps -ef | grep java I get the same line as before. HOWEVER the Echo no longer seems to find the emulator and reports zero devices discovered. My Proxy app finds all of the emulators, and retrieves there data no matter which version of the jar startup line I use.

 

It is not a serious issue as I can just use a DHCP reservation and the hard coded address, but it bothers me why it doesn't work

 

Any thoughts or explanations would be appreciated.  My goal is to make an SD image that I can share and that requires no work, or at least a minimal amount of work to finalize on a RPi. The image appears to be working and includes the tinyvncserver so all the work can be done using a PC and the RPi run headless.

 

Any assistance/advice greatly appreciated.

Barry,

 

I think you can just use:

--upnp.config.address=$_IP

 

don't use the quotes.

 

That syntax is used in some shell scripts I have where a string is being passed with a command, or in your case loading the emulator.

 

-Don

Edited by TheWizard
Posted

Thanks, That appears to work.

 

Now to my next issue.

 

I am not having any problems with the current hub other than it 28 device limit.

 

It seems a new version of the hub has been developed that removes/eliminates the 28 device restriction.  I have that loaded on an RPi and am playing with it. Everything works fine until I tell the echo to do something such as "Alexa, turn on the desk light". If the data is on the old hub version Alexa has no problem.  If the data is on the new version of the Hub Alexa states that the device is not responding and to check connections . . .

 

Has anybody else tried the new hub version with success.  the new hub can be found at www.bwssytems.com.  I am going to try and contact them next  

Posted

 

It seems a new version of the hub has been developed that removes/eliminates the 28 device restriction.  I have that loaded on an RPi and am playing with it. Everything works fine until I tell the echo to do something such as "Alexa, turn on the desk light". If the data is on the old hub version Alexa has no problem.  If the data is on the new version of the Hub Alexa states that the device is not responding and to check connections . . .

 

Has anybody else tried the new hub version with success.  the new hub can be found at www.bwssytems.com.  I am going to try and contact them next  

 

Well, I ran up against a few issues with the new emulator (ha-bridge-0.3.5.jar), but I've been able to reach a new limit of 43 devices using a single RPi2 - still not the holy grail of 50 devices per hub (according to Amazon), but better than 28. The device database is also easier to manage since everything is in a single file (device.db).

 

If you're having issues with Alexa discovering devices (like I did at first), try these tips:

 

   1) Add "-Dupnp.config.address=192.168.x.x" to the command line invoking the JAR file, where 192.168.x.x is the IP of your RPi2 (or PC).

       You should see the correct upnp.config.address when running the configurator at 192.168.x.x:8080.

 

   2) I found when making any changes or additions to the device list in the HA Bridge configurator, the Echo would fail to discover ANY connected devices unless I rebooted the RPi2 and then repeated discovery on the Echo. It's a pain, but I added a crontab entry to automatically restart the HA Bridge when rebooting so it's just part of the process now :?

 

 Hope this helps.

I've got my Echo controlling about 30 lighting scenes, three thermostats, multiple media components in our home theater, and handling home control queries (announced over the house intercom).

Posted

Interesting. My situation is a little different, but thanks for the advice. 

 

I always do a forget all prior to a discover devices.  I am running with several RPI's and my configurator can be told which bridge to put the command on. Two of the bridges (1 and 2) are running the older emulator, the third the new emulator. If I put the device on RPi 1 or RPi 2 it runs fine. If I put it on RPi 3 it always fails with Alexa stating "The network device XXXXX is not responding, please check its network connection and power supply".  In my experience this reply happens when Alexa does not get a response from the device for the command that was issued, except Alexa should not be talking to the emulator but rather to the end device that is set up in the on and off URLs.  Or am I missing something.  The other interesting point is that I can not discover the new bridge.  I am using version 0.3.3 and will move to 0.3.5 later today.  That may be the crux of the issue if Alexa cannot discover the new bridge.  I use the RC.local file to set up the bridge. In my RC.local file there is a line that pulls the current IP of the bridge and sets it as a bash variable named _IP.  It then does a -Dupnp.config.addresss=$_IP which has the advantage of allowing the IP address to be reset on a boot. I have tried it with the fixed address as in -Dupnp.config.address=192.168.1.83.  But I have not tried version 0.3.5. Brad indicated he did some cleanup of the upnp logic in 0.3.5.  What bothers me is that alexa should not care about the hub once it is configured with the on and off URL's or does it always go to the hub when it sends a command and the hub then sends the URL on. If that is the case and Alexa can't find the hub, then that explains it all and hopefully 0.3.5 solves my problem.

Posted

Hi Guys,  I have no idea what y'all are taking about with all of this.  Will there eventually be something that a non programmer/code will be able to use with my ISY and Echo, or do I have to try to figure out what you are doing?

Posted

Hi Guys, I have no idea what y'all are taking about with all of this. Will there eventually be something that a non programmer/code will be able to use with my ISY and Echo, or do I have to try to figure out what you are doing?

UDI is working on an interface that uses their new portal.

 

Sent from my Nexus 7 using Tapatalk

Posted

Hi Guys, I have no idea what y'all are taking about with all of this. Will there eventually be something that a non programmer/code will be able to use with my ISY and Echo, or do I have to try to figure out what you are doing?

Yes, it does seem quite convoluted and egg headed. However, what we are witnessing is the evolution of a new format with which to control our HA through the isy. Hopefully.

As you read through, as did I, you realize that this topic discussion are for the much more, shall we say, dexterous when it comes to programming and coding. I read and watch and sometimes get a chuckle, but I pretty much watch and try to learn. Once it progresses to a certain tipping point, then code will already be there along with pre-developed uses and parameters. I'm not going to pull my hair out needlessly. Neither should you.

As the old saying goes,

"ACHTUNG!

ALLES TURISTEN UND NONTEKNISCHEN LOOKENPEEPERS!

DAS KOMPUTERMASCHINE IST NICHT FÜR DER GEFINGERPOKEN UND MITTENGRABEN! ODERWISE IST EASY TO SCHNAPPEN DER SPRINGENWERK, BLOWENFUSEN UND POPPENCORKEN MIT SPITZENSPARKEN.

IST NICHT FÜR GEWERKEN BEI DUMMKOPFEN. DER RUBBERNECKEN SIGHTSEEREN KEEPEN DAS COTTONPICKEN HÄNDER IN DAS POCKETS MUSS.

ZO RELAXEN UND WATSCHEN DER ZO RELAXEN UND WATSCHEN DER BLINKENLICHTEN."!!

 

 

 

GT

Posted (edited)

With regard to the new emulator, I have gotten further and will probably have it all cleaned up tomorrow.  The issue was that I do a uPnP search and checked the notify response to see if it was a Hue bridge emulator.  The new version of the emulator did not identify itself as such so I disregarded it.  The same may be true of the Amazon echo when it searches for hubs and bridges when it powers up.. 

Edited by barrygordon
Posted (edited)

Yes, it does seem quite convoluted and egg headed. However, what we are witnessing is the evolution of a new format with which to control our HA through the isy. Hopefully.

As you read through, as did I, you realize that this topic discussion are for the much more, shall we say, dexterous when it comes to programming and coding. I read and watch and sometimes get a chuckle, but I pretty much watch and try to learn. Once it progresses to a certain tipping point, then code will already be there along with pre-developed uses and parameters. I'm not going to pull my hair out needlessly. Neither should you.

 

 

Well said.

 

As with most emerging technologies, the "eggheads" share ideas to push ahead of what's commercially available and work out ways to get non-compatible devices talking to each other. Home automation is a huge, many-tentacled monster at the moment, with too many players in the market all pulling in different directions. Amazon has the right idea by encouraging us open source junkies to play. 8)

 

As Jimbo mentioned above, UDI is jumping in too. We all win.

Edited by mark-vo
Posted

Hi,

 

I would like to know if anyone got ha-bridge-0.3.5.jar working.  I got it all setup but the Echo says " Thieir is something wrong with the device, check your connections......." and you know the rest.  So the mapper V12 sees everything in working order and also the Web portal of the ha-bridge turns on and off all of the devices but still the Echo says it can not see the devices.  What I am doing wrong?

 

Thanks

rdavidowski

Posted

The new version 0.4.0 and is available now. I haven't tried it yet but I worked with the author to figure out what was wrong. I will be trying it shortly and posting all the info you will need. I just need to take a short break.

 

Basically the issue was authentication.  The ISY994 needs basic authentication. He was not supplying that.

 

Later on I will be installing 3 copies on 3 different RPi's Which should give me more than enough controls.  

 

The new version is out there now, http://www.bwssystems.com/files/ha-bridge-0.4.0.jar.

 

read the https://github.com/bwssytems/ha-bridge page for new options.

Posted (edited)

I have started using the new emulator which is referred to as the ha-bridge. It is version 0.4.0. I currently have 3 RPi's running this version of the bridge all in a wired configuration. I have my own configurator which is part of my ISY proxy server which I am still working on.  Bridge-1 has 37 devices, Bridge-2 has 30 devices and Bridge-3 has 4 devices for a total of 71. Alexa discovers them all and appears to have no issue dealing with them. Response times are very good, generally under 2 seconds for the action to complete (e.g. a light to turn on). I have two Echos running and even if they both hear the same command there appears to be no issues. I am "discussing" with the Amazon Echo development people the need to be able to know which Echo is talking for an Alexa skill so the skill application on the Echo has an id, and perhaps some day a libido. In that way the simple phrase "turn the lights off" can be made to apply to the room you/Echo is in

 

My configurator  handles the bridge in a manner similar to the Mapper application, but allows allows an Alexa command action to be directed to an external controller, i.e. not the ISY 994 by using a Custom URL for off and on which has the IP address of the proxy server application itself. the Proxy server can then act as a proxy for the other controllers. I use this for my Pool controller and my Home Theater.  The pool is controlled by an Autelis controller and the Theater by a PC that listens for commands after being woken with a WOL. All of the translation work is done by the proxy server and is for the most part table driven by a JSON description of the external controller and its commands.

 

The final activity on the Proxy server is to handle an "Alexa Skill" which allows for a much more flexible dialog between the speaker and Alexa. This is working in a minimal manner as I have not yet completed the vocabulary of phrases (utterances in Amazon speak) that Alexa will be driven by. Alexa does recognize the limited set I provided and speaks exactly what I tell her to say, not just "Okay".

 

The bridge has a complete configuration system built in as a web server at port 8080.  It is very well done and removes the need for any external systems for just dealing with anISY994

 

If you are not a Linux expert I strongly suggest you google and download a copy of WINSCP. It is an amazingly well crafted tool and is free.  It allows for easy file transfers between a linux machine and a windows machine using drag and drop logic with built in editing capability.  That is how I loaded the emulator into the RPi's after downloading them to windows. It is a superb piece of work and wish I found it a long time ago.

 

I have built my RPi systems starting with the NOOBS Image from the Raspberry Pi organization. I then selected the Raspian OS.  I added the tightvnc server system to the RPi. This provides complete remote control of the Graphical UI that Raspian provides. I have a tightvnc client on my main machine in my office. The RPi's run headless mounted on a wall with a power cable and a LAN connection, no keyboard, no monitor. I was going to install Samba but it is not really needed given WINSCP since I am not using the RPi's as anything but hosts for the Bridge's.  

 

To get tightvnc and the bridge to run after every boot, I modified the rc.local file located in /etc. Here is my copy of it:

 

 
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
 
echo "Running the RC.local Bash script"
 
# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
  printf "My IP address is %s\n" "$_IP"
fi
 
echo "Starting the Echo Bridge Emulator" 
nohup java -jar -Dvera.address=192.168.1.229 -Dupnp.config.address=$_IP /home/pi/echobridge/ha-bridge-0.4.0.jar > /home/pi/echobridge/log.txt  2>&1 &
 
echo "Starting the tightvncserver"
/etc/init.d/tightvncserver start
 
echo "The RC.local Bash script has completed"
 
exit 0
 
 

 

This file will automatically determine the RPi's IP address no matter how it got it (Static, DHCP, reservation. . .) and use that for the upnp address parameter that the bridge requires. I can freely move the SD cards around between the RPi's and have done so with no issues. It is my intent to make an image of the SD card (it will be a 16 Gig image as that is what I use in all my systems) and will make it available to those who want it via sendspace which is like dropbox. the only thing one might want to do is change the host name and the password. The host name is easy using the raspi-config tool. I don't worry about the passwords as these machines are not reachable from outside my LAN. 

 

It is really funny to see peoples expressions when I say "Alexa, turn off the Kitchen lights" or Alexa, turn on the Theater" and things just happening. I wish my wife was still around, she would get a big kick out of it.

Edited by barrygordon
Posted (edited)

@ Barry

 

Lots of familiar stuff in your setup, even though we've gone down independent paths. Thanks for mentioning tightvnc in an earlier post, it's been really helpful configuring my two RPi2s (now also running the latest version ha-bridge, which I've confirmed maxes out at 43 devices per instance).

 

My HA system has been evolving since 1985 (not a typo) and there is still a lot of legacy hardware running in the background (I was a hardware developer in a past life), including a custom SBC that manages the reflex lighting based on hardwired PIR sensors in every room. (My wife and I haven't touched a light switch in 30 years 8))

 

Besides the RPis, there are two Arduinos (with custom shields) that manage RFID tags and act as an Insteon command gateway for very fast programmed response, an ISY994i for REST scene control, three Harmony Hubs for a bunch of media components, one Echo (so far), three 15 inch in-wall touchscreens, a Davis weather station, two PCs running Win7 and Apache server, and 2 Asus routers connecting about 72 devices. Whew. My new full time job is keeping all this stuff running...

 

Anyway, like you mentioned, visitors to our house are always amazed, especially now with extensive voice controls. What fun.

Edited by mark-vo
Posted

Hi Barrygordon

 

I have setup ha-bridge 0.4.0 and now the echo is fully working. But I went and tried to rediscover with this new version my Harmony Hub and the harmony app presents the ha-bridge as a hue hub but when it tries to sync with it it fails. With the amazon-echo-bridge-0.2.1 it worked flawlessly. Do you know if this new versions of ha-bridge support syncing with harmony hub?

 

Thanks for any help with this.

Posted

Mark-vo,

 

We probably have gone down different paths since my main interest is software and not hardware. When I started I was an electrical engineer with a hardware outlook, but my first job  was as a programmer in 1960 so I quickly drifted to the dark side.  I live to code.  I was one of the test engineers for the original GPS system (circa 1963) installed aboard the SSBN George Washington. That system cost $3,000,000 and was in two large cabinets each one by measuring 2x2x5 in feet not inches.

 

I am very interested in what you have done with RFID tags.  I have not had much success with them. Could you follow up via email? I own the domain the-gordons.net and my name is barry so the email address should be obvious.

Posted

This is excellent. I initially tried ha-bridge-0.4.0.jar without success but once I added  "-Dupnp.strict=false" option, all my devices were discovered. The GREAT news is that I do have 37 devices connected to Alexa! Yay!

Posted (edited)

Hi,

 

Thanks for the tips, I got everything working that's related to the Echo. But even adding  "-Dupnp.strict=false" to the startup script didn't help with the Harmony App recognizing the ha-bridge.0.4.0.jar as a Hue hub.  It sees it when it scans but when it tries to pair with it it just does not work. So I am running a second instance of the bridge but with the old version amazon-echo-bridge.0.2.1.jar, only with the devices that I want to control with the Harmony Hub. But this means that I have another device to wory about, it will be neat if it all work on the new version.  If anyone else has dealt with this and point me in the right direction I would greatly appreciate it. Thanks

Edited by rdavidowski
Posted (edited)

The author is working on this and has issued several newer versions (he is at 0.4.2) .  I suggest you upgrade to see if he has solved the Harmony problem, as I don't have a harmony device. Check his wen site (http://www.bwssystems.com) and check the MiCasaVerde board where a lot of people are trying to get the harmony working with the bridge   http://forum.micasaverde.com/index.php?topic=31920.new;topicseen#new.

 

The latest version is at     http://www.bwssystems.com/files/ha-bridge-0.4.2.jar

 

Also the information about some new settings is at: https://github.com/bwssystems/ha-bridge

 

I am currently working with the author on dimming for the ISY994  I have it currently working with a small external app running on a 24/7 PC. It handles other things in my house like my pool.  I can now say  "Alexa, turn on the SPA.

Edited by barrygordon
Posted (edited)

Hi,

 

Thanks for the tips, I got everything working that's related to the Echo. But even adding  "-Dupnp.strict=false" to the startup script didn't help with the Harmony App recognizing the ha-bridge.0.4.0.jar as a Hue hub.  It sees it when it scans but when it tries to pair with it it just does not work. So I am running a second instance of the bridge but with the old version amazon-echo-bridge.0.2.1.jar, only with the devices that I want to control with the Harmony Hub. But this means that I have another device to wory about, it will be neat if it all work on the new version.  If anyone else has dealt with this and point me in the right direction I would greatly appreciate it. Thanks

 

Same issue here and the latest version released today (0.4.2) still doesn't work with Harmony according to a follow-up post on the MiCasaVerde forum. I'll wait a bit longer for the developer to track down the issue. In the meantime, here's what I discovered after some tinkering with version 0.4.1 yesterday.

 

I have 3 Harmony hubs and found that they worked with the ha-bridge (even after adding or editing devices) until I forced a "re-Pair" on one of the hubs at which point discovery would hang and that particular hub reported all the devices as not working. No amount of re-Pairing would fix it, even after removing the Hue device or rebooting the Harmony hub. And yet, oddly, the other two Harmony hubs continued to work with all the same devices. It seems the Harmony cannot initially pair with the ha-bridge, but will discover existing ha-bridge devices just fine if the hub previously paired with the amazon-echo-bridge at the same IP address.

 

What I did to recover the "broken" Harmony hub was to temporarily reboot the RPi with amazon-echo-bridge (version 0.2.0), re-Pair the Harmony hub (it quickly discovered the older set of devices), and then reboot again with the ha-bridge. Voila, the latest device list re-appeared. It's less complicated than it sounds since I keep both emulators listed in crontab and simply comment out the one I don't want to run at boot.

Edited by mark-vo
Posted

The author is working on this and has issued several newer versions (he is at 0.4.2) .  I suggest you upgrade to see if he has solved the Harmony problem, as I don't have a harmony device. Check his wen site (http://www.bwssystems.com) and check the MiCasaVerde board where a lot of people are trying to get the harmony working with the bridge   http://forum.micasaverde.com/index.php?topic=31920.new;topicseen#new.

 

The latest version is at     http://www.bwssystems.com/files/ha-bridge-0.4.2.jar

 

Also the information about some new settings is at: https://github.com/bwssystems/ha-bridge

 

I am currently working with the author on dimming for the ISY994  I have it currently working with a small external app running on a 24/7 PC. It handles other things in my house like my pool.  I can now say  "Alexa, turn on the SPA.

 

Hi Barry

 

I also have a Windows machine running 24/7. Can you let me in on the dimming function for the ISY994.  If you want I can beta test for you.  With dimming added to the mix this would be a 100% working solution for my needs.

Posted

The problem with the dimming function seems to be with the Echo not the bridge. Commands from the echo to the bridge do not reflect what was uttered by the speaker. I understand how the bridge deals with the code.  If you turn on all debugging in the bridge then you can see what the bridge gets from the echo and what it sends to the endpoint, the ISY994 in my case. The Bridge is sending what it gets.  I will get back to you later on this forum a I am am running late for an appointment.

 

This is what I basically use in my rc.local to turn on full debugging and see what is going on in the bridge:

 

nohup java -jar -Dvera.address=192.168.1.229 -Dupnp.config.address=192.168.1.83 -Dorg.slf4j.simpleLogger.defaultLogLevel=DEBUG /home/pi/echobridge/ha-bridge-0.3.5.jar > /home/pi/echobridge/log.txt 2>&1 &

 

You can do the same and should be able to see what is happening.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing

    • No registered users viewing this page.
  • Who's Online (See full list)

  • Forum Statistics

    • Total Topics
      37.2k
    • Total Posts
      372.4k
×
×
  • Create New...