openHAB Google Assistant Integration v2.0

I was able to tag two locks and it works fine (Danalock v3). I do have a problem with groups tagged as Lighting which seemed to have disappeared. Single lighting items seem to work fine.

Thanks so much for this update. Iā€™m sad Iā€™m out of town for work this week and cannot begin testing immediately. Thanks again for all your hard work!!

https://developers.google.com/assistant/smarthome/traits - unfortunately, it appears Google still doesnā€™t want us controlling volume :smiley:

1 Like

Short questionā€¦
For the changes to work, will a user have to update openhab to latest build (or M5)? Or will it work with earlier version?

FYI, I now got all the grouped lights back again. No idea what was the problem.

No, itā€™s a server side change.

Thanksā€¦Thats what I thoughtā€¦ I just wasnĀ“t sure because the docs are changed (somehow prepare) for the metadata way, which should/will come later.

Actually I also tagged a Danalock, albeit through a proxy that only responds to the close command (in order to avoid that someone can open the door by voice command)ā€¦

I am curious @andres_meyer if it works for you through the Google smartphone apps as well as a speaker / display device? I see some long lasting complaints from people on the Google support groups (and Reddit) about issues related to this. For example:

https://support.google.com/googlenest/thread/9728622?hl=en

and

https://support.google.com/googlenest/thread/570067?hl=en

Since from the start, this is how I have defined all my thermostats. It has been working great in the Google home app, (not in Google Nest Hub though).
But after the update, it no longer works in the Google Home app either :frowning:
This is how all my thermostats are defined:

Group     g_Stortbad_TSTAT           "Stort Bad Thermostat"                                                                                         [ "Thermostat" ]
Number    stort_bad_Temperature      "Stort Bad Temperatur [%.1f Ā°C]"               <cu_heating> 	(g_Stortbad_TSTAT,Temperatur,gTvaer,gSugeTemp) 	[ "CurrentTemperature" ]   { channel="ihc:controller:elko:stortbad_temperatur_fb" }
Number    stort_bad_Tempsetpunkt     "Stort Bad Temperature setpunkt [%.1f Ā°C]"     <temperature>	(g_Stortbad_TSTAT)                              [ "TargetTemperature" ]	   { channel="ihc:controller:elko:stortbad_temperaturSet_fb", autoupdate="false" }

Did I miss or missunderstood something??

Yes, it works via the google assistant on my pixel 3, speaking or writing. The look in the google home app shows as ā€œnot configuredā€, with the cog wheel though, no idea why.

The tag for target temp may have changed. In the docs it says:

Number [ā€œhomekit:TargetTemperatureā€] as part of Thermostat.

It also says that Mode is required.

Number / String [ā€œhomekit:TargetHeatingCoolingModeā€] as part of Thermostat.
ā€¦
(Mandatory) Mode: Number (Zwave THERMOSTAT_MODE Format) or String (off, heat, cool, on).

I noticed that as wellā€¦ For some reason homekit: seems to have been added. Need to test it when I get home.

Yeah, this has been part of the docs from the very start. Mine has been working without from start. Infact when I did try to add a Mode, I got an error.
This Mode thing is really messing my head. I do not have a specific Mode in my setup. So I dont understand how to create it manually. I dont think the example is clear on this matter. It used to work as a default heating mode.

I just created a String Item tagged as the mode and leave it at that. Iā€™ve never set the Items to anything so they are still NULL. Without the Mode I has unable to ask about the humidity in various rooms.

Group vBasement_Thermostat "Basement" [ "Thermostat" ]

String vBasement_Mode "Basement Heating Mode [%s]"
    (vBasement_Thermostat) [ "homekit:TargetHeatingCoolingMode" ]

Number:Temperature vBasement_Temperature  "Basement Temperature [%.0f Ā°F]"
    <temperature> (gChart, gIndoorTemps, gResetExpire, gMaxTemp, vBasement_Thermostat, LowerFloorsTemps, vBasement_Items)  [ "CurrentTemperature" ]
    { channel="mqtt:topic:basement-sensors:temperature", expire="2m,state=UNDEF" }

Number:Dimensionless vBasement_Humidity     "Basement Humidity [%.0f%%]"
    <humidity> (gChart, gIndoorHumidity, gResetExpire, vBasement_Thermostat, vBasement_Items) [ "CurrentHumidity" ]
    { channel="mqtt:topic:basement-sensors:humidity",
      expire="2m,state=UNDEF",
      name="Basement humidity"}

Number:Temperature vBasement_Target_Temp "Basement Target Temp [%.0f Ā°F]"
    <temperature> (vBasement_Temperature) [ "homekit:TargetTemperature" ]

In the above, the Mode and Target_Temp Items are essentially unused but they are defined because GA docs say they are required. These Items just represent a DIY temp/humidity sensor.

Could you show me that string item? I really dont get itā€¦ I assume it would require a kind of value?

Nope. Just leave it NULL. The Item just has to exist. You donā€™t have to use it.

I added the Items above.

Hmm oddā€¦ I read the docs as it would need a valueā€¦

So I just need to change the TargetTemperature to [ ā€œhomekit:TargetTemperatureā€ ], and then add a ā€œfakeā€ String item for [ ā€œhomekit:TargetHeatingCoolingModeā€ ] for Modeā€¦
Will give it a shot in a coupple of hours when I get back home. Thanks Rich!.

If it does need a value, use the REST API to set the Mode Item to OFF or something reasonable. You donā€™t have to actually use the Item yourself though.

Let me ask about the following combination:

Contact MyLock "My lock" ["Lock"] {mqtt="<[broker:myHome/MyLock:state:default]"}
Contact MyWindow "My window" ["Window"] {mqtt="<[broker:myHome/MyWindow:state:default]"}

It is not supported now (only Switch or Rollershutter). But I would like to ask if my lock is locked or my window is open/closed. Contact is read-only and the only one proper question about this is: ā€œIs my lock locked/open?ā€, ā€œIs my window open/closed?ā€.

For now I have to create virtual switch and bind it with contact by appropriate rule and ask about my lock/window indirectly. ON/OFF and OPEN/CLOSED are incompatible.

Do you think is this valuable to implement it directly?

It seems like, if I dont set the item for something, when I start Google Home app, the Mode is set for ā€œsomething elseā€, and nothing seems to work except it read the setpoint (not the temperature).
Then I have the option to set it to either:
Heating Mode
Colling Mode
Heat&cooling mode
Off.
However it seems like the only one modes working is either cooling mode or heating mode and Off. Cooling&heating mode does not work.

On the Nest hub, it still doesnt work. It says Unsupported modeā€¦ I then have an option to set the mode Off. And then it only seems to read the temperature, (which makes sense, but since I just set the Mode via the Google Home app to heating mode, I dont understand how come it doesnt work).
IĀ“ll try if I can get the Rest Api to work, and the set the item to ā€œsomethingā€.

EDIT - Just as I thought. I cant get Rest Doc to workā€¦ How to update an item with using Rest Doc?

Why canā€™t you get the REST Docs to work?

Even without the REST Docs installed you can always make the calls to update the Item.

Or you can just create a quick System started Rule to update the Item with whatever.