HueEmulation and Google Home support

@HomeBoss - I believe you need to use the binding jar from here:

and not the one in Paperui.
Remove the existing one via PaperUI extentions, then put the jar above into your \addons folder.
You can then configure it in PaperUI - ( I set it to port 80, enabled linking and set the IP )

…it then just worked…

1 Like

That worked, thank you for your help.

I got the Google Home to pair with the emulator, but I cant add any devices. It seems like OH2 does not accept hard brackets in the .items file.

I have an item set up like this:

Dimmer Light_GF_Living_Table "Sofa" (GF_Living, Proxy_Lights_Stue, Lights) {ihc="0x7c95d"}

When I try to make it wisible to the Google Home through the HueEmulator I add [“Dimmer”] to the item like this:

Dimmer Light_GF_Living_Table "Sofa" [ "Lighting" ] (GF_Living, Proxy_Lights_Stue, Lights) {ihc="0x7c95d"}

Now I get an error in the editor: “Missing EOF at ‘[’” and the sitemap (based on groups) is messed up.

Have I misunderstood how to use HueEmulator?

I’ve hacked a bit around, and tried to match the format of a real philips hue as posted earlier in this thread. With those changes it looks like dimming works for google home… If you want to experiment you can get the jar here:

1 Like

Oh yeah, and this is my .items list for it to work with my zwave setup:
Dimmer TestHue1 “Office Light” [“Lighting”] { channel=“zwave:device:2d54f1b3:node2:switch_dimmer” }
Dimmer TestHue2 “Dining Light” [“Lighting”] { channel=“zwave:device:2d54f1b3:node3:switch_dimmer” }
Dimmer TestHue3 “Living room light” [“Lighting”] { channel=“zwave:device:2d54f1b3:node5:switch_dimmer” }
Dimmer TestHue4 “Kitchen light” [“Lighting”] { channel=“zwave:device:2d54f1b3:node6:switch_dimmer” }

@staalebk thanks for your efforts. I’ll give it a try. Where these changes done from @digitaldan source that works with google home? Mind showing the changes so @digitaldan can apply them to his source and package it up for distribution?

Again thanks for your efforts,


@garrettwp: You can see the changes here: (the last two commits). I don’t know how much of them are needed. This is a hack so I’m guessing @digitaldan want a better fix :slight_smile:

Im using digitaldan’s version ( thanks for your efforts @staalebk - will try your version later)

Ive a question/problem. Last night i wanted to remove my garage door item from the binding

Switch	GarageDoorMQTT	"Garage Door"		(gOutside,gSecurity) ["Switchable","iss:room:Garage","iss:type:DevLock","iss:invert:true"]		{ mqtt="<[MyMQTT:mygateway1-out/8/1/1/0/36:state:MAP(],>[MyMQTT:mygateway1-in/8/1/1/0/36:command:ON:1],>[MyMQTT:mygateway1-in/8/1/1/0/36:command:OFF:0]", autoupdate="false", imperihab="room:Garage,type:DevLock" }

as you can see ive set the tag as “Switchable”

I wanted to remove this, as i asked Google Home “Turn off the lights” , which it did and said replied “Turning off 16 lights”
…but it closed the garage door!..not what i wanted and so i presumed i could simply remove the tag in the item for now.

When i removed it however, the binding failed, and threw this error:

2016-11-30 11:35:14.466 [WARN ] [eclipse.jetty.servlet.ServletHandler] - /api/4feb2bd0-d814-46ff-90be-e9b5ffef89be/lights

and subsequently the /api/discovery.xml stops working with an error…


Problem accessing /api/discovery.xml. Reason:

    Server Error
Caused by:

Powered by Jetty://

if i put the tag back the binding recovers, If i leave the tag out and restart OH2, the error remains, so i guess there is some data persisted by the binding.
Is there a way to clear this data? or should it be rebuilt at startup/periodically?

Secondly, even though im using tags “Lighting”, Switchable and Dimmer in my items file, all are shown in discovery.xml as “Dimmable Light” - Is this a bug?

{"lights":{"1":{"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":"Good Night","modelid":"LWB004","manufacturername":"openHAB","swversion":"66009461","pointsymbol":{"1":"none","2":"none","3":"none","4":"none","5":"none","6":"none","7":"none","8":"none"}},"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":"Party Time","modelid":"LWB004","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":"Chandelier","modelid":"LWB004","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":"Downlights","modelid":"LWB004","manufacturername":"openHAB","swversion":"66009461","pointsymbol":{"1":"none","2":"none","3":"none","4":"none","5":"none","6":"none","7":"none","8":"none"}},"5":{"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":"Wall Lights","modelid":"LWB004","manufacturername":"openHAB","swversion":"66009461","pointsymbol":{"1":"none","2":"none","3":"none","4":"none","5":"none","6":"none","7":"none","8":"none"}},"6":{"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":"Floor Light","modelid":"LWB004","manufacturername":"openHAB","swversion":"66009461","pointsymbol":{"1":"none","2":"none","3":"none","4":"none","5":"none","6":"none","7":"none","8":"none"}},"7":{"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":"Island Bench","modelid":"LWB004","manufacturername":"openHAB","swversion":"66009461","pointsymbol":{"1":"none","2":"none","3":"none","4":"none","5":"none","6":"none","7":"none","8":"none"}},"8":{"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 Downlights","modelid":"LWB004","manufacturername":"openHAB","swversion":"66009461","pointsymbol":{"1":"none","2":"none","3":"none","4":"none","5":"none","6":"none","7":"none","8":"none"}},"9":{"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":"TV Light","modelid":"LWB004","manufacturername":"openHAB","swversion":"66009461","pointsymbol":{"1":"none","2":"none","3":"none","4":"none","5":"none","6":"none","7":"none","8":"none"}},"10":{"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":"Tall Light","modelid":"LWB004","manufacturername":"openHAB","swversion":"66009461","pointsymbol":{"1":"none","2":"none","3":"none","4":"none","5":"none","6":"none","7":"none","8":"none"}},"11":{"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":"Family Room Downlights","modelid":"LWB004","manufacturername":"openHAB","swversion":"66009461","pointsymbol":{"1":"none","2":"none","3":"none","4":"none","5":"none","6":"none","7":"none","8":"none"}},"12":{"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":"Driveway Lights","modelid":"LWB004","manufacturername":"openHAB","swversion":"66009461","pointsymbol":{"1":"none","2":"none","3":"none","4":"none","5":"none","6":"none","7":"none","8":"none"}},"13":{"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":"Deck Wall Lights","modelid":"LWB004","manufacturername":"openHAB","swversion":"66009461","pointsymbol":{"1":"none","2":"none","3":"none","4":"none","5":"none","6":"none","7":"none","8":"none"}},"14":{"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":"Deck Pendant","modelid":"LWB004","manufacturername":"openHAB","swversion":"66009461","pointsymbol":{"1":"none","2":"none","3":"none","4":"none","5":"none","6":"none","7":"none","8":"none"}},"15":{"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":"Deck Spot Lights","modelid":"LWB004","manufacturername":"openHAB","swversion":"66009461","pointsymbol":{"1":"none","2":"none","3":"none","4":"none","5":"none","6":"none","7":"none","8":"none"}},"16":{"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":"Garage Door","modelid":"LWB004","manufacturername":"openHAB","swversion":"66009461","pointsymbol":{"1":"none","2":"none","3":"none","4":"none","5":"none","6":"none","7":"none","8":"none"}}}}

