New Binding: Hue Emulator - Amazon Echo integration

What are you talking about? This binding works like a charm.

Reading extensively on this topic it seems that there are as many people getting it working as not. In my case using a GH Mini and Openhabian 2.1.0 on a Raspberry Pi 2 I am getting no discovery of devices despite having:

  • installed the Hue Emulation binding
  • set the Device Pairing to enabled
  • set the items with tags like [“Switchable”] (also tried the Homekit format)
  • tried setting the Optional discovery address on or not
  • set the listening port to 80 from 8080
  • put the Raspberry Pi onto wifi so it would be on the exact same network as the GH Mini.
  • monitored for network traffic on Wireshark without success
    Does anyone know if this only works with version 2.2.0 of the Hue Emulation binding?
    api/hueemulation.xml shows
    {"lights":{"Light_GF_Dining_Table":{"state":{"on":false,"bri":-1,"hue":0,"sat":0,"xy":[0.0,0.0],"ct":500,"alert":"none","effect":"none","colormode":"ct","reachable":true},"type":"Dimmable Light","name":"Dining Table","modelid":"LWB004","uniqueid":"Light_GF_Dining_Table","manufacturername":"openHAB","swversion":"66009461","pointsymbol":{"1":"none","2":"none","3":"none","4":"none","5":"none","6":"none","7":"none","8":"none"}},"Light_GF_West_Wall_Lights":{"state":{"on":false,"bri":-1,"hue":0,"sat":0,"xy":[0.0,0.0],"ct":500,"alert":"none","effect":"none","colormode":"ct","reachable":true},"type":"Dimmable Light","name":"West Wall Lights","modelid":"LWB004","uniqueid":"Light_GF_West_Wall_Lights","manufacturername":"openHAB","swversion":"66009461","pointsymbol":{"1":"none","2":"none","3":"none","4":"none","5":"none","6":"none","7":"none","8":"none"}}}}

But api/nonuser/config reports:
{"error":{"type":3,"address":"/api/nonuser/config","description":"Hue resource not available"}}
Not aware of anything else I can try. Is there a way to troubleshoot the Hue Emulation package?
Does the Google Home app need to run on the same device as OH, e.g. on the Raspberry Pi or just on the same network?
Would love to know if I have missed something.

How did you tag your item?
Please post your item config.

As I said:

the whole line looks like this:
Switch Light_GF_Dining_Table “Dining Table” (GF_Dining, Lights) [“Switchable”] {channel=“zwave:device:d113a0d4:node13:switch_binary2”}

plus I have also tried [“homekit:Switch”] as suggested elsewhere in these forums.

It seems from this https://community.openhab.org/t/hueemulation-and-google-home-support/16283/201 that the Hue authorization has been changed so any new device wanting to be discovered is no longer working.

Best answer to all of these problems is to use IFTTT. See https://community.openhab.org/t/simple-way-to-use-google-home-with-ifttt-and-myopenhab/19001/18
Works nicely until API for GH is finally available.

I want to avoid cross posting, but I don’t know which thread is still active (OH2, milights and hue emulation).

I thing it is a little unfortunate that the hue emulation only makes items from a textual items file correctly available. It would be much more consistent to export the Things (with whatever channel is available e.g. a brightness, color, color temperature or on/off channel).

At the moment, if I just use the PaperUI with automatic channel linking and without textual files, then Alexa for instance will find all brightness channels separately and they are all labeled “Brightness”. Which is not helpful at all.

Is anybody else interested in a Hue Bridge Emulator addon, that makes Things available?

Cheers, David

1 Like

“Making Things available” is imho not the right approach as you still have the problem that you might want to add specific settings for the exposed items.

The suggested approach for this (and Alexa, Google-Home, etc.) is the new meta-data infrastructure. Feel free to follow-up on that PR.

@Kai Thanks for reading and answering here.
I have checked the meta-data infrastructure PR and as far as I understood, it solves the particular issue that users have to “tag” their items for different home assistant systems in different ways.

