After installing Hue Emulation on OpenHAB 2.1 and latest 2.2 snapshot, Alexa does not recognize any tagged device.
It might be related to new devices. There is a discussion here: https://community.openhab.org/t/alexa-and-hue-emulation-no-devices-discovered/36554
Alexa should list devices
Alexa returns to the "search devices" screen in the Android app.
?
OpenHAB 2.1 / 2.2 snapshot * Debian Linux Intel Core i3 ** Amazon Echo 2nd generation
I have the same problem. I have a Echo Dot (1st gen), which works without problems, can discover and control my things. My new Echo (2nd gen), does not find any device and can only control the existing devices as long as the Dot is connected.
These are the log entries for a discovery:
2017-11-26 13:11:12.964 [DEBUG] [ulation.internal.HueEmulationServlet] - 192.168.178.55: GET /api/description.xml
2017-11-26 13:11:13.137 [DEBUG] [ulation.internal.HueEmulationServlet] - 192.168.178.55: GET /api/description.xml
2017-11-26 13:11:13.619 [DEBUG] [ulation.internal.HueEmulationServlet] - 192.168.178.24: GET /api/description.xml
2017-11-26 13:11:13.619 [DEBUG] [ulation.internal.HueEmulationServlet] - 192.168.178.24: GET /api/description.xml
2017-11-26 13:11:13.792 [DEBUG] [ulation.internal.HueEmulationServlet] - 192.168.178.24: GET /api/6gBRUhwwQa37DNZOixb9gvYsDQ69XDohVRSHqlZo/lights
2017-11-26 13:11:13.803 [DEBUG] [ulation.internal.HueEmulationServlet] - 192.168.178.24: GET /api/6gBRUhwwQa37DNZOixb9gvYsDQ69XDohVRSHqlZo/lights
.55 is the new Echo, .24 is the old Dot.
+1
@digitaldan, once you have moved into your new house and have the time please look into this, it would be much appreciated. There are several reports in the forum of people that can not get their new echos to detect devices.
I will help as much as i can if you need a tester or other help.
This may also enable Ambilight+Hue via the Hue Emulation. Would be nice to have.
I can test on this one.
Just for reference, other projects seem to have similar problems:
https://github.com/bwssytems/ha-bridge/issues/810
I have some information on that topic:
When I switched the OH port to 80 I was able to discover items which are exposed by the hue emulation. My problem now is that the when switching on an item it works but alexa says "... reagiert gerade nicht" (The english term would be "does not react right now"). When switching the item off it works without any problem.
I can confirm what @dienstfuchs wrote. It is essential to not only change the port in the hueemulation configuration, but to also enable port forwarding on the openHAB server from port 80 to 8080.
On linux, this can be done by calling
iptables -A INPUT -i eth0 -p tcp --dport 80 -j ACCEPT
iptables -A INPUT -i eth0 -p tcp --dport 8080 -j ACCEPT
iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080
When switching things on and you get the error message, the hueemulation log looks like this:
2018-02-02 15:26:10.571 [DEBUG] [ulation.internal.HueEmulationServlet] - 192.168.178.55: PUT /api/bfe9e10f-06c3-49e8-8cfe-98a71c91940f/lights/4/state
2018-02-02 15:26:10.605 [DEBUG] [ulation.internal.HueEmulationServlet] - HuState [on: true bri: -1 hue: 0 sat: 0 xy: {0.0 0.0 } ct: 500 alert: none effect: none colormode: ct reachable: true
2018-02-02 15:26:10.645 [DEBUG] [ulation.internal.HueEmulationServlet] - HSBType 0,0,100
2018-02-02 15:26:10.668 [DEBUG] [ulation.internal.HueEmulationServlet] - sending ON to Anlage
2018-02-02 15:26:10.706 [DEBUG] [ulation.internal.HueEmulationServlet] - 192.168.178.55: GET /api/bfe9e10f-06c3-49e8-8cfe-98a71c91940f/lights/4
2018-02-02 15:26:10.850 [DEBUG] [ulation.internal.HueEmulationServlet] - 192.168.178.55: PUT /api/bfe9e10f-06c3-49e8-8cfe-98a71c91940f/lights/4/state
2018-02-02 15:26:10.895 [DEBUG] [ulation.internal.HueEmulationServlet] - HuState [on: false bri: 254 hue: 0 sat: 0 xy: {0.0 0.0 } ct: 500 alert: none effect: none colormode: ct reachable: true
2018-02-02 15:26:10.936 [DEBUG] [ulation.internal.HueEmulationServlet] - HSBType 0,0,99
2018-02-02 15:26:10.959 [DEBUG] [ulation.internal.HueEmulationServlet] - sending ON to Anlage
2018-02-02 15:26:11.003 [DEBUG] [ulation.internal.HueEmulationServlet] - 192.168.178.55: GET /api/bfe9e10f-06c3-49e8-8cfe-98a71c91940f/lights/4
Okay, it looks like a found the fix for the problem. The Hue Emulation code returns a brightness of 255 when the item is switched on:
2018-02-02 16:33:55.718 [DEBUG] [ulation.internal.HueEmulationServlet] - 192.168.178.55: PUT /api/bfe9e10f-06c3-49e8-8cfe-98a71c91940f/lights/4/state
2018-02-02 16:33:55.751 [DEBUG] [ulation.internal.HueEmulationServlet] - HuState [on: true bri: -1 hue: 0 sat: 0 xy: {0.0 0.0 } ct: 500 alert: none effect: none colormode: ct reachable: true
2018-02-02 16:33:55.788 [DEBUG] [ulation.internal.HueEmulationServlet] - HSBType 0,0,100
2018-02-02 16:33:55.810 [DEBUG] [ulation.internal.HueEmulationServlet] - sending ON to Anlage
2018-02-02 16:33:55.832 [DEBUG] [ulation.internal.HueEmulationServlet] - returning [{"success":{"/lights/4/state/on":true}}]
2018-02-02 16:33:55.883 [DEBUG] [ulation.internal.HueEmulationServlet] - 192.168.178.55: GET /api/bfe9e10f-06c3-49e8-8cfe-98a71c91940f/lights/4
2018-02-02 16:33:55.942 [DEBUG] [ulation.internal.HueEmulationServlet] - returning light state {"state":{"on":true,"bri":255,"hue":0,"sat":0,"xy":[0.0,0.0],"ct":500,"alert":"none","effect":"none","colormode":"ct","reachable":true},"type":"Dimmable Light","name":"Anlage","modelid":"LWB004","uniqueid":"4","manufacturername":"openHAB","swversion":"66009461","pointsymbol":{"1":"none","2":"none","3":"none","4":"none","5":"none","6":"none","7":"none","8":"none"}}
According to http://www.burgestrand.se/hue-api/api/lights/, this is not allowed in the Hue API. If I change the code in HueEmulationServlet.java (line 481) to return 254 instead, alexa no longer complains when items are switched on.
There most likely are other places where this has to be changed, I leave that to the experts.
What you have found could potentially be the cause of this issue too.
bri
brightness, in range 0 - 254. 0 is not off.
} else if (itemState instanceof DecimalType) {
short bri = (short) ((((DecimalType) itemState).intValue() * 255) / 100);
hueState = new HueState(bri);
} else if (itemState instanceof OnOffType) {
short bri = (short) (((OnOffType) itemState) == OnOffType.ON ? 255 : 0);
Most helpful comment
Okay, it looks like a found the fix for the problem. The Hue Emulation code returns a brightness of 255 when the item is switched on:
According to http://www.burgestrand.se/hue-api/api/lights/, this is not allowed in the Hue API. If I change the code in HueEmulationServlet.java (line 481) to return 254 instead, alexa no longer complains when items are switched on.
There most likely are other places where this has to be changed, I leave that to the experts.