Bridge Amazon Echo to Vera, on github!

Hey, the Echo to me is a ‘toy’ I don’t really need anymore now that I use SmartAbode on my LG G watch mostly to control Vera if needed. My HA budget for the next 3 months has already been spent…

BTW, your HA budget must be a lot higher than mine judging from your collection… :wink: Envious look at the Hue stuff.

Vera3 (1); Nest Protect CO (5), Cameras (6), Alarms (2), Hue Bulbs & Strips (39), Fan Dimmer (6), 4-in-1 Humidity (10), Nest Humidity (1), 4-in-1 Light (10), Water Sensor (2), 4-in-1 Motion (11), Switches (20), Minimotes (3), Nest Smoke (5), 4-in-1 Temp (10), Nest Thermostat (1), HEM Gen2 (2)

I got in on the $99 Echo pre sale, but I’d pay $179.99 for it, the amazon-echo-bridge has alone made it worth the purchase for me.

For me and my family the voice recognition has been spot on, even for my 6 and 9 year old boys. Who love asking Alexa all kinds of questions.

We use the shopping list for groceries all the time, it’s so nice to say, “Alexa, I need more milk” in the moment and it’s added to the list. I always used to say, “what was it I wanted to add to the shopping list???” after forgetting just minutes after thinking of adding something.

We use it as a music player in the kitchen all the time as well. My family enjoys music more than the boobtube, and it’s so nice to just say what you want to listen to.

Timers and alarms not so much, but the weather and news is also a great feature on demand.

BTW, I’ve been a lurker here for a few months and really appreciate the kind and open nature on this forum - you all are great. I also absolutely appreciate the amazon-echo-bridge written by arm (and others who contributed - especially the configurator). I’m running my bridge on an RPi B+, but interfacing it with my X10 setup that is controlled through an Apache server on the same RPi, I just posted my how-to here.

[quote=“Roveer, post:403, topic:187039”]I set up my Echo on Sunday and went right into getting this bridge running. I wanted to run on my Raspberry pi. Setup wasn’t that difficult but on the Pi the Echo was never able to “discover” any new devices. I tried a dozen or more times. I ran the bridge on my windows PC, turned off the firewall and the echo discovered the 3 devices I put into the web gui.

Any ideas on what is preventing my Pi from allowing Echo from discovering devices? I’d really like to use my Rpi for this purpose.

Roveer[/quote]

did you ever get an answer or figure out what’s causing the issue?

I also can not get the Echo to discover any devices if I have > 28 devices setup on the bridge[/quote]

I tried running a second server on a different computer and the Echo picked up devices from both and the total was over 28. When I get some time I will try setting up a VM on the computer hosting the main bridge to host a second one.

I have spent countless hours on this and I get the configurator run on the PI, but the ECHO just cannot find any devices. I made sure that they are both on the same 2.4GHZ network, but I cannot configure wifi on the PI, it is connected via Ethernet cable.

What am I doing wrong??

[quote=“nagyg, post:445, topic:187039”]I have spent countless hours on this and I get the configurator run on the PI, but the ECHO just cannot find any devices. I made sure that they are both on the same 2.4GHZ network, but I cannot configure wifi on the PI, it is connected via Ethernet cable.

What am I doing wrong??[/quote]

It might help to know what you’ve done so far.

What OS are you running on your RPi?
What version of Java?
Which bridge jar file version are you running?
Are you running as “root”?

etc.

When you say they are both on the same 2.4Ghz network, I’m confused. You also say your Rpi is hard wired to your network.

[quote=“nagyg, post:445, topic:187039”]I have spent countless hours on this and I get the configurator run on the PI, but the ECHO just cannot find any devices. I made sure that they are both on the same 2.4GHZ network, but I cannot configure wifi on the PI, it is connected via Ethernet cable.

What am I doing wrong??[/quote]

Also make sure your router has UpNp ability, and that it is enabled.

[quote=“hmspain, post:446, topic:187039”][quote=“nagyg, post:445, topic:187039”]I have spent countless hours on this and I get the configurator run on the PI, but the ECHO just cannot find any devices. I made sure that they are both on the same 2.4GHZ network, but I cannot configure wifi on the PI, it is connected via Ethernet cable.

What am I doing wrong??[/quote]

It might help to know what you’ve done so far.

What OS are you running on your RPi?
What version of Java?
Which bridge jar file version are you running?
Are you running as “root”?

etc.

When you say they are both on the same 2.4Ghz network, I’m confused. You also say your Rpi is hard wired to your network.[/quote]