But consider a typical state of a hue device:

         "state":{  
            "on":true,
            "bri":254,
            "hue":23536,
            "sat":144,
            "xy":[  
               0.346,
               0.3568
            ],
            "ct":201,
            "alert":"none",
            "effect":"none",
            "colormode":"hs",
            "reachable":true
         },

A hue device is way more than just a switch, just a brightness, etc. It is actually the pendant to what we call a Thing in ESH/OH.

An Ikea Tradfri Thing or a Milight Thing has exactly an on/off, brightness, saturation, hue and color temperature control and even a location (whatever that is in the Hue world though).

We have an existing Thing property system, that can be used to attach meta data for IO/Bridge Addons, for example to exclude/include a Thing to the Hue Bridge Addon.

Imagine a Thing, provided by the user or an addon, that has 3 binary state channels and 1 percentage channel. Channel Types (OnOffType, etc) and the channel tag system will make it easy for my imaginary hue bridge addon to map to a hue device.

Maybe I just didn’t understand the mentioned PR correctly. It just feels natural for me that if we are communicating/bridging to other systems, in this case via the Hue bridge protocol, that we export Things instead of items.

Cheers, David

Does anyone know if the echo supports color lights via the API
I changed the bus emulation code to respond with a color model Id and type extended color light.

But inside the Alexa app it only allows normal brightness change and it’s identified as normal light.
Seams that the echo itself can not handle extended lights directly or am I wrong?

This pull request should fix that

1 Like

Hi there, I need your help.

No devices were found by Amazon Echo?
I Installed the Binding, set the Server-IP and enabled the pairing.

Here is my item file:

Switch  TestSwitch1     "Kitchen Switch" ["Switchable"]
Switch  TestSwitch2     "Bathroom" ["Lighting"]
Dimmer  TestDimmer3     "Hallway" ["Lighting"]
Number  TestNumber4     "Temperature Set Point" [ "TargetTemperature" ]

Here is the /api/discovery.xml directly from http://192.168.2.30:8080/api/discovery.xml

{"lights":{"2":{"state":{"on":false,"bri":-1,"hue":0,"sat":0,"xy":[0.0,0.0],"ct":500,"alert":"none","effect":"none","colormode":"ct","reachable":true},"type":"Dimmable Light","name":"Kitchen Switch","modelid":"LWB004","uniqueid":"2","manufacturername":"openHAB","swversion":"66009461","pointsymbol":{"1":"none","2":"none","3":"none","4":"none","5":"none","6":"none","7":"none","8":"none"}},"3":{"state":{"on":false,"bri":-1,"hue":0,"sat":0,"xy":[0.0,0.0],"ct":500,"alert":"none","effect":"none","colormode":"ct","reachable":true},"type":"Dimmable Light","name":"Bathroom","modelid":"LWB004","uniqueid":"3","manufacturername":"openHAB","swversion":"66009461","pointsymbol":{"1":"none","2":"none","3":"none","4":"none","5":"none","6":"none","7":"none","8":"none"}},"4":{"state":{"on":false,"bri":-1,"hue":0,"sat":0,"xy":[0.0,0.0],"ct":500,"alert":"none","effect":"none","colormode":"ct","reachable":true},"type":"Dimmable Light","name":"Hallway","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"}}}}

And here ist the Log:

