openHAB Google Assistant Integration v2.0

I think a clarification is necessary. When I said, “directly trigger”, I meant that I have Google Assistant sending commands directly to the Harmony Hubs (not through openHAB).

One downside of the native Harmony Hub interaction in GA is that it can only manage one hub. So, I actually use IFTTT to control the second hub, and it’s limited to turning activities on/off (which is all I need from it).

I don’t personally see value in trying to replicate the functionality of the GA/HH interaction in OH (turning on/off activities, changing volume/channels/inputs, going directly to favourite channels), some of which wouldn’t be possible. However, I recently added a fan with an IR remote to my system, and I’m controlling it via openHAB and a Harmony Hub. The same principle would work for changing activities if that’s all you want to accomplish:

  1. Create an unbound dimmer item to use as a proxy in Google Assistant as a fan, and define modes that correspond to specific numbers. This will enable you to give GA commands that are passed to OH as numbers from 0-100 (e.g. 0=off).
  2. Set up a rule that takes in the dimmer state and triggers an action specific to each state.

I’m not going to post the whole rule here, but I’ll start a different thread to share it (I was thinking about doing that, anyway).

@michikrug, are modes available for other item types besides fans and thermostats? The documentation only explicitly mentions those two types.

Thanks for the clarification. My use case was to manage multiple harmony hubs since the GA/HH integration was limited to one hub. I will have to explore a different route if not currently possible through OH then.

Yeah, I hear you. I kind of get it, because if two Harmony Hubs are on at the same time, Google wouldn’t know what to do if you said, “turn up the TV volume”. It’s already hit-or-miss with a single hub, in my experience.

I’m surprised that Logitech hasn’t adjusted it so that you can have multiple hubs in GA and must specify a target hub whenever you give a command (e.g. “turn up the volume on Living Room TV”). But I suspect that the vast majority of users have only a single harmony hub, in which case this wouldn’t be a priority.

It would be even better if a Google Home could be told to favour a Harmony Hub in the same way that it can favour specific cast devices, but I suspect that Google wouldn’t want to add partner-specific customizations for fear of pissing off other companies.

I’ll probably set up the activities for my second hub as I described above, so that I can ditch IFTTT completely.

For me the only voice commands that I really want are to turn on or turn off the activities that I have setup. Play and pause are nice too. I am following a few guides to setup multiple hubs through a shared home using my wife’s phone. I don’t know how it will react to the room aware commands though.

My fan actually uses the Harmony Hub buttonPress channel, and the same could be done for your purposes to get play and pause control. I’ll add that to the examples when I write up my tutorial.

We have speeds for FAN and modes for THERMOSTAT. Other devices / items currently have no support for modes.

1 Like

@michikrug @MARZIMA @allwhocouldhelp

I added a fan controller to my setup today and all went well - until I added it to my item list so I could control it via GA. When I did that all my items disappeared from GA! I tried updating all items as per the current examples and no luck. I tried restoring my old file and no luck. I can’t unlink my openhab from GA because it does not show up in the linked services because GA thinks it has no devices.

I’m linking to a copy of my item list with the fan in it - any suggestions are welcome.

Thank you for your assistance!

When you have one faulty line in your item file, all items will disappear. GA won’t recognise anything as there are no items. Check your item list in PaperUI and you’ll see avaiable items. Try to change this way:

Dimmer MasterBedFan "Master Bedroom Fan" { channel="zwave:device:c8787433:node6:switch_dimmer", ga="Fan" [ speeds="0=away:zero,50=default:standard:one,100=high:two", lang="en", ordered=true ] }

Well now my items are all showing up but my thermostat won’t work in GA - says “offline” even though I can see and control it fine from paperui.
Thanks for your help with the fan!

What I do not understand, you have Zwave thermostat and you try to set up homekit?
Check my thermostat setup. It is an Airconditioner (just skip the number mode), but the principle is the same:

My item file is very old. There was a point when the GA binding for thermostat would not work unless you had homekit tags on certain items. It would also break if you had them on other items. I probably need to re-do my entire item file. Just not sure where to start and what is the best options. That’s actually only one thermostat but when I set it up GA didn’t understand two setpoints so I had to split it into “heating” and “cooling” so I could control it from GA at all.

You need something similar to it:

Group g_Housecool   "House Cooling"    { ga="Thermostat"  [modes="your modes separated by comma,nospacesbetweenthem"] }

