HueEmulation and Google Home support

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

I’m not sure if I’m doing something wrong here but here are the steps I’ve completed so far.

  1. Grabbed the latest .jar file from this thread.

  2. Went to PaperUI and found configuration under Configuration->Service->IO. Set Enable Device Pairing" to Pairing Enabled"

  3. Hit save and “Service Configuration Updated” showed on screen.

  4. Went to Home.items file and added this:

    Switch TestSwitch “Google Home Test Switch” [“Switchable”]

  5. Log file showed that my network status device link was removed, so I went to the BasicUI and it won’t load.

  6. Looked in console and found that all things in the home.items file were removed and now only paperUI works.

  7. Went to /var/lib/openhab2/hueemulation to look for items file and all that’s there is a udn file.

Did I declare something wrong? I don’t get syntax errors in the editor or in the logger when I save. I did have some initial trouble getting the .jar to run, I had to restart OpenHAB twice before my other bindings would run without throwing exceptions. Anything else I need to be doing?

Thanks,
Matt

The other strange thing I notice is that when I put the .jar file into my addons folder and restart openhab the log file gives me this error:

10:42:43.528 [ERROR] [urce.impl.DefaultResourceDescription] - /var/lib/openhab2/Home.things (No such file or directory)

When clearly the file is there, and then it won’t parse the file. Do I have a conflict with another binding? The other bindings I’m using are insteonPLM, harmonyhub, mqtt, nest, and chromecast

Everyone else seems to be having luck with this but I’m a little stuck. Any help is appreciated. Thanks! And just in case it’s pertinent, I’m running on a RPI3 with all the latest updates.

So I got to the point where the google home will pair with the emulator but it won’t discover any of the devices. I went to the ipaddress/api/discovery.xml and it show’s this:

{"lights":{},"scenes":{},"groups":{"1":{"action":{"on":false,"bri":0,"hue":0,"sat":0,"effect":"none","ct":0,"alert":"none","reachable":true},"lights":[],"name":"AGroup","type":"Room","class":"Other"}},"schedules":{},"sensors":{},"rules":{},"config":{"portalservices":false,"gateway":"192.168.1.150","mac":"B8:27:EB:A9:AB:80","swversion":"01036659","apiversion":"1.15.0","linkbutton":true,"ipaddress":"192.168.1.150","proxyport":0,"swupdate":{"updatestate":0,"checkforupdate":false,"devicetypes":{},"text":"","notify":false,"url":""},"netmask":"255.255.255.0","name":"Philips hue","dhcp":true,"UTC":"2017-02-08T23:09:16","proxyaddress":"none","localtime":"2017-02-08T18:09:16","timezone":"America/New_York","zigbeechannel":"6","modelid":"BSB002","bridgeid":"B827EBFFFEA9AB80","factorynew":false,"whitelist":{"88d74b29365345c9b64c4aa27b7da187":{"lastUseDate":"2017-02-08T17:55:40","createDate":"2017-02-08T17:55:40","name":"auto insert user"},"LZ4fRmwJqDjlyvGKG1B6UYHHv1VkkVZ7UywiYhi2":{"lastUseDate":"2017-02-08T18:02:16","createDate":"2017-02-08T18:02:16","name":"auto insert user"},"5d0a60e5a3194e3fb42be6003f6041b0":{"lastUseDate":"2017-02-08T17:57:33","createDate":"2017-02-08T17:57:33","name":"auto insert user"},"discovery.xml":{"lastUseDate":"2017-02-08T18:09:16","createDate":"2017-02-08T18:09:16","name":"auto insert user"},"a0104a4eeff44ef7afa6553160a34503":{"lastUseDate":"2017-02-08T18:05:15","createDate":"2017-02-08T18:05:15","name":"auto insert user"},"b95140d3b39246d8a3d90b687c529738":{"lastUseDate":"2017-02-08T17:57:33","createDate":"2017-02-08T17:57:33","name":"auto insert user"},"9d9cab6f045141869a2319a93af9a453":{"lastUseDate":"2017-02-08T18:05:15","createDate":"2017-02-08T18:05:15","name":"auto insert user"},"c095a2a9acbd4408a0e9a2720e197f16":{"lastUseDate":"2017-02-08T17:55:40","createDate":"2017-02-08T17:55:40","name":"auto insert user"}}}}

and when I look in the items file in the huemulation folder on the raspberry pi I see:

{"1":"TestSwitch"}

I only declared that one device so that makes sense but is there a reason the home won’t discover it?

Thanks,
Matt

I doubt it, but why not add a few more real lights?
What does your items file look like?

In my openhab2 configuration I have a Home.items file with the following item included:

Switch	TestSwitch	"Google Home Test Switch" (gAll) ["Switchable"]

I then save that file, stop the hueemulation binding and start it again, and some time later it generates the following items file in the hueemulation folder:

{"1":"TestSwitch"}

That is everything in that file.

When I go to the /ap/discovery.xml address the following is displayed:

{"lights":{},"scenes":{},"groups":{"1":{"action":{"on":false,"bri":0,"hue":0,"sat":0,"effect":"none","ct":0,"alert":"none","reachable":true},"lights":[],"name":"AGroup","type":"Room","class":"Other"}},"schedules":{},"sensors":{},"rules":{},"config":{"portalservices":false,"gateway":"192.168.1.150","mac":"B8:27:EB:A9:AB:80","swversion":"01036659","apiversion":"1.15.0","linkbutton":true,"ipaddress":"192.168.1.150","proxyport":0,"swupdate":{"updatestate":0,"checkforupdate":false,"devicetypes":{},"text":"","notify":false,"url":""},"netmask":"255.255.255.0","name":"Philips hue","dhcp":true,"UTC":"2017-02-10T13:50:15","proxyaddress":"none","localtime":"2017-02-10T08:50:15","timezone":"America/New_York","zigbeechannel":"6","modelid":"BSB002","bridgeid":"B827EBFFFEA9AB80","factorynew":false,"whitelist":{"88d74b29365345c9b64c4aa27b7da187":{"lastUseDate":"2017-02-08T17:55:40","createDate":"2017-02-08T17:55:40","name":"auto insert user"},"5fb224d9db1e4fc2a1a0862cc0a2a9e8":{"lastUseDate":"2017-02-09T08:35:03","createDate":"2017-02-09T08:35:03","name":"auto insert user"},"c586b817de014d6b9244a97d8bff0a92":{"lastUseDate":"2017-02-09T08:35:03","createDate":"2017-02-09T08:35:03","name":"auto insert user"},"d96f67bd8aed44ac991859082557d836":{"lastUseDate":"2017-02-08T18:11:10","createDate":"2017-02-08T18:11:10","name":"auto insert user"},"5d0a60e5a3194e3fb42be6003f6041b0":{"lastUseDate":"2017-02-08T17:57:33","createDate":"2017-02-08T17:57:33","name":"auto insert user"},"47f6c0d5a1a747bb869a2573fe1b84a0":{"lastUseDate":"2017-02-08T18:11:10","createDate":"2017-02-08T18:11:10","name":"auto insert user"},"b95140d3b39246d8a3d90b687c529738":{"lastUseDate":"2017-02-08T17:57:33","createDate":"2017-02-08T17:57:33","name":"auto insert user"},"LZ4fRmwJqDjlyvGKG1B6UYHHv1VkkVZ7UywiYhi2":{"lastUseDate":"2017-02-08T18:02:16","createDate":"2017-02-08T18:02:16","name":"auto insert user"},"discovery":{"lastUseDate":"2017-02-08T22:19:52","createDate":"2017-02-08T22:19:52","name":"auto insert user"},"discovery.xml":{"lastUseDate":"2017-02-08T18:09:16","createDate":"2017-02-08T18:09:16","name":"auto insert user"},"a0104a4eeff44ef7afa6553160a34503":{"lastUseDate":"2017-02-08T18:05:15","createDate":"2017-02-08T18:05:15","name":"auto insert user"},"9d9cab6f045141869a2319a93af9a453":{"lastUseDate":"2017-02-08T18:05:15","createDate":"2017-02-08T18:05:15","name":"auto insert user"},"c095a2a9acbd4408a0e9a2720e197f16":{"lastUseDate":"2017-02-08T17:55:40","createDate":"2017-02-08T17:55:40","name":"auto insert user"}}}}

I don’t see my item listed in there anywhere. The Home links to the emulator but won’t find the device and I’m pretty sure it’s because it’n not in the discovery.xml document. So is there a reason it would be added to the items file but not the discovery.xml document that the Home reads?

I’ll try adding more lights and see what happens but any suggestions, even if it’s just formatting, are appreciated. As a side note I’m using the .jar file from staalebk posted in this thread at this location: http://t0yen.asuscomm.com/org.openhab.io.hueemulation-2.0.0-SNAPSHOT.jar as I wanted the ability to command light levels.

Thanks,

Matt

I’m betting you have another hue-emulator thingy running on port 80.

I don’t :confused:
I have the following installed:
bindings: insteonplm1, nest1, ntp, chromecast, astro, mqtt1, network, harmonyhub
UI: paper, basic, classic
Voice: voicerss
Persistance: openhabcloud

And I have the hue emulator jar installed from this thread but that’s it. I did run the commands listed above to redirect port 80:

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

And I added an aliased IP address, but that was messing with my SSH abilities so I removed the aliased IP and reset the iptables back to default. Do I need to reroute and add an aliased IP if I’m not running anything else on port 80? Or is one of my bindings running on port 80 that I’m not aware of?

Do you get another response if you go to your_ip:8080/api/discovery.xml ?

Yup, I sure do, and my devices are listed there to. Plus it lists the manufacturer as Phillips. So what is causing the discovery to be listed on port 8080 instead of 80? And is there a way to take care of it that still allows me to SSH into the raspberry pi to do remote configuration? I may have messed up when trying to set up the iptables but I use SSH for all of my configuration.

As I said, you probably have another hue emulator running :wink: Perhaps outside of openhab?

AH I just remembered, I installed Ha-bridge. I’ll shut that down and see if that takes care of it.

You would still need to redirect port 80… So just run the iptables command with the one IP you have and it should work fine.
So; this command if your IP is 192.168.1.2:

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