Well, this is way over my head, but it turned out that the the 2 dashes before the UPNP are important :stuck_out_tongue: . Also, my Echo would not update and I installed a new one that now recognizes the devices. I will have to wait until I return to Vienna, where the VERA resides, to see if this is working …

At least you figured it out :slight_smile:

I also can not get the Echo to discover any devices if I have > 28 devices setup on the bridge[/quote]

I also have the same problem. I wonder if it’s a problem with the bridge or if it’s on the Echo side.

You can get more another 28 by running a server on a different device. I have two servers running, one each on 2 separate windows computers and have 56 devices controlled

[quote=“hmspain, post:324, topic:187039”][size=18pt]Running the amazon-echo-bridge on a Raspberry Pi[/size]

First of all, why a Raspberry Pi (RPi)? The answer is simple, they are cheap, reliable, and run on a handful of watts so you can keep your RPi running all day, no worries.

How does it work? The Amazon Echo already supports the Hue Bridge. The Hue Bridge is that white hockey puck device with some LEDs and a big button in the middle that talks ZigBee to Hue LED bulbs/strips. Don?t worry, you don?t need a Hue bridge or Hue bulbs/strips to get this to work.

The trick is to make your Raspberry Pi perform like a Hue Bridge. It really is a Hue Bridge Emulator when all is said and done. Instead of turning on and off Hue bulbs, you will be turning on and off devices/scenes ON YOUR VERA! You can control scenes just like your devices, although saying “Alexa, turn on ” can use a little creativity when you name things in configurator. I’ll go over configurator once you have your Hue Bridge Emulator up and running.

Hardware needed:

  1. Raspberry Pi board
  2. Raspberry Pi power supply
  3. MicroSD card
  4. Raspberry Pi case (optional)
  5. Ethernet cable
  6. Open Ethernet port; on your router, or hub connected to your router
  7. USB Keyboard (temporary)
  8. USB Mouse (temporary)
  9. HDMI cable (temporary)

Software needed:

  1. Amazon-echo-bridge-x-x-x.jar (I used 0.1.3)
  2. Java V8 for Debian or the OS you are using

OK, let’s get started. Where can I buy this hardware?

If you just want the board (item 1):

Here is a nice kit ($70) from Amazon (items 1,2,3,4,9):

or

http://www.amazon.com/Adapter--20-Guide--Clear-Case--Power-Supply--Kingston-Adapter--HDMI/dp/B00MV6TAJI/ref=sr_1_5?s=pc&ie=UTF8&qid=1436319177&sr=1-5&keywords=raspberry+pi

NOTE: I would hard wire the RPi (Ethernet) to your router, and not try to get the WiFi adapter up and running. There are reports of delays when trying to use WiFi, and no need to risk it. Just put your RPi next to your router.

I built my Raspberry with Debian, but the preloaded NOOBS OS may work just fine as long as Java V8 loads on it.

If all fails with the NOOBS operating system, you can always re-flash the MicroSD with Debian. You can use UNetbootin Universal Netboot Installer and flash Debian to the MicroSD.

I had a spare USB keyboard and mouse, and you can always borrow these from your PC or Mac. Once you get your RPi up and running, you can use putty to SSH into the operating system eliminating the need for a mouse or keyboard.

Log into your RPi (you will more than likely want to connect it to your TV and use your mouse and keyboard). Set the root password to something simple.

[size=14pt]Installing Java V8[/size]

Make sure to login using “root”. It just keeps things easy, and ISIS is not looking to hack into your RPi.

Once logged in, assuming you are ?up on the net? (i.e. your RPi has pulled an IP address DHCP from your router), you can issue the following commands:

su -
echo “deb Index of /webupd8team/java/ubuntu trusty main” | tee /etc/apt/sources.list.d/webupd8team-java.list
echo “deb-src Index of /webupd8team/java/ubuntu trusty main” | tee -a /etc/apt/sources.list.d/webupd8team-java.list
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886
apt-get update
apt-get install oracle-java8-installer
exit

NOTE: This works for Debian. If you are not running Debian, research the command(s) for your specific version of Linux running on your RPi. I was told there are easier ways, but these commands worked for me. The ?su ?? is most likely not needed since you are logged in as root. The next two echo commands can be omitted. I suspect only the two apt-get commands are needed.

If you don?t know what OS you are running, you can type:

uname -a

If Java successfully installs, you can type:

java -version

A response from Java says you are good to go!

[size=14pt]Loading the jar file on your RPi[/size]

There are several ways to get the jar file on your RPi. I decided to copy the jar file from github (Releases · armzilla/amazon-echo-ha-bridge · GitHub) to a flash drive on my PC, and then plug in the flash drive on my RPi and copy the file. Simple right? No so fast. Format the USB FAT32 with a label of ECHO (keeping it simple). Copy the jar file from github to the flash drive. Move the flash drive to your RPi.

