HueEmulation and Google Home support

Hey all - Im expecting my Googl Home to arrive tomorrow here in Australia.

I’ve do have a couple of questions so I can quickly sell it to my wife.

To integrate this with my OH2 - do I just need to drop @digitaldan 's addin above? or do I need to run HABridge as well?

If its just the addin, I see that it must run on port80 …ive already got ngix running there, does anyone know a way to configure Nginx to passthrough everything on 80 to this binding? There is no other webservice other than the Nginx landing page…
or should I add a second IP address to the server and bind the HueEmulation binding to that?
( Im running on Debian Linux )

Secondly,
do I need to do something to my Items files to allow them to be seen by the binding?

Cheers,
Greg

ignore my second question…just found the answer in docs.openhab.org :wink:

No, sorry, I have not had time to get a PR made yet, I will try this weekend.

I’ve just received my Google home and beginning to set it up.
I have the jar above in my add-ons folder and the Google home sees it, but despite me configuring the plugn within paperui to be in link enabled, the Google home app (via https://hue-adapter.appspot.com/client/#/activate/pair) just sits there asking me to press the “pair” button on. The hue hub.

Am I doing something wrong?

Hey @greg, Am facing the same issue. Even though the OH2 picked up the jar from @digitaldan as i can see in console

openhab> list|grep -i hue
200 | Active   |  80 | 2.0.0.201611112128    | Hue Emulation Service

I also see in the openhab logs this message:

Started Hue Emulation service at /api

Am not able to discover devices either in alexa or google home.
@digitaldan, anything else that i can debug.?

Are you getting anything if you visit port 80 and /api/discovery.xml? If not you will need to forward port 80 to the port the open-hab webserver runs on. Ive done it with this iptables command:
iptables -t nat -A PREROUTING -p tcp -d 192.168.1.6 --dport 80 -j DNAT --to-destination 192.168.1.2:8080

Openhab is listning to 192.168.1.2:8080, and since I have apache configured on port 80 on that IP I added a new IP, and forward port 80 on that to the openhab server:
ifconfig eth0:0 192.168.1.6

4 Likes

@staalebk, I was missing that part. Works perfectly now. Thanks a lot.

Woohooo…that fixed it for me also. Thanks @staalebk And thanks @digitaldan for creating this binding

:beers:

@digitaldan Any luck with having a look at the issue with the bulbs not being correctly identified with Google Home? I posted some things earlier that may help with how Hue Emulation binding is describing the lights. I noticed a type in the type being passed and a few other things that maybe Google Home is looking at to see if the lights are a dimmable light.

  • Garrett

I have not looked at it yet, I do have an branch from before working on the Google home that I believe would fix this ( was getting color working ), but have not had any time to work on this. Hopefully this coming up weekend I can take a look!

Is the binding in the repository not working yet?

I installed the binding through PaperUI and made the changes to IP-routing suggested above but there is no luck in finding the Google Home from the Android Phone app. When I look up http://my-routed-ip/api/discovery.xml I get the XML page with the HUE information.

Do you have any suggestions to what I can do?

@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: http://t0yen.asuscomm.com/org.openhab.io.hueemulation-2.0.0-SNAPSHOT.jar

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,

Garrett

@garrettwp: You can see the changes here: https://github.com/staalebk/openhab2-addons/commits/hueemulation-google-home (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(miosSwitchIn.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
java.lang.ClassCastException

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

HTTP ERROR 500

Problem accessing /api/discovery.xml. Reason:

    Server Error
Caused by:

java.lang.ClassCastException
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"}}}}