HueEmulation and Google Home support

You should see JSON data when you point your browser to http://yourOpenhabServer/api/

This is where the smart home services of Google (and pretty much everything that uses hue) looks for the bridge.

I get this error in my brower when calling either http://openhabianpi:8080/api or http://openhabianpi/api :

{“error”:{“type”:4,“address”:"/api",“description”:“Only POST allowed for this resource”}}

Alright, so the Emulation Service is running at least.

/api/discover.xml

should give you something like this:

{
"lights": {
    "1": {
        "manufacturername": "openHAB",
        "modelid": "LWB004",
        "name": "Wohnzimmerlicht",
        "pointsymbol": {
            "1": "none",
            "2": "none",
            "3": "none",
            "4": "none",
            "5": "none",
            "6": "none",
            "7": "none",
            "8": "none"
        },
        "state": {
            "alert": "none",
            "bri": -1,
            "colormode": "ct",
            "ct": 500,
            "effect": "none",
            "hue": 0,
            "on": false,
            "reachable": true,
            "sat": 0,
            "xy": [
                0.0,
                0.0
            ]
        },
        "swversion": "66009461",
        "type": "Dimmable Light",
        "uniqueid": "1"
    },
    "3": {
        "manufacturername": "openHAB",
        "modelid": "LWB004",
        "name": "Flurlicht",
        "pointsymbol": {
            "1": "none",
            "2": "none",
            "3": "none",
            "4": "none",
            "5": "none",
            "6": "none",
            "7": "none",
            "8": "none"
        },
        "state": {
            "alert": "none",
            "bri": -1,
            "colormode": "ct",
            "ct": 500,
            "effect": "none",
            "hue": 0,
            "on": false,
            "reachable": true,
            "sat": 0,
            "xy": [
                0.0,
                0.0
            ]
        },
        "swversion": "66009461",
        "type": "Dimmable Light",
        "uniqueid": "3"
    },
                ...

Don’t worry if the line-breaks are different, the content should match, not the formatting. You should at least find some of your Items you tagged with Lighting or Switchable.

I got the links working, but my Google Home still cannot find the bridge. I also tried an older version of the Home app. How does your hue emulation config look like?

So when I connected to that url, I got the following errors in my logs:

2017-08-14 11:32:09.256 [WARN ] [eclipse.jetty.servlet.ServletHandler] - /api/discover.xml
java.io.FileNotFoundException: /var/lib/openhab2/hueemulation/usernames (Permission denied)
	at java.io.FileOutputStream.open0(Native Method) ~[?:?]
	at java.io.FileOutputStream.open(FileOutputStream.java:270) [?:?]
	at java.io.FileOutputStream.<init>(FileOutputStream.java:213) [?:?]
	at java.io.FileOutputStream.<init>(FileOutputStream.java:162) [?:?]
	at org.openhab.io.hueemulation.internal.HueEmulationServlet.addUser(HueEmulationServlet.java:574) [203:org.openhab.io.hueemulation:2.2.0.201708131155]
	at org.openhab.io.hueemulation.internal.HueEmulationServlet.service(HueEmulationServlet.java:250) [203:org.openhab.io.hueemulation:2.2.0.201708131155]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [32:javax.servlet-api:3.1.0]
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:845) [87:org.eclipse.jetty.servlet:9.3.14.v20161028]
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:584) [87:org.eclipse.jetty.servlet:9.3.14.v20161028]
	at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:71) [173:org.ops4j.pax.web.pax-web-jetty:6.0.6]
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) [86:org.eclipse.jetty.server:9.3.14.v20161028]
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548) [84:org.eclipse.jetty.security:9.3.14.v20161028]
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226) [86:org.eclipse.jetty.server:9.3.14.v20161028]
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180) [86:org.eclipse.jetty.server:9.3.14.v20161028]
	at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:284) [173:org.ops4j.pax.web.pax-web-jetty:6.0.6]
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:512) [87:org.eclipse.jetty.servlet:9.3.14.v20161028]
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185) [86:org.eclipse.jetty.server:9.3.14.v20161028]
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112) [86:org.eclipse.jetty.server:9.3.14.v20161028]
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) [86:org.eclipse.jetty.server:9.3.14.v20161028]
	at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:80) [173:org.ops4j.pax.web.pax-web-jetty:6.0.6]
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134) [86:org.eclipse.jetty.server:9.3.14.v20161028]
	at org.eclipse.jetty.server.Server.handle(Server.java:534) [86:org.eclipse.jetty.server:9.3.14.v20161028]
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:320) [86:org.eclipse.jetty.server:9.3.14.v20161028]
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251) [86:org.eclipse.jetty.server:9.3.14.v20161028]
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:273) [78:org.eclipse.jetty.io:9.3.14.v20161028]
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95) [78:org.eclipse.jetty.io:9.3.14.v20161028]
	at org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:93) [78:org.eclipse.jetty.io:9.3.14.v20161028]
	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.executeProduceConsume(ExecuteProduceConsume.java:303) [89:org.eclipse.jetty.util:9.3.14.v20161028]
	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceConsume(ExecuteProduceConsume.java:148) [89:org.eclipse.jetty.util:9.3.14.v20161028]
	at org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:136) [89:org.eclipse.jetty.util:9.3.14.v20161028]
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:671) [89:org.eclipse.jetty.util:9.3.14.v20161028]
	at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:589) [89:org.eclipse.jetty.util:9.3.14.v20161028]
	at java.lang.Thread.run(Thread.java:748) [?:?]