df ?h

will show you the device location (in my case /media/ECHO).

mkdir /usr/local/echobridge
cp /media/ECHO/amazon-echo-bridge-0.1.3.jar /usr/local/echobridge

At this point, you can simply run the jar file using Java, but we want to make sure things are done ?right?, so:

vi /usr/local/echobridge/echobridge.sh

Put the following ONE LINE in the file (use ?I? to insert, and esc :wq! To save and exit);

java -jar -Djava.net.preferIPv4Stack=true /usr/local/echobridge/amazon-echo-bridge-0.1.3.jar --upnp.config.address=192.168.1.125 > /usr/local/echobridge/echobridge.log

Notice that 192.168.1.125? That’s the IP address of the RPi. If you don?t know what the RPi IP address is, use the command:

netstat

Look for “Local Address” at the top.

Next, create an echobridge_daemon.sh file (vi /usr/local/echobridge/echobridge_daemon.sh), and add the following line:

/usr/local/echobridge/echobridge.sh &

NOTE: That “&” is used to run the java process in the background.

[size=14pt]To make sure the java process restarts when your RPi reboots[/size]

crontab -e

(at the top of the file add the line)

@reboot java -jar -Djava.net.preferIPv4Stack=true /usr/local/echobridge/amazon-echo-bridge-0.1.3.jar --upnp.config.address=192.168.1.125 > /usr/local/echobridge/echobridge.log

NOTE: Make sure to change the IP address to your specific RPi IP address.

[size=12pt]Starting the Amazon Echo Bridge process for the first time[/size]

/usr/local/echobridge/echobridge_daemon.sh
ps -ef | grep echo
tail -f /usr/local/echobridge/echobridge.log

The “ps” and “tail” commands let you watch the magic (if you want). It helps to know how long the bridge takes to come up so you don?t start thinking something is wrong.

[size=14pt]Configuring the Amazon Echo Bridge[/size]

From your browser (I used Chrome) use this URL (note the IP address of your RPi, yours will most likely be different);

http://192.168.1.125:8080/configurator.html

This should display the configurator allowing you to add devices/scenes.

Change the “Bridge server” to the IP address of your RPi. In my case;

http://192.168.1.125:8080/api/devices

Pick a name for your device/scene (don?t worry, you can delete and re-add them if you find the name does not work, or is reserved somehow).

Put the IP address of your VERA SERVER in the “Vera Server” field URL. This worked for me “http://192.168.1.91:3480”. If you know the device number, enter that in the ?Device ID? field, and press “Generate URLs”. This is the syntax for turning ON and turning OFF your device. Click “Add Device”.

IMPORTANT: When you add or remove devices/scenes using configurator, make sure to tell Alexa to ?Discover Devices? ? it?s the fun part ;-).

If you want to add a scene, use the following syntax manually (the example uses scene 356); don?t use the “Generate URLs” button;

http://192.168.1.91:3480/data_request?id=action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=RunScene&SceneNum=356

Add devices/scenes, test the ON and OFF buttons, delete things that don?t work, until you get everything ?right?; enjoy.

NOTE: Sometimes the configurator will not display your devices. Be patient. It make take a few tries to get it to display. Sometimes I add a bogus device “xxxyyy” and when the devices display, I simply remove “xxxyyy” and go about my work. Sometimes that does not work, but a few refreshes later, the devices suddenly appear. I?m not sure the trick, but don?t give up, it will display.

Enjoy talking to your Amazon Echo, turning on/off various devices, and running any scene. This is what home automation looks like circa 2015.

Harrison Spain
hmspain@gmail.com[/quote]

Did all that - except everything is in /home/pi/echobridge/ folder, as I started out with the instructions from here: http://www.airedalez.net/?p=263&cpage=1#comment-824

When I try Starting the Amazon Echo Bridge process for the first time

/homw/pi/echobridge/echobridge_daemon.sh
ps -ef | grep echo
tail -f /usr/local/echobridge/echobridge.log

I get a Permission denied response …

started from scratch and used the same directories (/usr/local/…), still: bash: /usr/local/echobridge/echobridge_daemon.sh: Permission denied

??

[quote=“nagyg, post:453, topic:187039”]started from scratch and used the same directories (/usr/local/…), still: bash: /usr/local/echobridge/echobridge_daemon.sh: Permission denied

??[/quote]

The only way you get that is by not logging in as “root”? Oh, and make sure to:

chmod 777 /usr/local/echobridge/echobridge_daemon.sh

