HueEmulation and Google Home support

@tdsheppard77 glad it provided some help.
I don’t have a google home nor am I using nginx, so cannot help with a step-by-steps

@staalebk Would you be so kind as to walk me through the steps on how you added the extra IP and then did the port forwards? I’m still learning linux.

You have to put the tag after the group listing like this:

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

To portforward i do this:

“sudo iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to-port 8080”

Any idea when this is going to get integrated with the main codebase?

1 Like

@digitaldan - Hi Dan , Can you advise when you can update the main codebase, so the binding shown in PaperUI will support Google Home, including the fix done by @staalebk ?

Also, can you advise if its possible to fix the binding so if a tag is changed (removed ) from an item the binding configuration is updated accordingly?

Cheers,
Greg

I’m having the same issue. I just got the hue emulation running last night. Everything was working great with Google Home. This afternoon (15 hours later) Google Home commands are not working. Google Home says it is turning the light on but the lights don’t change and I see nothing in the OH logs. Were you ever able to find out the root cause?

@sovertyvaried no, the problem still exists. The good news is that sometimes it will run for several days before failing and simply telling Google Home to forget hue then re-link fixes it every time.

Out of curiosity, how many devices do you have connected?

@Noircogi I have 22 devices connected to Google Home through the Hue Emulator. Re-linking did fix the problem for me but it is a pain. I like assigning rooms to devices in Google Home so I can say “Turn on the lights in the kitchen”. When re-linking, I lose all the room assignments and have to redo them. Too much trouble to do every few days.

Understood. Google Home is much better than Echo in this regard (in my opinion). If you tell it “Hey Google, Turn off the kitchen lights” if will turn off every device with “Kitchen” and “lights” in the name. (Echo will ask you which one you want) In my example above she would respond: “OK, turning six lights off”.

So I haven’t really needed to assign any rooms to get what I like by choosing the right names for the devices in my items file.

22 Devices doesn’t seem like a very large number so I doubt your 22 and my 61 are the real cause. I’m hoping that a google update will fix this, but I haven’t found a great place to even report the problem.

Can someone give step by step instructions to getting this to work on a raspberry pi? I’m still learning linux. I tried the iptables command but it says no such command exists. When I say step by step…i need to know the linux command to do what you are saying to do.

Similar question to Tommy.

Been reading this thread and others, and trying to set up a Google Home I just got as a present to work with OH2. It looks like this is the way to go, but getting confused over which parts to use.

Simple setup

  • have 3-4 ZWave devices being controlled through OH2.
  • using chromecast binding to talk to the GoogleHome, and it can play text on the GH device

Getting confused as to whether or not to use the Hue binding, the HA-Bridge solution, etc.

I would like to be able to ask it to control the lights (for now, more later), and it seems this is best thread for this endeavor. Am I correct? Is there a better thread?

@jackdw @tdsheppard77
Ill have a go at trying to let you know how to get your Google Home talking to Openhab.

So firstly - this only works with Openhab2.
You do not use the HA-Bridge nor do you the “Hue Emulation” installed in PaperUI (Add-ons/Misc ) - this version is older and does not contain all the bits needed for Google Home.
So if you have those, remove them.

The most current version ( as of today ) is the one available in this post:


specifically this jar:
http://t0yen.asuscomm.com/org.openhab.io.hueemulation-2.0.0-SNAPSHOT.jar

This you need to install into your Openhab2 addons directory.
For me, this is in /usr/share/openhab2/addons/

If this is successful, then in PaperUI - Configuration/Services/IO there should be a “Hue Emulation” - Click On Configure and “Enable Device Pairing”…set this to “Pairing Enabled”

Now you need to update your linux to forward port 80 back into OpenHab.
This post above explains it:


In short run this:

iptables -t nat -A PREROUTING -p tcp -d 192.168.1.6 --dport 80 -j DNAT --to-destination 192.168.1.2:8080

making any respective changes to your IP address.

Then lastly…for each of your items which you want to control via Google Home, you need to add tags:
( taken from the original binding wiki )
Switch TestSwitch1 “Kitchen Switch” [ “Switchable” ]
Switch TestSwitch2 “Bathroom” [ “Lighting” ]
Dimmer TestDimmer3 “Hallway” [ “Lighting” ]
Number TestNumber4 “Temperature Set Point” [ “TargetTemperature” ]