The solution to my question is to include the icon tag ex in the item description. Without this tag it doesn’t work (for me anyhow)

1 Like

@staalebk You confirmed my theory in that the json data being passed to the Google Home telling it what devices are available needs to be modified slightly. For one the type has a typo and needs to read Dimmable light and not Dimmable Light. The other changes to report it more like a Philips Hue probably help as well. These changes should not take much time to implement and hopefully @digitaldan can add them soon.

  • Garrett

I just wanted to add that I got @staalebk modified binding to work with Google Home to control the brightness of the lights.

Nice to hear that it is working for you as well @garretwp. I can report that I’ve had zero problems with the bindings, and I am really impressed by google home and it’s understanding of my broken English. :slight_smile:

Can anyon reproduce the problem above where the binding does not like if a tag is removed from the items file?


It happens for me as well for the first item I added to the .items file. If I remove it then i get a 500 error on the discovery.xml file with the following backtrace:

java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String
at java.lang.String.compareTo(
at java.util.TreeMap.getEntry(
at java.util.TreeMap.remove(
at javax.servlet.http.HttpServlet.service(
at org.eclipse.jetty.servlet.ServletHolder.handle(
at org.eclipse.jetty.servlet.ServletHandler.doHandle(
at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(
at org.eclipse.jetty.server.handler.ScopedHandler.handle(
at org.eclipse.jetty.server.session.SessionHandler.doHandle(
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(
at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(
at org.eclipse.jetty.servlet.ServletHandler.doScope(
at org.eclipse.jetty.server.session.SessionHandler.doScope(
at org.eclipse.jetty.server.handler.ContextHandler.doScope(
at org.eclipse.jetty.server.handler.ScopedHandler.handle(
at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(
at org.eclipse.jetty.server.Server.handle(
at org.eclipse.jetty.server.HttpChannel.handle(
at org.eclipse.jetty.server.HttpConnection.onFillable(
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(
at org.eclipse.jetty.util.thread.QueuedThreadPool$

Thanks @staalebk for confirming its not just me!

I have the same problem. I can unpair and pair the emulator with google home, but get the error 500 in the discovery.xml and the same errors in the log. I can’t get it back to working again. Is it possible to delete the information from the binding that must be stored somewhere and just start over?

Mine works again if I re-add the entry I removed.

I too would like to know how to clear the binding’s “memory” so it re-initialises itself.

I stopped OH2 and tried deleting the text in the “items” file located at /var/lib/openhab2/hueemulation. After a restart the hueemulation worked again. So some of the “memory” is in this file.

1 Like

Thanks, all, for your collective efforts on this. It have this running reliably with OH2 build 648 on OS X server (El Capitan) using @staalebk jar.

It may be a consequence of the way I forwarded the traffic from port 80 to my openhab port for the hue emulator pairing, but it doesn’t seem to work after pairing the google home and devices unless I leave the rule in place. It’s not a big deal for me, as I wasn’t running any services from that box that need to serve anything on port 80 anyway, so I’ll just leave it alone for now. I was under the impression the port forward only needed to be in place to add devices and initially pair, not operate them after the fact. Is that incorrect?

Anyway, this is how I did the forward with pfctl, for any Macinfolk who may be wondering (or maybe can offer up an even better way). The IP tables way won’t work on OS X and ipfw was recently deprecated and removed (which is a pity because it is much easier).

Copy/paste the following into a Terminal session (replacing my IP and port choices for your OH2 instance accordingly):

echo “
rdr pass inet proto tcp from any to any port 80 -> port 10003
” | sudo pfctl -ef -

It works, but has it’s drawbacks.

Also, I tried to change some items after setting it up and it freaked out Jetty (error 500). Setting the .items file entries I’d changed (from ‘test’ to something more meaningful) back to what they were unbroke Jetty exactly as @greg described.

I also have the HomeKit extension configured and the items work exactly the same between Siri/Homekit and Google Home as I have them defined. It’s pretty slick. No noticeable lag switching devices with either. I have a pretty varied mix of different z-wave device-types and ZigBee lightbulbs. It’s all seamless. Well done!