2018-02-22 19:36:11.649 [DEBUG] [ulation.internal.HueEmulationServlet] - Device pairing enabled : true
2018-02-22 19:36:11.662 [DEBUG] [org.openhab.io.hueemulation         ] - ServiceEvent MODIFIED - {javax.servlet.http.HttpServlet}={service.pid=org.openhab.hueemulation, service.config.category=io, service.config.label=Hue Emulation, discoveryIp=192.168.2.30, component.name=org.openhab.hueemulation, component.id=207, pairingEnabled=true, service.config.description.uri=io:hueemulation, service.id=331, service.bundleid=222, service.scope=bundle} - org.openhab.io.hueemulation
2018-02-22 19:36:13.771 [TRACE] [tion.internal.HueEmulationUpnpServer] - Got SSDP Discovery packet from 192.168.2.114:50000
2018-02-22 19:36:13.771 [TRACE] [tion.internal.HueEmulationUpnpServer] - Got SSDP Discovery packet from 192.168.2.114:50000
2018-02-22 19:36:13.776 [TRACE] [tion.internal.HueEmulationUpnpServer] - Sending to 192.168.2.114 : HTTP/1.1 200 OK
HOST: 239.255.255.250:1900
EXT:
CACHE-CONTROL: max-age=100
LOCATION: http://192.168.2.30:8080/api/description.xml
SERVER: FreeRTOS/7.4.2, UPnP/1.0, IpBridge/1.15.0
hue-bridgeid: A832340ECE78
ST: upnp:rootdevice
USN: uuid:23216d9f-76cb-4cbe-b33c-a832340ece78::upnp:rootdevice
2018-02-22 19:36:13.779 [TRACE] [tion.internal.HueEmulationUpnpServer] - Sending to 192.168.2.114 : HTTP/1.1 200 OK
HOST: 239.255.255.250:1900
EXT:
CACHE-CONTROL: max-age=100
LOCATION: http://192.168.2.30:8080/api/description.xml
SERVER: FreeRTOS/7.4.2, UPnP/1.0, IpBridge/1.15.0
hue-bridgeid: A832340ECE78
ST: urn:schemas-upnp-org:device:basic:1
USN: uuid:23216d9f-76cb-4cbe-b33c-a832340ece78::upnp:rootdevice
2018-02-22 19:36:13.782 [TRACE] [tion.internal.HueEmulationUpnpServer] - Sending to 192.168.2.114 : HTTP/1.1 200 OK
HOST: 239.255.255.250:1900
EXT:
CACHE-CONTROL: max-age=100
LOCATION: http://192.168.2.30:8080/api/description.xml
SERVER: FreeRTOS/7.4.2, UPnP/1.0, IpBridge/1.15.0
hue-bridgeid: A832340ECE78
ST: upnp:rootdevice
USN: uuid:23216d9f-76cb-4cbe-b33c-a832340ece78::upnp:rootdevice
2018-02-22 19:36:13.783 [TRACE] [tion.internal.HueEmulationUpnpServer] - Sending to 192.168.2.114 : HTTP/1.1 200 OK
HOST: 239.255.255.250:1900
EXT:
CACHE-CONTROL: max-age=100
LOCATION: http://192.168.2.30:8080/api/description.xml
SERVER: FreeRTOS/7.4.2, UPnP/1.0, IpBridge/1.15.0
hue-bridgeid: A832340ECE78
ST: uuid:23216d9f-76cb-4cbe-b33c-a832340ece78
USN: uuid:23216d9f-76cb-4cbe-b33c-a832340ece78::upnp:rootdevice
2018-02-22 19:36:13.786 [TRACE] [tion.internal.HueEmulationUpnpServer] - Got SSDP Discovery packet from 192.168.2.114:50000
2018-02-22 19:36:13.787 [TRACE] [tion.internal.HueEmulationUpnpServer] - Sending to 192.168.2.114 : HTTP/1.1 200 OK
HOST: 239.255.255.250:1900
EXT:
CACHE-CONTROL: max-age=100
LOCATION: http://192.168.2.30:8080/api/description.xml
SERVER: FreeRTOS/7.4.2, UPnP/1.0, IpBridge/1.15.0
hue-bridgeid: A832340ECE78
ST: urn:schemas-upnp-org:device:basic:1
USN: uuid:23216d9f-76cb-4cbe-b33c-a832340ece78::upnp:rootdevice
2018-02-22 19:36:13.789 [TRACE] [tion.internal.HueEmulationUpnpServer] - Sending to 192.168.2.114 : HTTP/1.1 200 OK
HOST: 239.255.255.250:1900
EXT:
CACHE-CONTROL: max-age=100
LOCATION: http://192.168.2.30:8080/api/description.xml
SERVER: FreeRTOS/7.4.2, UPnP/1.0, IpBridge/1.15.0
hue-bridgeid: A832340ECE78
ST: upnp:rootdevice
USN: uuid:23216d9f-76cb-4cbe-b33c-a832340ece78::upnp:rootdevice
2018-02-22 19:36:13.794 [TRACE] [tion.internal.HueEmulationUpnpServer] - Sending to 192.168.2.114 : HTTP/1.1 200 OK
HOST: 239.255.255.250:1900
EXT:
CACHE-CONTROL: max-age=100
LOCATION: http://192.168.2.30:8080/api/description.xml
SERVER: FreeRTOS/7.4.2, UPnP/1.0, IpBridge/1.15.0
hue-bridgeid: A832340ECE78
ST: uuid:23216d9f-76cb-4cbe-b33c-a832340ece78
USN: uuid:23216d9f-76cb-4cbe-b33c-a832340ece78::upnp:rootdevice
2018-02-22 19:36:13.811 [TRACE] [tion.internal.HueEmulationUpnpServer] - Sending to 192.168.2.114 : HTTP/1.1 200 OK
HOST: 239.255.255.250:1900
EXT:
CACHE-CONTROL: max-age=100
LOCATION: http://192.168.2.30:8080/api/description.xml
SERVER: FreeRTOS/7.4.2, UPnP/1.0, IpBridge/1.15.0
hue-bridgeid: A832340ECE78
ST: urn:schemas-upnp-org:device:basic:1
USN: uuid:23216d9f-76cb-4cbe-b33c-a832340ece78::upnp:rootdevice
2018-02-22 19:36:13.814 [TRACE] [tion.internal.HueEmulationUpnpServer] - Sending to 192.168.2.114 : HTTP/1.1 200 OK
HOST: 239.255.255.250:1900
EXT:
CACHE-CONTROL: max-age=100
LOCATION: http://192.168.2.30:8080/api/description.xml
SERVER: FreeRTOS/7.4.2, UPnP/1.0, IpBridge/1.15.0
hue-bridgeid: A832340ECE78
ST: uuid:23216d9f-76cb-4cbe-b33c-a832340ece78
USN: uuid:23216d9f-76cb-4cbe-b33c-a832340ece78::upnp:rootdevice
2018-02-22 19:36:13.817 [TRACE] [tion.internal.HueEmulationUpnpServer] - Got SSDP Discovery packet from 192.168.2.114:50000
2018-02-22 19:36:13.821 [TRACE] [tion.internal.HueEmulationUpnpServer] - Sending to 192.168.2.114 : HTTP/1.1 200 OK
HOST: 239.255.255.250:1900
EXT:
CACHE-CONTROL: max-age=100
LOCATION: http://192.168.2.30:8080/api/description.xml
SERVER: FreeRTOS/7.4.2, UPnP/1.0, IpBridge/1.15.0
hue-bridgeid: A832340ECE78
ST: upnp:rootdevice
USN: uuid:23216d9f-76cb-4cbe-b33c-a832340ece78::upnp:rootdevice
2018-02-22 19:36:13.825 [TRACE] [tion.internal.HueEmulationUpnpServer] - Sending to 192.168.2.114 : HTTP/1.1 200 OK
HOST: 239.255.255.250:1900
EXT:
CACHE-CONTROL: max-age=100
LOCATION: http://192.168.2.30:8080/api/description.xml
SERVER: FreeRTOS/7.4.2, UPnP/1.0, IpBridge/1.15.0
hue-bridgeid: A832340ECE78
ST: urn:schemas-upnp-org:device:basic:1
USN: uuid:23216d9f-76cb-4cbe-b33c-a832340ece78::upnp:rootdevice
2018-02-22 19:36:13.829 [TRACE] [tion.internal.HueEmulationUpnpServer] - Sending to 192.168.2.114 : HTTP/1.1 200 OK
HOST: 239.255.255.250:1900
EXT:
CACHE-CONTROL: max-age=100
LOCATION: http://192.168.2.30:8080/api/description.xml
SERVER: FreeRTOS/7.4.2, UPnP/1.0, IpBridge/1.15.0
hue-bridgeid: A832340ECE78
ST: uuid:23216d9f-76cb-4cbe-b33c-a832340ece78
USN: uuid:23216d9f-76cb-4cbe-b33c-a832340ece78::upnp:rootdevice
2018-02-22 19:36:13.832 [TRACE] [tion.internal.HueEmulationUpnpServer] - Got SSDP Discovery packet from 192.168.2.114:50000
2018-02-22 19:36:13.836 [TRACE] [tion.internal.HueEmulationUpnpServer] - Sending to 192.168.2.114 : HTTP/1.1 200 OK
HOST: 239.255.255.250:1900
EXT:
CACHE-CONTROL: max-age=100
LOCATION: http://192.168.2.30:8080/api/description.xml
SERVER: FreeRTOS/7.4.2, UPnP/1.0, IpBridge/1.15.0
hue-bridgeid: A832340ECE78
ST: upnp:rootdevice
USN: uuid:23216d9f-76cb-4cbe-b33c-a832340ece78::upnp:rootdevice
2018-02-22 19:36:13.839 [TRACE] [tion.internal.HueEmulationUpnpServer] - Sending to 192.168.2.114 : HTTP/1.1 200 OK
HOST: 239.255.255.250:1900
EXT:
CACHE-CONTROL: max-age=100
LOCATION: http://192.168.2.30:8080/api/description.xml
SERVER: FreeRTOS/7.4.2, UPnP/1.0, IpBridge/1.15.0
hue-bridgeid: A832340ECE78
ST: urn:schemas-upnp-org:device:basic:1
USN: uuid:23216d9f-76cb-4cbe-b33c-a832340ece78::upnp:rootdevice
2018-02-22 19:36:13.843 [TRACE] [tion.internal.HueEmulationUpnpServer] - Sending to 192.168.2.114 : HTTP/1.1 200 OK
HOST: 239.255.255.250:1900
EXT:
CACHE-CONTROL: max-age=100
LOCATION: http://192.168.2.30:8080/api/description.xml
SERVER: FreeRTOS/7.4.2, UPnP/1.0, IpBridge/1.15.0
hue-bridgeid: A832340ECE78
ST: uuid:23216d9f-76cb-4cbe-b33c-a832340ece78
USN: uuid:23216d9f-76cb-4cbe-b33c-a832340ece78::upnp:rootdevice
2018-02-22 19:36:13.846 [TRACE] [tion.internal.HueEmulationUpnpServer] - Got SSDP Discovery packet from 192.168.2.114:50000
2018-02-22 19:36:13.850 [TRACE] [tion.internal.HueEmulationUpnpServer] - Sending to 192.168.2.114 : HTTP/1.1 200 OK
HOST: 239.255.255.250:1900
EXT:
CACHE-CONTROL: max-age=100
LOCATION: http://192.168.2.30:8080/api/description.xml
SERVER: FreeRTOS/7.4.2, UPnP/1.0, IpBridge/1.15.0
hue-bridgeid: A832340ECE78
ST: upnp:rootdevice
USN: uuid:23216d9f-76cb-4cbe-b33c-a832340ece78::upnp:rootdevice
2018-02-22 19:36:13.853 [TRACE] [tion.internal.HueEmulationUpnpServer] - Sending to 192.168.2.114 : HTTP/1.1 200 OK
HOST: 239.255.255.250:1900
EXT:
CACHE-CONTROL: max-age=100
LOCATION: http://192.168.2.30:8080/api/description.xml
SERVER: FreeRTOS/7.4.2, UPnP/1.0, IpBridge/1.15.0
hue-bridgeid: A832340ECE78
ST: urn:schemas-upnp-org:device:basic:1
USN: uuid:23216d9f-76cb-4cbe-b33c-a832340ece78::upnp:rootdevice
2018-02-22 19:36:13.855 [TRACE] [tion.internal.HueEmulationUpnpServer] - Sending to 192.168.2.114 : HTTP/1.1 200 OK
HOST: 239.255.255.250:1900
EXT:
CACHE-CONTROL: max-age=100
LOCATION: http://192.168.2.30:8080/api/description.xml
SERVER: FreeRTOS/7.4.2, UPnP/1.0, IpBridge/1.15.0
hue-bridgeid: A832340ECE78
ST: uuid:23216d9f-76cb-4cbe-b33c-a832340ece78
USN: uuid:23216d9f-76cb-4cbe-b33c-a832340ece78::upnp:rootdevice
2018-02-22 19:36:13.857 [TRACE] [tion.internal.HueEmulationUpnpServer] - Got SSDP Discovery packet from 192.168.2.114:50000
2018-02-22 19:36:13.859 [TRACE] [tion.internal.HueEmulationUpnpServer] - Sending to 192.168.2.114 : HTTP/1.1 200 OK
HOST: 239.255.255.250:1900
EXT:
CACHE-CONTROL: max-age=100
LOCATION: http://192.168.2.30:8080/api/description.xml
SERVER: FreeRTOS/7.4.2, UPnP/1.0, IpBridge/1.15.0
hue-bridgeid: A832340ECE78
ST: upnp:rootdevice
USN: uuid:23216d9f-76cb-4cbe-b33c-a832340ece78::upnp:rootdevice
2018-02-22 19:36:13.861 [TRACE] [tion.internal.HueEmulationUpnpServer] - Sending to 192.168.2.114 : HTTP/1.1 200 OK
HOST: 239.255.255.250:1900
EXT:
CACHE-CONTROL: max-age=100
LOCATION: http://192.168.2.30:8080/api/description.xml
SERVER: FreeRTOS/7.4.2, UPnP/1.0, IpBridge/1.15.0
hue-bridgeid: A832340ECE78
ST: urn:schemas-upnp-org:device:basic:1
USN: uuid:23216d9f-76cb-4cbe-b33c-a832340ece78::upnp:rootdevice
2018-02-22 19:36:13.863 [TRACE] [tion.internal.HueEmulationUpnpServer] - Sending to 192.168.2.114 : HTTP/1.1 200 OK
HOST: 239.255.255.250:1900
EXT:
CACHE-CONTROL: max-age=100
LOCATION: http://192.168.2.30:8080/api/description.xml
SERVER: FreeRTOS/7.4.2, UPnP/1.0, IpBridge/1.15.0
hue-bridgeid: A832340ECE78
ST: uuid:23216d9f-76cb-4cbe-b33c-a832340ece78
USN: uuid:23216d9f-76cb-4cbe-b33c-a832340ece78::upnp:rootdevice
2018-02-22 19:36:14.000 [DEBUG] [ulation.internal.HueEmulationServlet] - 192.168.2.114: GET /api/description.xml
==> /var/log/openhab2/events.log <==