Add these tags and on the OH2 side i think you are done… ( i dont think any restarts are required.)

So then on your Android or IOS device within the “Home” app, select your Google Home device, click on the 3 dots, then “Settings”, “Home Control” - and go through the “Link the Philips Hue” wizard… it should find your Openhab Hue Emulator instance, and the devices ( items) you tagged.
Add them to rooms within the App if you want …this basically allows you to group items together so you can simple say “OK Google Turn on the kitchen lights” and as you can imagine all lights in the Kitchen "room"should turn on.

I personally, only control my zwave lights using Google Home. so the only tag i need to add is [ “Lighting” ]
I did have my garage door added, but then , understandably, i found that the command “Ok Google - turn off all the lights” also activated the garage door…not ideal.

There is a minor “bug” in the binding in that once you add a tag to the item, the binding associates that item into the emulation config, so if you later remove the tag the binding gets upset until you add the tag back… so if you need to clear the binding config, then simply delete the files in /var/lib/openhab2/hueemulation and restart OpenHab.

Hope this helps… its very cool when you get it working…and also bloody annoying when you’re entertaining and all your friends kids keep saying “OK google Turn on/off lights /play xyz song”… makes the house look like a nightclub! :wink:

1 Like

Also dont forget that you can use your Google Home to advise you any alerts eg: At 8pm, mine will anounce that ive left the garage door open
How to do this is found in here:

I got everything except the forwarding working. I’m still new to Linux.
When i run the iptables command it said no such command.

What OS version are you running? I use debian - in no linux expert either, but there may be an equvalent command on the version you are using

Very straightforward, ran into issue, but straightforward.

  • grabbed jar and placed it into addons directory
  • went to paper ui, and under Configuration | Services | IO it was listed
  • “Enable Device Pairing” set to “Pairing Enabled”, “Optional Discovery Address” and “Optional Discovery Port” left blank
  • Pressed save, and verified that Paper UI and saw “service configuration updated” bottom left.
  • Running on Win7, so did some research, and the equivalent of your port redirect is: “netsh interface portproxy add v4tov4 listenport=80 listenaddress=192.168.xx.yy connectport=8080 connectaddress=192.168.xx.yy”
  • Verified that by eliminating the :8080 in the url for the paper UI, and verifying it works properly
  • Follow the steps on the google home app that you mention, and when I try and add the philips hue, it asks me to press the link button to pair and it spins “forever”

In following the information, if I go to http://192.168.xx.yy/api/discovery.xml I find:

{“lights”:{“1”:{“state”:{“on”:true,“bri”:255,“hue”:0,“sat”:0,“xy”:[0.0,0.0],“ct”:500,“alert”:“none”,“effect”:“none”,“colormode”:“ct”,“reachable”:true},“type”:“Dimmable light”,“name”:“Office Light”,“modelid”:“LWB004”,“manufacturername”:“Philips”,“swversion”:“1.15.0_r18729”,“productid”:“Philips-LWB014-1-A19DLv3”,“pointsymbol”:{“1”:“none”,“2”:“none”,“3”:“none”,“4”:“none”,“5”:“none”,“6”:“none”,“7”:“none”,“8”:“none”}}}}

Am I missing a step? And hope this helps others…

I dunno. I used the openHabian to install it. so it’s Raspbian. Got this from the login screen.

Release = Raspbian GNU/Linux 8 (jessie)
Kernel = Linux 4.4.0-1-rpi2
Platform = Raspberry Pi 3 Model B Rev 1.2

Got that working before I tried the rest of the stuff. That was pretty seamless.

Is there any way to change the voice it speaks with? Is there any way to resume what you were doing before when you are done?

@tdsheppard77 - I would have thought iptables is available on Raspbian which is the basis of openHABian

All i can think of is that you may need to add sudo
ie:

sudo iptables -t nat -A PREROUTING -p tcp -d 192.168.1.6 --dport 80 -j DNAT --to-destination 192.168.1.2:8080

@ThomDietrich - Any ideas why @tdsheppard77 would be unable to run the iptables command - hes using openHABian.