I did the chmod 775 … I apologize for what is probably a very stupid question: How do I not login as “root”? I logged in with pi/raspberry …

starting again from cratch ::slight_smile: did the chmod 777 and when I now enter echobridge_daemon.sh there are no longer permission errors, but just nothing happens …

The chmod 777 allows you to execute the echobridge.sh script. You should still be able to execute the jar file manually and see results. Assuming you have Java 1.8 loaded (java -version should show you build 1.8.0_xxxx) and are logged in as root, what does:

java -jar -Djava.net.preferIPv4Stack=true /usr/local/echobridge/amazon-echo-bridge-0.1.3.jar --upnp.config.address=192.168.1.125

display? (replace the 192.168.1.125 with the IP address of your BRIDGE, not the Vera).

if I hear that “no devices found” again, I’m going to throw something out the window. Not the Echo thought.

I have java installed, ran the java script. Can set up devices, can see that they are configured. they test fine. but when I go to discover devices nothing.

So I got another PC, installed a fresh WIN7 64 bit, did all the same things, all seemed good, but still get that no devices found.

I have turned off the windows firewall, turned off the Asus router firewall, put the PC in the DMZ same thing. I checked the ports 8080,1900. 50000. the router has UPNP enabled.

any ideas??? I don’t know what else to try…

Even gave my raspberry pi , model b, a shot, I have never done anything with it. I got pretty frustrated even trying, be nice is someone had a zip file poste that could just be put on a SD card for the pi all configured, and only would have to adjust for the IP

OK HELP PLEASE. I want this functionality so bad

[quote=“509eagle, post:458, topic:187039”]if I hear that “no devices found” again, I’m going to throw something out the window. Not the Echo thought.

I have java installed, ran the java script. Can set up devices, can see that they are configured. they test fine. but when I go to discover devices nothing.

So I got another PC, installed a fresh WIN7 64 bit, did all the same things, all seemed good, but still get that no devices found.

I have turned off the windows firewall, turned off the Asus router firewall, put the PC in the DMZ same thing. I checked the ports 8080,1900. 50000. the router has UPNP enabled.

any ideas??? I don’t know what else to try…

Even gave my raspberry pi , model b, a shot, I have never done anything with it. I got pretty frustrated even trying, be nice is someone had a zip file poste that could just be put on a SD card for the pi all configured, and only would have to adjust for the IP

OK HELP PLEASE. I want this functionality so bad[/quote]

The Echo is looking for a Hue Bridge (got one of those?). If you had a Hue Bridge, we could debug that without getting the emulator into the mix. The Echo can find multiple Hue bridges, the emulator is just another one. This sniffs like a network routing problem (that may be an obvious statement).

You want to get your emulator as close to the Amazon Echo as you can. Since the Echo connects wirelessly to your router, you want to physically plug in the emulator TO THE ROUTER to reduce the number of failure points.

What is the IP address of your Echo?
What is the IP address of your router (that the Echo connects to)?
What is the IP address of your emulator?

[quote=“hmspain”][quote=“509eagle, post:458, topic:187039”]if I hear that “no devices found” again, I’m going to throw something out the window. Not the Echo thought.

I have java installed, ran the java script. Can set up devices, can see that they are configured. they test fine. but when I go to discover devices nothing.

So I got another PC, installed a fresh WIN7 64 bit, did all the same things, all seemed good, but still get that no devices found.

I have turned off the windows firewall, turned off the Asus router firewall, put the PC in the DMZ same thing. I checked the ports 8080,1900. 50000. the router has UPNP enabled.

any ideas??? I don’t know what else to try…

Even gave my raspberry pi , model b, a shot, I have never done anything with it. I got pretty frustrated even trying, be nice is someone had a zip file poste that could just be put on a SD card for the pi all configured, and only would have to adjust for the IP

OK HELP PLEASE. I want this functionality so bad[/quote]

The Echo is looking for a Hue Bridge (got one of those?). If you had a Hue Bridge, we could debug that without getting the emulator into the mix. The Echo can find multiple Hue bridges, the emulator is just another one. This sniffs like a network routing problem (that may be an obvious statement).

You want to get your emulator as close to the Amazon Echo as you can. Since the Echo connects wirelessly to your router, you want to physically plug in the emulator TO THE ROUTER to reduce the number of failure points.

What is the IP address of your Echo?
What is the IP address of your router (that the Echo connects to)?
What is the IP address of your emulator?[/quote]

This is just a shot in the dark but the same thing was happening to me when I first started using it. What I found was there was an error in the command to get the bridge running. There was an extra space. So look through the command very carefully. Also, make sure the command has the correct version that you are using, ie. 0.2.0, etc…