HueEmulation and Google Home support

Just out of curiosity, has anyone gotten Google Home to set the brightness of a light? For the life of me I can not get Google Home to set of change the brightness of any of my dimmable lights. I keep getting a response saying “I am not sure how to do that right now.”

Same results here. Echo works as a dimmer, Google Home only seems to work on/off. I was assuming it was a Home problem, but lacking an actually Hue solution, I have no way to confirm, or troubleshoot. Some searching on the web does not turn up any obvious reports of a problem with Google Home, so I’m starting to think the problem is within the HueEmulation binding. For my purposes dimming is not a deal breaker, so I’m more than happy with the effort by @digitaldan

Don’t get me wrong the efforts of @digitaldan are much appreciated. I am going to do some digging to see why Google Home can not control the lights at the brightness level. I’ll be reviewing this code and a few other code bases to see if there is any differences. This would not be such an issue except that some of my zwave switches do not like my LED blubs at full brightness. They have a tendency to either stop communicating or flicker. If I tell Google Home to turn these lights on, she will turn it on at 100% and not at the brightness I would like.

Thanks for being so tenacious, if you find something it will benefit us all. If there are more jars to test I’m happy to oblige. Though, I did just give Alexa the ax, so I’m Google Home only going forward.

This might be due to the type of hue bulb we are advertising as. I have another branch which supports color commands that may help, but in any case I will try and take a look this weekend when I am back home.

@digitaldan Thanks for the update. I was thinking of the same thing. That is why I was going to have a look at the code between the Hue emulation plugin and others on the net to see if there are any differences. The main code base I wanted to focus on is the hue bridge I pointed to you earlier for the SDDP fix.

@digitaldan So some quick digging I found the following in the HA Bridge Code:

HA Bridge Hue API

"1": {
        "state": {
            "on": true,
            "bri": 144,
            "alert": "none",
            "effect": "none",
            "reachable": true
        },
        "type": "Dimmable light",
        "name": "Table Lamp 1",
        "modelid": "LWB004",
        "swversion": "66012040",
    }

DeviceResponse.java

public static DeviceResponse createResponse(DeviceDescriptor device){
        DeviceResponse response = new DeviceResponse();
        response.setState(device.getDeviceState());

        response.setName(device.getName());
        response.setUniqueid(device.getUniqueid());
        response.setManufacturername("Philips");
        response.setType("Dimmable light");
        response.setModelid("LWB004");
        response.setSwversion("66012040");
        response.setLuminaireuniqueid(null);

        return response;
    }

It looks like they are setting the manufacture to Philips and the type to Dimmable light. In the Hue Emulation plugin the manufacture is set to openHAB and type is set to Dimmable Light. The one issue with the type is that Hue Emulation has a capital L for light. Searching the internet, the l in light is lower case. I am not sure if this makes a difference. I am also not sure if the manufacture makes a difference as well. It appears that Google may be more script with there code when verifying the devices.

Hue Emulation HueDevice.java

public class HueDevice {
    public HueState state;
    public String type = "Dimmable Light";
    public String name;
    public String modelid = "LWB004";
    public String uniqueid;
    public String manufacturername = "openHAB";
    public String swversion = "66009461";
    public Map<String, String> pointsymbol;

    public HueDevice(HueState state, String name, String uniqueid) {
        super();
        this.state = state;
        this.name = name;
        this.uniqueid = uniqueid;
        this.pointsymbol = new HashMap<String, String>();
        for (int i = 1; i < 9; i++) {
            this.pointsymbol.put(String.valueOf(i), "none");
        }
    }

}
  • Garrett

Here is output from a Philips Hue Bridge that I retrieved from my parents house. The bulbs are standard Hue White A19 bulbs.

