Bridge Amazon Echo to Vera, on github!

Try without the >log.txt.( that is for windows) Also make sure it is your server’s IP not 192.168.0.x.

Also what version of Java are you using?

[quote=“EOppie, post:20, topic:187039”]Hey guys, trying to get this running on my Synology NAS…but this is a bit over my head.

Here is the error I got:

SERVE-E> java -jar -Djava.net.preferIPv4Stack=true amazon-echo-bridge-0.1.0.jar --logging.level.com.a
rmzilla.ha.upnp=DEBUG --logging.file=ha.log --upnp.config.address=192.168.0.X >log.txt
Exception in thread “main” java.lang.UnsupportedClassVersionError: com/armzilla/ha/SpringbootEntry : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at org.springframework.boot.loader.LaunchedURLClassLoader.doLoadClass(LaunchedURLClassLoader.java:163)
at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:136)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:46)
at java.lang.Thread.run(Thread.java:745)[/quote]

That is a java version issue. The target language level is java8 and you will have problems running it if you cannot upgrade the java version on your NAS to java8. Can you run java -version and see what the version is?

Would this setup also work to bridge the harmony remote through the Phillips hue emulator? I’d love to control vera from my harmony remote.

Thanks everyone for the awesome help!

I followed the instructions here: Java SE Embedded package for Synology NAS | PC LOAD LETTER

and I believe I updated Java to the newer version.

Of course, I now think something else is messed up:

SERVE-E> java -jar -Djava.net.preferIPv4Stack=true amazon-echo-bridge-0.1.0.jar --logging.level.com.a
rmzilla.ha.upnp=DEBUG --logging.file=ha.log --upnp.config.address=192.168.0.161
-ash: java: not found

Did I screw up Java?

Where do we put the File and do we do anything with it after we download it?

I’m getting the following error.

C:\Windows\system32>java -jar -Djava.net.preferIPv4Stack=true amazon-echo-bridge
-0.1.0.jar --logging.level.com.armzilla.ha.upnp=DEBUG --logging.file=ha.log --up
np.config.address=192.168.1.100 >log.txt
Error: Unable to access jarfile amazon-echo-bridge-0.1.0.jar

EDIT: I got past that part buy just running the file. I can check the browser and I get the info on my light.

I’m currently stuck on getting Echo to “DISCOVER” my deivces. Keeps saying shes not finding it. Firewall off I checked shit “run netstat -ano | find “8080”, netstat -ano | find “1900”, netstat -ano | find “50000”.” and stoped a few things till it was clear, then ran the java and still no luck yet.

Hello all - I’ve also got this up and running on Windows, and I’m also trying to get it running on my Synology NAS - but it looks like Synology only works up to Java 7, so I’ve put that on hold for the time being.

I’m able to get the Echo to turn a light on/off by saying “Alexa turn off office light” - it works great. However, after the light changes state, the top LED spins for about 10 seconds and then the Echo responds “Sorry, but I’m unable to reach the device”. Is this something wrong in my config?

I created a “light switch” for my “kitchen light” and another called “sonos” and a third called “audio”. The last two call the same scenes that turn my sonos on or off.

I can say “Alexa, turn on kitchen lights” but for the other two I must say “Alexa, switch on sonos”. I suspect “sonos” and “audio” are reserved words with Alexa.

[quote=“mpalensh, post:26, topic:187039”]Hello all - I’ve also got this up and running on Windows, and I’m also trying to get it running on my Synology NAS - but it looks like Synology only works up to Java 7, so I’ve put that on hold for the time being.

I’m able to get the Echo to turn a light on/off by saying “Alexa turn off office light” - it works great. However, after the light changes state, the top LED spins for about 10 seconds and then the Echo responds “Sorry, but I’m unable to reach the device”. Is this something wrong in my config?[/quote]

Seems like Alexa or the Java server is not getting a response from your Vera when it calls the URL. Can you paste in the code you uploaded for your light?

Also just for kicks try going to the Vera app on your phone, settings, hue lights, and forget everything. Then rediscover.

First off - AWESOME! Thanks so much for this great bridge - it really helps things out.

