Official Google Assistant Integration for openHAB

I’m having exactly the same problem. I had 2 Ikea Tradfri bulbs set up about a month ago, everything was great. I got a third recently. I didn’t know about asking google to “sync my devices”, I went with what I thought was the only way which was unlink and re-link. So, I know the items file was right (something I’ve seen other comments on), because it was right for the two existing bulbs. Unlink went fine, the two lights went away, but relink does nothing. I click openHAB, it takes me through to log in to myopenhab, I click Allow for OAuth2, and it says it worked and redirects back into the Google Assistant app (I’ve tried on both iOS and Android devices). In myopenhab, I can see the app authentication show up, but in Google Home/Assistant, no bulbs come back in. And if I go back to Manage Accounts, openHAB doesn’t show as “linked”.

Here’s my items file that was working (without the new bulb in it, just the way it was before unlinking, the file that was “working fine”):

    Dimmer BackHallLight1_Brightness "Back Hall Light 1" <slider> (BackHallLights_Brightness) ["Lighting"]
    Dimmer BackHallLight2_Brightness "Back Hall Light 2" <slider> (BackHallLights_Brightness) ["Lighting"]
    Dimmer BackHallLight1_ColourTemperature "Back Hall Light 1 Colour Temperature" <colorpicker> (BackHallLights_ColourTemperature)
    Dimmer BackHallLight2_ColourTemperature "Back Hall Light 2 Colour Temperature" <colorpicker> (BackHallLights_ColourTemperature)

    Group BackHallLights_Brightness "Back Hall Lights" <slider> ["Lighting"]
    Group BackHallLights_ColourTemperature "Back Hall Lights Colour Temperature" <colorpicker>

Anyone have any ideas what could be going wrong?

@MARZIMA Awesome work! Any ETA on the Thermostat and CurrentTemperature - and possibly other - tags? I noticed a ‘scene’ icon for Philips Hue lights in Google Assistant. Would be awesome to have a similar tag for openHAB as well!

4 Likes

Yep. You can follow this issue.

Fantastic job with everything, and I’m really happy the work is ongoing to improve things.

My only issue is that the bindings for Google Home, Alexa, and Siri all follow the same protocol with the tagging, however they each interpret things differently, sometimes incorrectly. This makes it so I would label things one way for Google Home but another for Alexa. It would be nice if these were separate, as the way things are now it is difficult to use a combo of the technologies together without making some unnecessary compromises.

Anyone else have the issue of using more than one of these voice services?

Thank you very much, lights are working excellent even with italian commands.
Is there a way / workaround to use rollerupshutter?

Anyone able to help me?

I try to link my accounts together via iOS assitant app…but it will not work…

Carsten,

A strategy I used was to untag (or remark out) all HomeKit items. Make sure you have no temperature control tags - I think only Lighting and Switchable (maybe color, but I’d try that after).

Once you get the initial link up, you can slowly re-tag or un-remark the items and just say “hey Google sync devices”. Keep an eye on your device if they suddenly all disappear whatever you just untagged is causing the issue (usually an unsupported/misspelled tag).

Best of Luck

Definitely make sure you ONLY have Lighting or Switchable tags (for now, until the action gets upgraded and approved by Google)…Follow my how-to topic/video for specific connection info:

1 Like

Gents, i created all my things (items) in paper ui.
How do i edit the tags?
Tag editing is greyed out in habmin.
Editing the jsondb is not trivial either.
I want to get this working with my google home :slight_smile:

There is a new concept of thing metadata just for this purpose being worked on. Hopefully this helps. https://github.com/eclipse/smarthome/pull/4390

As far as I know, current way is to use karaf console … type smarthome:items addtag [Lighting]

1 Like

Cool. Still working out the specifics, I can see where some seemingly harmless choices now would make compatibility issues later. I’m sure every choice to be made is a simplicity vs. flexibility issue. Seems like it would have great potential if done right.

My fix for the very annoying “Couldn’t update the setting. Check your connection” bug:

I spent about 6 hours over 2 weeks trying to see why I couldn’t connect anymore after one successful connection. It turns out I deleted (commented out) an Item that had previously been tagged without deleting it from Openhab properly.

I figured it out by:

ssh -p 8101 openhab@localhost
openhab> items list|grep -i tag                                                                                  
lampDeck1 (Type=DimmerItem, State=0, Label=null, Category=null, Tags=[Lighting])
lampDeck2 (Type=DimmerItem, State=0, Label=null, Category=null, Tags=[Lighting])
lamp2FR_T (Type=DimmerItem, State=NULL, Label=FR Lamp Temperature, Category=hue, Tags=[Lighting], Groups=[ltgFR])

As you can see, lampDeck1 and LampDeck2 (which used to be Hue lights I replaced with a single Zwave switch) were still listed even though I had commented them out in the .items file. I’m guessing the State=0 or Category=null was throwing it off?

I uncommented it (it had not Tag anymore in the file) and was able to connect finally.

Success after long hours. I have to remember to check the console first when debugging, there’s a lot of info there that’s otherwise inaccessible.

Do i also need to tag the hue lights in the things file?

I really appreciate the work on this…instructions aren’t so easy to follow for nonprogrammers, tho. Is this the correct setup of the config.js file to use with myopenhab.org?

	host: 'myopenhab.org',
	port: 443,
	path: 'rest\items',

later on, the instructions say to run gaction commands and refer to a gaction CLI…here is the link for that: https://developers.google.com/actions/tools/gactions-cli

If you are working in windows, download the windows versions of gactions.exe and put it in the openhab-google-assistant-master directory, then you can run the gactions commands that are referred to in the instructions from the Google Cloud SDK shell.

When the instructions say “SSH into your openhab cloud instance” that means SSH into myopenhab.org on port 22? myopenhab.org is not accepting my user name and password when I do that.

Thank you.
This solved my issue but it wasn’t trivial.

I created my things with the auto configuration setting in paper ui but that wasn’t a good thing.
I deleted them and recreated them manually in the paper ui. Then i could create the tags in karaf console.

Something should be done to make this a bit easier honestly.
:slight_smile:

@Eikido Looks like you are the perfect candidate to test out my “Tag Control”.
Feel free to give me feedback on this

Hi Matteo, I’m trying to connect google assistant with openhab2 without success.
OpenHab application works properly on my Iphone, I added the following tag for single item I’m trying to connect:
Dimmer LivingRoom_Light “Tavolo [%d %%]” (LivingRoom) [ “lighting“ ] {channel="zwave…}

Unfortunately in google assistant after the add device process the openhab service is not listed and the “Tavolo” device is not reported in the list.

Could you help me on that?
Thank you

Watcht he case in your tag, @Giuseppe_Capodanno - it should be:

Dimmer	LivingRoom_Light	"Tavolo [%d %%]"	(LivingRoom)	[ "Lighting" ]	{channel="zwave…}

Copy that exactly and paste it into your items file (watch the “” quotes, because they’re different in the line you posted.

Hi. It also happened to me, i had to update google home to the last version [29 march] and it was solved.
But i’m on android.
This is a sample of a working items:
Switch LUCE_INGRESSO “Luce Ingresso” (Living, Lights) [ “Lighting” ] {bticino=“if=webserver;who=1;what=0;where=11”}