armzilla / amazon-echo-ha-bridge

emulates philips hue api to other home automation gateways
Apache License 2.0
732 stars 168 forks source link

Having issues running 2.1.0 trying to communicate with Vera #28

Open mfiumano opened 9 years ago

mfiumano commented 9 years ago

I can create my devices, echo finds them, but when i go to tell echo what to do, she says she can't communicate to the bridge, and this is what i get from the bridge logs...

2015-08-25 01:31:35.204 INFO 2787 --- [nio-8080-exec-4] c.armzilla.ha.upnp.UpnpSettingsResource : upnp device settings requested: amazon-ha-bridge from 192.168.1.25 2015-08-25 01:31:35.548 INFO 2787 --- [nio-8080-exec-3] com.armzilla.ha.hue.HueMulator : hue lights list requested: yMkLXpiEiq46uQ5caHRhiP1IPwBf0XL0uve5WaDT from 192.168.1.25 2015-08-25 01:31:35.752 INFO 2787 --- [nio-8080-exec-5] com.armzilla.ha.hue.HueMulator : hue api root requested: yMkLXpiEiq46uQ5caHRhiP1IPwBf0XL0uve5WaDT from 192.168.1.25 2015-08-25 01:31:37.543 INFO 2787 --- [nio-8080-exec-6] com.armzilla.ha.hue.HueMulator : hue state change requested: yMkLXpiEiq46uQ5caHRhiP1IPwBf0XL0uve5WaDT from 192.168.1.25 2015-08-25 01:31:37.544 INFO 2787 --- [nio-8080-exec-6] com.armzilla.ha.hue.HueMulator : hue stage change body: {"on": true} 2015-08-25 01:31:37.549 INFO 2787 --- [nio-8080-exec-6] com.armzilla.ha.hue.HueMulator : Making outbound call: GET HTTP/1.1 2015-08-25 01:31:37.566 ERROR 2787 --- [nio-8080-exec-6] com.armzilla.ha.hue.HueMulator : Error calling out to HA gateway

org.apache.http.client.ClientProtocolException: null at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:186) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:106) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:57) at com.armzilla.ha.hue.HueMulator.doHttpRequest(HueMulator.java:202) at com.armzilla.ha.hue.HueMulator.stateChange(HueMulator.java:152) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:483) at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:776) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:705) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966) at org.springframework.web.servlet.FrameworkServlet.doPut(FrameworkServlet.java:879) at javax.servlet.http.HttpServlet.service(HttpServlet.java:647) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842) at javax.servlet.http.HttpServlet.service(HttpServlet.java:725) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.springframework.boot.actuate.autoconfigure.EndpointWebMvcAutoConfiguration$ApplicationContextHeaderFilter.doFilterInternal(EndpointWebMvcAutoConfiguration.java:291) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.armzilla.ha.filters.SpringBootCorsFilter.doFilter(SpringBootCorsFilter.java:28) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.springframework.boot.actuate.trace.WebRequestTraceFilter.doFilterInternal(WebRequestTraceFilter.java:102) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:85) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.springframework.boot.actuate.autoconfigure.MetricFilterAutoConfiguration$MetricsFilter.doFilterInternal(MetricFilterAutoConfiguration.java:90) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:516) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1086) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:659) at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:223) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1558) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1515) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:744) Caused by: org.apache.http.ProtocolException: Target host is not specified at org.apache.http.impl.conn.DefaultRoutePlanner.determineRoute(DefaultRoutePlanner.java:69) at org.apache.http.impl.client.InternalHttpClient.determineRoute(InternalHttpClient.java:124) at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:183) ... 66 common frames omitted

mfiumano commented 9 years ago

It might also help to know that my Green Test buttons in the bottom of the configurator work, while the blue test buttons next to the current devices in configurator don't work...

armzilla commented 9 years ago

Caused by: org.apache.http.ProtocolException: Target host is not specified makes me think this is a problem with the url you are trying to hit. can you provide the result of a GET on http://:8080/api/devices ?

mfiumano commented 9 years ago

pi@raspberrypi ~ $ wget http://192.168.1.27:8080/api/devices --2015-08-25 11:15:49-- http://192.168.1.27:8080/api/devices Connecting to 192.168.1.27:8080... connected. HTTP request sent, awaiting response... 200 OK Length: unspecified [application/json] Saving to: `devices'

[ <=>
                ] 798         --.-K/s   in 0s

2015-08-25 11:15:49 (5.80 MB/s) - `devices' saved [798]

pi@raspberrypi ~ $ cat devices [{"content":[{"id":"d1e8db0c-b45c-4c92-9486-65039cc73205","name":"Family Room Light","deviceType":"switch","offUrl":"","onUrl":"","httpVerb":null,"contentType":null,"contentBody":null},{"id":"de66d3aa-2a42-4927-8ca1-a71ffa5a08a6","name":"Living Room Light","deviceType":"switch","offUrl":" http://192.168.1.7:3480/data_request?id=action&output_format=json&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=0&DeviceNum=31 ","onUrl":" http://192.168.1.7:3480/data_request?id=action&output_format=json&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=1&DeviceNum=31 ","httpVerb":null,"contentType":null,"contentBody":null}],"facets":[],"totalPages":1,"totalElements":2,"first":true,"sort":null,"numberOfElements":2,"last":true,"size":2,"number":0}]

On Tue, Aug 25, 2015 at 12:46 AM, Arm Suwarnaratana < notifications@github.com> wrote:

Caused by: org.apache.http.ProtocolException: Target host is not specified makes me think this is a problem with the url you are trying to hit. can you provide the result of a GET on http://:8080/api/devices ?

— Reply to this email directly or view it on GitHub https://github.com/armzilla/amazon-echo-ha-bridge/issues/28#issuecomment-134472026 .

audiofreak9 commented 9 years ago

@mfiumano I am by no means proposing a solution to your problem, but I wanted to mention that I have found the Echo responds and works better when I name my devices without the word 'Light'. You used "Family Room Light", I'd suggest "Family Room" instead. The word 'Light' is a trigger word for the Echo.

mfiumano commented 9 years ago

Ok, thank you, i don't think that is the problem in this case, since my logs scroll on the RPi Hue Bridge and look like Echo 'got it' and is sending the right thing to the RPi, although the Bridge doesn't seem to be sending the right thing out to the Vera. Missing a 'Target Host' or something or other.... But it is definitely something to consider moving forward to make sure that Echo 'gets it' consistently. I was thinking that having three words might be too much for it anyway..... 'Living + Room + Light'.

audiofreak9 commented 9 years ago

@mfiumano You mentioned the Green Test buttons work, while the Blue Buttons do not. Have you tried the Green Test buttons when you "Edit" one of your existing devices?

mfiumano commented 9 years ago

There's a good chance I'm just an idiot. Not sure, but when i got home it was working.....sigh.

audiofreak9 commented 9 years ago

At least it's working! That's the ultimate goal.

michaelhinchey commented 7 years ago

@audiofreak9 I dont seem to have an issue with naming anything with lights. Occasionally I get the there is more than one device with the name light. I think if Alexa hears your wording clearly she does the command more often than not without the more than one device prompt. If this happens more than a few times I generally just clear and rediscover. I have only had to do this once though. Just speak clearly and more slowly. Not deep down south slow, but slow enough after the Alexa prompt. Also training Alexa may help. I have only done this in my bedroom because I tend to speak more softly in there so I dont wake my significant other.