{
	"1": {
		"state": {
			"on": false,
			"bri": 254,
			"alert": "select",
			"reachable": true
		},
		"type": "Dimmable light",
		"name": "Kitchen Table Lamp 1",
		"modelid": "LWB014",
		"manufacturername": "Philips",
		"uniqueid": "00:17:88:01:02:7e:b5:8e-0b",
		"swversion": "1.15.0_r18729",
		"swconfigid": "D1D2055F",
		"productid": "Philips-LWB014-1-A19DLv3"
	},
	"2": {
		"state": {
			"on": false,
			"bri": 254,
			"alert": "select",
			"reachable": true
		},
		"type": "Dimmable light",
		"name": "Kitchen Table Lamp 2",
		"modelid": "LWB014",
		"manufacturername": "Philips",
		"uniqueid": "00:17:88:01:02:7f:87:d5-0b",
		"swversion": "1.15.0_r18729",
		"swconfigid": "D1D2055F",
		"productid": "Philips-LWB014-1-A19DLv3"
	},
	"3": {
		"state": {
			"on": false,
			"bri": 254,
			"alert": "select",
			"reachable": true
		},
		"type": "Dimmable light",
		"name": "Kitchen Island Lamp 2",
		"modelid": "LWB006",
		"manufacturername": "Philips",
		"uniqueid": "00:17:88:01:10:5c:ab:0c-0b",
		"swversion": "5.38.1.15095"
	},
	"4": {
		"state": {
			"on": false,
			"bri": 254,
			"alert": "select",
			"reachable": true
		},
		"type": "Dimmable light",
		"name": "Kitchen Island Lamp 3",
		"modelid": "LWB006",
		"manufacturername": "Philips",
		"uniqueid": "00:17:88:01:10:2c:ce:11-0b",
		"swversion": "5.38.1.15095"
	},
	"5": {
		"state": {
			"on": false,
			"bri": 254,
			"alert": "select",
			"reachable": true
		},
		"type": "Dimmable light",
		"name": "Kitchen Island Lamp 1",
		"modelid": "LWB006",
		"manufacturername": "Philips",
		"uniqueid": "00:17:88:01:10:2c:f4:4d-0b",
		"swversion": "5.38.1.15095"
	},
	"6": {
		"state": {
			"on": true,
			"bri": 254,
			"alert": "select",
			"reachable": false
		},
		"type": "Dimmable light",
		"name": "Master Bedroom Lamp 1",
		"modelid": "LWB006",
		"manufacturername": "Philips",
		"uniqueid": "00:17:88:01:10:40:49:bd-0b",
		"swversion": "5.38.1.15095"
	}
}
1 Like

Are the changes in HueEmulation to support Google Home part of the latest snapshot?

Hey all - Im expecting my Googl Home to arrive tomorrow here in Australia.

I’ve do have a couple of questions so I can quickly sell it to my wife.

To integrate this with my OH2 - do I just need to drop @digitaldan 's addin above? or do I need to run HABridge as well?

If its just the addin, I see that it must run on port80 …ive already got ngix running there, does anyone know a way to configure Nginx to passthrough everything on 80 to this binding? There is no other webservice other than the Nginx landing page…
or should I add a second IP address to the server and bind the HueEmulation binding to that?
( Im running on Debian Linux )

Secondly,
do I need to do something to my Items files to allow them to be seen by the binding?

Cheers,
Greg

ignore my second question…just found the answer in docs.openhab.org :wink:

No, sorry, I have not had time to get a PR made yet, I will try this weekend.

I’ve just received my Google home and beginning to set it up.
I have the jar above in my add-ons folder and the Google home sees it, but despite me configuring the plugn within paperui to be in link enabled, the Google home app (via https://hue-adapter.appspot.com/client/#/activate/pair) just sits there asking me to press the “pair” button on. The hue hub.

Am I doing something wrong?

Hey @greg, Am facing the same issue. Even though the OH2 picked up the jar from @digitaldan as i can see in console

openhab> list|grep -i hue
200 | Active   |  80 | 2.0.0.201611112128    | Hue Emulation Service

I also see in the openhab logs this message:

Started Hue Emulation service at /api

Am not able to discover devices either in alexa or google home.
@digitaldan, anything else that i can debug.?

Are you getting anything if you visit port 80 and /api/discovery.xml? If not you will need to forward port 80 to the port the open-hab webserver runs on. Ive done it with this iptables command:
iptables -t nat -A PREROUTING -p tcp -d 192.168.1.6 --dport 80 -j DNAT --to-destination 192.168.1.2:8080

Openhab is listning to 192.168.1.2:8080, and since I have apache configured on port 80 on that IP I added a new IP, and forward port 80 on that to the openhab server:
ifconfig eth0:0 192.168.1.6

4 Likes

@staalebk, I was missing that part. Works perfectly now. Thanks a lot.

Woohooo…that fixed it for me also. Thanks @staalebk And thanks @digitaldan for creating this binding

:beers:

@digitaldan Any luck with having a look at the issue with the bulbs not being correctly identified with Google Home? I posted some things earlier that may help with how Hue Emulation binding is describing the lights. I noticed a type in the type being passed and a few other things that maybe Google Home is looking at to see if the lights are a dimmable light.

  • Garrett

I have not looked at it yet, I do have an branch from before working on the Google home that I believe would fix this ( was getting color working ), but have not had any time to work on this. Hopefully this coming up weekend I can take a look!

Is the binding in the repository not working yet?

I installed the binding through PaperUI and made the changes to IP-routing suggested above but there is no luck in finding the Google Home from the Android Phone app. When I look up http://my-routed-ip/api/discovery.xml I get the XML page with the HUE information.

Do you have any suggestions to what I can do?