I got things running, but I get the same response as the previous poster. “Sorry, I couldn’t reach the device or group name Living Room”. The lights do turn on and off.

In the logs, I see this error:
org.springframework.util.InvalidMimeTypeException: Invalid mime type “json”: does not contain ‘/’

One slight departure of what I’m doing is instead of controlling individual lights, I’m using it to control a Vera scene. My code I uploaded is as follows:
{
“name” : “Living Room”,
“deviceType” : “switch”,
“onUrl” : “http://192.168.1.24:3480/data_request?id=action&output_format=json&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=RunScene&SceneNum=1”,
“offUrl” : “http://192.168.1.24:3480/data_request?id=action&output_format=json&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=RunScene&SceneNum=2
}

Perhaps the java app isn’t getting the right response?

I still can’t seem to get ECHO to “Discover” my devices despite the port clearing, disabling SSDP and no firewall.

If I knew PI would go smoother I would test with that.

[quote=“integlikewhoa, post:25, topic:187039”]Where do we put the File and do we do anything with it after we download it?

I’m getting the following error.

C:\Windows\system32>java -jar -Djava.net.preferIPv4Stack=true amazon-echo-bridge
-0.1.0.jar --logging.level.com.armzilla.ha.upnp=DEBUG --logging.file=ha.log --up
np.config.address=192.168.1.100 >log.txt
Error: Unable to access jarfile amazon-echo-bridge-0.1.0.jar

EDIT: I got past that part buy just running the file. I can check the browser and I get the info on my light.

I’m currently stuck on getting Echo to “DISCOVER” my deivces. Keeps saying shes not finding it. Firewall off I checked I will not swear “run netstat -ano | find “8080”, netstat -ano | find “1900”, netstat -ano | find “50000”.” and stoped a few things till it was clear, then ran the java and still no luck yet.[/quote]

I don’t think you can just dbl click and run the JAR file

looks like your cmd prompt was just in the system32 dir. Change to the dir where the JAR file is and run the command line again.

[quote=“Ramias, post:31, topic:187039”][quote=“integlikewhoa, post:25, topic:187039”]Where do we put the File and do we do anything with it after we download it?

I’m getting the following error.

C:\Windows\system32>java -jar -Djava.net.preferIPv4Stack=true amazon-echo-bridge
-0.1.0.jar --logging.level.com.armzilla.ha.upnp=DEBUG --logging.file=ha.log --up
np.config.address=192.168.1.100 >log.txt
Error: Unable to access jarfile amazon-echo-bridge-0.1.0.jar

EDIT: I got past that part buy just running the file. I can check the browser and I get the info on my light.

I’m currently stuck on getting Echo to “DISCOVER” my deivces. Keeps saying shes not finding it. Firewall off I checked I will not swear “run netstat -ano | find “8080”, netstat -ano | find “1900”, netstat -ano | find “50000”.” and stoped a few things till it was clear, then ran the java and still no luck yet.[/quote]

I don’t think you can just dbl click and run the JAR file

looks like your cmd prompt was just in the system32 dir. Change to the dir where the JAR file is and run the command line again.[/quote]

It looks like it was running fine for me, but how can I check? The Jar file was on the desktop at the time.

I can run this http://192.168.1.100:8080/api/devices and before running it I would get a website not available.
After running it but before running this tool “http://www.swensensoftware.com/im-only-resting” I get a response but fairly empty with no device on it. After running the tool I get a much longer print out with the device name and info all in.

Seems to me I got it right up until getting ECHO to discover it.

[quote=“integlikewhoa, post:32, topic:187039”][quote=“Ramias, post:31, topic:187039”][quote=“integlikewhoa, post:25, topic:187039”]Where do we put the File and do we do anything with it after we download it?

I’m getting the following error.

C:\Windows\system32>java -jar -Djava.net.preferIPv4Stack=true amazon-echo-bridge
-0.1.0.jar --logging.level.com.armzilla.ha.upnp=DEBUG --logging.file=ha.log --up
np.config.address=192.168.1.100 >log.txt
Error: Unable to access jarfile amazon-echo-bridge-0.1.0.jar