When I looked at the username file it was owned by Root (so was the items file). I changed ownership of both to openhab:openhab and no more error but still can’t connect (verified that url is reachable remotely ).

Thought I’d put this out there to see if it gets someone else further down the path.

For Domain/api/discover.xml
I get {“lights”:{}}

But google home still wont connect.

As there are more users having pairing issues is there some alternative solution to pair?

I’d your lights is really empty, you may have problems in your items file. Take the examples from the hue emulation openhab docs and paste them into your items file. There should be a lot more between those curly braces after ‘lights’.

When I do the http://openhabianpi/api/discover.xml

I get this

{“lights”:
{“tradfri_0220_mygateway_65537_brightness”:
{“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”:“Brightness”,“modelid”:“LWB004”,
“uniqueid”:“tradfri_0220_mygateway_65537_brightness”,“manufacturername”:“openHAB”,“swversion”:“66009461”,“pointsymbol”:
{“1”:“none”,
“2”:“none”,
“3”:“none”,
“4”:“none”,
“5”:“none”,
“6”:“none”,
“7”:“none”,
“8”:“none”}
},
“tradfri_0220_mygateway_65538_brightness”:
{“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”:“Brightness”,“modelid”:“LWB004”,
“uniqueid”:“tradfri_0220_mygateway_65538_brightness”,“manufacturername”:“openHAB”,“swversion”:“66009461”,“pointsymbol”:
{“1”:“none”,
“2”:“none”,
“3”:“none”,
“4”:“none”,
“5”:“none”,
“6”:“none”,
“7”:“none”,
“8”:“none”}
}
}
}

Does this look right for pairing with the Google Home?

I finally also got some similar values @ /api/discover.xml, but GH is still not pairing.

Question: will the heu Emulation be found also with the official philips heu app?

For everyone having issue; mine has been setup and working since the addon’s inception(at least 4 months).
For the last two weeks it just stopped working.

Maybe google updated the firmware or something, I dunno.
Alexa still works; all google home units do not.

Not good for new Owners.

What firmware is your Google Home?

My updated to Firmware version 1.26.93937 two days ago.

how does one get this info off the unit?

https://support.google.com/googlehome/answer/7365257?hl=en

This output looks right. The problem may the new firmware as @milty456 suggested.

I have sent my GH back to Google, because I am not satisfied with the functionality in Germany, yet. Will try again in half a year or so. Cannot try any more stuff for you guys, unfortunately.

I couldn’t find a single app, that work with Port 8080. Never tried it with Port 80, though.

Can’t get the firmware that way…i refuse to update my app so it basically blocks you from getting the firmware.
I need the old app to keep this working.
Fun fact…it magically started responding again last night after two weeks of not working.
Haven’t changed anything.

I know this issue hasn’t come up in a while but I wanted to reiterate the steps here because I have spent hours trying to figure this out. I made a few changes today and even though I had read this multiple times, I completely forgot about it and have run in circle for a few hours.

  1. Stop OH2 service
  2. Delete whichever entry in openhab2/userdata/hueemulation/items corresponds with the tag you removed from your .items file in /conf
  3. Restart OH2 service
  4. Celebrate

Thanks greg and HomeBoss for posting the fix!

I get this error when trying to update the iptable ->

modprobe: ERROR: …/libkmod/libkmod.c:557 kmod_search_moddep() could not open moddep file ‘/lib/modules/4.4.50-v7+/modules.dep.bin’
iptables v1.4.21: can’t initialize iptables table `nat’: Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.

os -> openHABian

Any help appreciated

Hi, I had HueEmulator (v2.00 from Digitaldan) up and running with my Google Home. Sudenly this stopped working.
Now I have reinstalled everything, but Google home app can’t find my google home, it redirect to account.meethue.com
Open 192.x.x.x\api/description.xml displays the xml.

Please help!

no one?