Number  CoolCurrentTemp " House Cooling Temperature  "          (g_Housecool) { channel="zwave:device:c8787433:node3:sensor_temperature", ga="thermostatTemperatureAmbient" }
Number  HouseSetTempCool " House Setpoint Cool "             (g_Housecool)  {channel="zwave:device:c8787433:node3:thermostat_setpoint_cooling", ga="thermostatTemperatureSetpoint"}
Number  Housecoolmode    "House A/C  Mode"   (g_Housecool)  {channel="zwave:device:c8787433:node3:thermostat_mode", ga="thermostatMode"}   

Mode change a little bit tricky, I had to install a virtual item and integrate it with a rule. Check it from my previous post. I think if you combine it this way it will work.

1 Like

Hi everyone,

I installed the GA some days ago. I have the following question. With Alexa ist is possible to group different items together. In my case I would like to put color temp and a dimmer to one group.

My config looks like this:

Group  gLight_L5                    "Gästelicht [%s]"         <lightbulb>   (gLicht_AZ)             { alexa="Endpoint.Light", ga="Light" } 
Dimmer OsrLight_L5_Dimmer		    "Dimmen"                  <slider>	    (gLight_L5)		        { alexa="PowerController.powerState,BrightnessController.brightness", ga="Light", channel="hue:0220: XXX:9:brightness" }			
Dimmer OsrLight_L5_Farbtemperatur	"Farbtemperatur"	 	                (gLight_L5)				{ alexa="ColorTemperature", ga="Light", channel="hue:0220:XXX:9:color_temperature"}

With Alexa I can control the grouped item like a charm. With GA I need to call the dimmer and color temp item separately. Can someone help? It should work like a heating thermostat in my opinion, shouldn’t it? Did I do sth. wrong from config point of view?

Thank you for your help.

Hi Martin,

currently. only the same type of items can be grouped together (one group -> one value) - with the exception of a Thermostat that has its very own special handling.
Creating complex structures with multiple different sub-items is unfortunately not supported so far.

If you like, please head to the GitHub repository and raise a feature request for your needs. Thanks.

For now, you would probably need to separate the brightness and color values from the group item using openHAB rules and apply them to the respective items.

Thanks for all your help so far but no matter what I do my thermostat either says “offline” or that it’s in “other” mode and I can’t control it from the Google home app or voice. I’m gonna throw a copy of my item file up when I get back to my computer in a bit see if anybody can figure out what I’m doing wrong.

edit : here is the item file

I think Aux-Heat mode is a problem. Pls check here from the avaiable modes what Google can recongnize: https://developers.google.com/assistant/smarthome/traits/temperaturesetting.html
If you would like to use Aux-heat, I think you need to use a kind of virtual item for google mode change and a rule when google changes the mode it changes the real item. There you can create a map what translate e.g. heatcool to Aux-cool. Till I had similar set up like yours without this solution it was not working.

Yes, as said before. Please stick to the official modes supported by Google (link shared by kovacsi2899). Also with the correct case (all lowercase).
You can use the mode mapping to reflect the modes supported by your device. Again, have a look at the documentation and ask again for help if necessary.

To map the default thermostat modes of Google (on, off, heat, cool, etc.) to custom ones for your specific setup, you can use the modes config option on the thermostat group. E.g. [ modes=“off=OFF:WINDOW_OPEN,heat=COMFORT:BOOST,eco=ECO,on=ON,auto” ] will enable the following five modes in Google Home “off, heat, eco, on, auto” that will be translated to “OFF, COMFORT, ECO, ON, auto”. You can specify alternative conversions using the colon sign, so that in the former example “BOOST” in openHAB would also be translated to “heat” in Google. For the translation of Google modes to openHAB always the first option after the equal sign is used. By default the integration will provide “off,heat,cool,on,heatcool,auto,eco”.

So let me make sure I have this right. I need to make all the modes lower case and use only supported mode names. To translate Google supported mode names to the ones my thermostat uses I use “=”? Do I have to have all modes that my thermostat supports in there or just the ones I will actually use? Like aux heat is not actually used. My “auto” is the same as Google’s “heatcool” so I just set it in my mode list as " heatcool=Auto" ? And can the new integration support two setpoints (one for heat and one for cool) on one thermostat?

Who is behind that tool?? Its asking for username/pw… I sure would like to know who has this tool before given my username/pw…

I was worried about this as well. It came from here