HueEmulation and Google Home support

FYI, I tried using HueEmulation for a bit and switched back to IFTTT: Simple way to use Google Home with IFTTT and myopenHAB. I found it to be more reliable and easier to create complex commands such as “OK Google, Turn on the kitchen table and ceiling lights”. As for speed it seems to be about the same speed since commands need to go to Google to be processed in both cases.

1 Like

Try some of the suggestions over at HA forum.



( I think both are also…“try old apk” )

Hopefully @MARZIMA will have something native and infinitely better for us with this work - no pressure Mehmet :wink: :

1 Like

@greg,

yeah! Thanks. I was busy this week and already managed to setup the Google example and make it run on Cloud side. Iam going to implement futher and make a WIP PR soon. Due to Ramadan, I got sometimes timing problems am :slight_smile:
I keep you updated. Later I will need help with testers of the Action…Going to notify.

3 Likes

Thank for your work. I’m available for testing. Feel free to contact me.

Next Week i am going to buy an GOogle Home for me aswell and then i am also interessted to test the integration:slight_smile:

Check out the news here: Google Home Integration.
It works pretty well in my tests, but I am clearly also impatiently waiting for @MARZIMA’s Google Home Action :slight_smile:

1 Like

Hello everyone,

I am the proud owner of google home since yesterday. GH now sees my devices over the hueeumu. Unfortunately I can not dimm the devices. I use Zwave dimmer from Fibaro. Alexa had no problem before. The devices are tagged with [“Lighting”]. I use the jar of @staalebk. The on and off function works via GH.
Where is my mistake and where should I look?

1 Like

What did you do so Google Home Pairs with OpenHAB Hue Emulation?

I’m use hueemulation. I just got it. I have the item file (C:\openhab\userdata\hueemulation) renamed to “item_old”, rebooted openhab. A new item file was created. After that, I’m stopped openhab deleted the new item file and rename the old (item_old) again in “item”. Now everything works.

Thanks

I used iptables on my openhabian to route port 80 to port 8080. This way, I neither need to run openhab as root, nor do I have to install a reverse proxy:

iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to 8080

It does not seem to have any (negative) side effects. Port 8080 continues to work, of course. Pairing worked instantly within Google Home App.

In which file has this line to be added for getting it to work?

It’s a Linux command. You log in to your system running openhab, become root and run the command.

To have it run on each reboot, you can append the line to /etc/rc.local. Be sure to place it before (over) the “exit 0” line in that file.

1 Like

Thanks
Now I can access e.g. paperui on both port 8080 and 80, but the the Google Home can still not find the hue-emulation on my RPI.
Do I miss something?

Your not alone it must be something else. I do hope that someone might be able to help us.

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?