EDIT: I got past that part buy just running the file. I can check the browser and I get the info on my light.

I’m currently stuck on getting Echo to “DISCOVER” my deivces. Keeps saying shes not finding it. Firewall off I checked I will not swear “run netstat -ano | find “8080”, netstat -ano | find “1900”, netstat -ano | find “50000”.” and stoped a few things till it was clear, then ran the java and still no luck yet.[/quote]

I don’t think you can just dbl click and run the JAR file

looks like your cmd prompt was just in the system32 dir. Change to the dir where the JAR file is and run the command line again.[/quote]

It looks like it was running fine for me, but how can I check? The Jar file was on the desktop at the time.

I can run this http://192.168.1.100:8080/api/devices and before running it I would get a website not available.
After running it but before running this tool “http://www.swensensoftware.com/im-only-resting” I get a response but fairly empty with no device on it. After running the tool I get a much longer print out with the device name and info all in.

Seems to me I got it right up until getting ECHO to discover it.[/quote]

I suspect the --upnp.config.address=192.168.1.100 and is needed by the echo, thus it was part of the instructions. Pretty sure double clicking the Jar in Windows is not enough to make this work completely.

I have tried to move the file to the system 32 folder and I have the same run error. Funny thing is when i manually try to run it in that folder like i did on the desktop I also get that same error.

Currently running http://192.168.1.100:8080/api/devices in a browser returns this.

[{"content":[{"id":"5202227b-f354-4092-bc52-cb1e38ecec6b","name":"Dining Table Light","deviceType":"switch","offUrl":"http://192.168.1.212:3480/data_request?id=action&output_format=json&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=0&DeviceNum=52","onUrl":"http://192.168.1.212:3480/data_request?id=action&output_format=json&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=1&DeviceNum=52"}],"facets":[],"totalElements":1,"totalPages":1,"size":1,"number":0,"sort":null,"first":true,"last":true,"numberOfElements":1}]

Please give me more ideas to get it to run via command promt

192.168.1.100 is the static address I have set for my desktop windows 8.1 server which is where I’m running this at.

Ok I understood you now, I moved the file to c:\ to keep it simple

did a cd\ in the CMD (C:\ now) and now I got it to run just fine. Off to test

EDIT:

This is what I get.

C:>java -jar -Djava.net.preferIPv4Stack=true amazon-echo-bridge-0.1.0.jar --log
ging.level.com.armzilla.ha.upnp=DEBUG --logging.file=ha.log --upnp.config.addres
s=192.168.1.100 >log.txt
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:53)
at java.lang.Thread.run(Unknown Source)Caused by: java.lang.IllegalStateException: Tomcat connector in failed state
at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer.start(TomcatEmbeddedServletContainer.java:157)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.startEmbeddedServletContainer(EmbeddedWebApplicationContext.java:288)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:141)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:483)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:686)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:320)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:957)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:946)
at com.armzilla.ha.SpringbootEntry.main(SpringbootEntry.java:14)
… 6 more

what version of Java?

Or maybe some weird permissions issue when running from the root of C:. Maybe try to put the JAR in a folder and run it from there?

[quote=“Ramias, post:37, topic:187039”]what version of Java?

Or maybe some weird permissions issue when running from the root of C:. Maybe try to put the JAR in a folder and run it from there?[/quote]

I’m running JAVA version 8 update 45

I got her to see the light!

I shut down the computer and started all over. I think some of my errors above might be due to the fact it was already running. I did move it to c:\Echo folder and then ran it. No more error after that and I did check out the log it creates in the same folder.

I guess this will be good enough for testing now. I don’t like leaving the CMD open and I also have turned off PLEX and Torrents right now due to seeing them in the port checker. Not sure if I turn them on if everything will quit. But I guess if this works out good a PI might be the next move.

What does the code look like for multiple device’s? Can someone post up an example with more then one? Thanks

How about dimming lights?

I just have two so far; uploaded one then uploaded the other. My echo is in the living room so I really only have it do actions/scenes relevant for that location right now.