Any ideas?
Thanks!

aha, found the answer here:
https://github.com/openhab/openhab2-addons/issues/2881

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

Watching this with interest. I was just thinking about how to write a rule to “fix” this with proxy items and who knows what other mess, but I’m really excited that your pull can make all of that irrelevant.

Thanks for your efforts!

I use this change for 3 month without problems now. Pull request is sadly still pending for review.

But you can build it by yourself and add the Binding jar manuell, before you uninstall the original binding.

Hi guys,

I just replaced my old echo with a new sonos beam - alexa integrated. I cannot discover any devices. Discovery XML looks fine, did the IP-tables change…
Is it normal that under “Things” in PaperUI the hue emulation bridge is shown as offline?

Regards,
Herbert

Hi Felix,

I have the same issue not finding any devices (used it pefore, but now on OH 2.4 M7 I got this issue).

If I change the iptables as suggested above.
How to roll back (i am afraid to mess up my system) :slight_smile:

Good question +1

I found I had to enable Amazon Echo device discovery fix before enabling Device Pairing after upgrading to the OH2 2.4.0 snapshot that included the new ESH HueEmulation bundle, i.e., Alexa had to rediscover all of my devices. See attached image.

There are some quirks in the updated implementation, but it is working for me.

I am running OH 2.4 M7
I don’t even have a hue brigde in things and cannot add one, because the there is no option to add a hue brigde in PaperUI.
The Hue emulation is active though.

One commit has broken the emulation. Please wait for:

The hue emulation is a service, not a binding. There is no Thing, except if you have the hue binding as well. In that case the Thing is offline, because the emulation is broken :smiley:

Cheers, David