HueEmulation and Google Home support

@digitaldan I have spent the last few hours trying to figure out where the issue happens, I would look at the discovery service (HueEmulationUpnpServer.java).

I did get Google Home working and it finds my devices perfectly. I wish I can say controlling them with Google Home is perfect, but for some reason Google Home does not like to have room names in the device names so control of my lights do not work or she turns on all the lights in the room. This is obviously a google issue. My issue is that I have different lights in different parts of the room. So I use the room name to distinguish the different lights. e.g. Master Bedroom Main Light vs Guest Bedroom Main Light. Hopefully google can fix this.

Let me know if there is anything you would like me to do. I am around if needed.

Thanks for your help. The changes to our SSDP message for home does not work for the echo, so it can’t find OH at all. if I can’t figure out what’s breaking it for the echo I may resort to sending multiple SDDP messages, the older version and the updated version for Home (and others?). I’ll play around some more.

@digitaldan Have you looked here to see if this information will help?

ha-bridge

That is very useful! My original idea about sending multiple SSDP messages was not so original :slight_smile: Thank for saving me a bunch of time!

I am glad I could be of help. I wish I could help further in the code department, but my knowledge of osgi, openhab2 binding development is lacking.

  • Garrett

can you try https://github.com/digitaldan/openhab2-addons/releases/tag/HueEmulator-google-home again?

@digitaldan I only see the jar posted yesterday.

  • Garrett

i replaced the jar with an updated one, but the release looks that same, it should work.

I think you got a winner! Both amazon echo and google home see both my devices. Just to be safe I removed the devices from Google Home and re-paired it with the hue emulation plugin. So far no issues.

Thanks again for all of your hard work!

  • Garrett

Hi @digitaldan, I’ve been lurking this thread. I also have both Echo and Google Home, and your latest jar seems to have things working on both platforms. Your efforts are much appreciated. Thanks

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