HueEmulation and Google Home support

@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.

@jackdw - “Change the voice it speaks with” - You mean a male or female voice? or language?

You can set the spoken language but not as far as im aware male or female.

I dont know of a way to make it resume what it was doing before any announcements, I dont personally use it to play content on, at least not typically when i want it alerting me. Try saying “resume” or something like this…

Because the iptables administration package is not installed by default. :ghost:

@tdsheppard77 please execute sudo apt install iptables

Tried this again tonight and still not seeing the device, even though I can hit the end point.

Is there some trick to the Hue Emulator to make sure that the Google Home device can see it?

THANK YOU!!! After installing iptables I was able to run the command and now it works.

Many thanks @ThomDietrich and @greg

good stuff!

Hopefully all this will be rolled into the binding in due course.

Hope this helps figure out what the issue is.

Running Android 7 on my phone, default settings, latest update (jan 20 I believe).

Before running the pairing app on my phone from Google Home, I added this line to the logging config:

log4j.logger.org.openhab.io.hueemulation = TRACE, event, osgi:*

And I see a number of devices from existing machines broadcasting and such. When I hit the pair button in the google home-> hue bridge… nothing.

However, if I go to another program, UPNPBrowser, when I hit scan, it sends out the SSDP packet right away and I can see it in the logs.

Is it possible that the hue bridge is now using some other method of communication, hence the emulator is no longer working for me?

Perhaps try resetting your Google Home ?
Do you have an option of setting OH up on Linux?

Not at the moment… have a box ready to go, but won’t have any concentrated time for the next 2-3 months due to work and family commitments.

The thing that gets me is: from what I read here, I expected the Hue App as part of the google home setup to send a SSDP SEARCH to discover… the rest that I have read here supports that.

When I start the Google Home app, I see a SSDP SEARCH go out, probably to locate the Google Home itself. But after that no dice… will try resetting.