Official Google Assistant Integration for openHAB

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”}

Thank you so much Bartus!
That worked! wrong double quotes where due to remote access to the file on windows system through teamviewer on an iphone…

Excellent! You definitely have to be careful with what tags you use (for now, you can only use Lighting or Switchable).

Also, after you’re done adding/modifying/tagging your items, just say “Hey Google, sync my devices” and that will make Google bring over any changes you make, you do NOT have to unlink/relink anymore.

After you’re done connecting everything, check out my post on scenes/routines, to make Google change all your lights with just one command :wink: 3 different methods to use scenes with Google Home & openHAB

Will do! thank you again!

Also experienced the “Couldn’t update the setting. Check your connection” bug on initially connecting. For me, I ended up adding labels and groups to each .items entries, which I hadn’t populated before, and that allowed the initial connection from Google Assistant to OpenHAB to work (I suspect it was the labels, but I didn’t check each independently). Just posting in case someone else is troubleshooting.

Hi,

unfortunately still no update - I found that some have mentioned invalid tags. Should REST API Tagging work with the google assistant integration or only “items” file?

Can somebody maybe post a working item (ideally rollershutter “Lighting” ;)) that I can verify, what’s going wrong for me?

Thanks

i got no example from my config, but REST API works well for google integration. You don’t have to set the tags in files

Thanks for the info…
is there any way to log what google is doing? Because everytime I want to start an action like “switch on kitchen blinds” google tells me to name the item.

All items are correctly shown in the google home app…

You can click on the menu bar in your Google Home app, and select “My Activity” - that will have a list of all commands you gave to google, and how it interpreted them.

I know I had issues with things sounds too similar to native GHome keywords. For example, when I said “Hey Google, turn on Wake Up” (one of my scenes), it kept recognizing that as me trying to set an alarm. I ended up changing the scene/item’s name to “Morning”.

Hi,

unfortunately google understood exactly what it was supposed to “switch on kitchen blinds”, but still responded “I have to know which device should be used. Please repeat the command naming the device”

[I had to translate to english so the actual english log will probably look differently]

Are the blinds a Dimmer item? You might have to try saying something like:

“Set Kitchen Blinds to 50%” – it’ll probably respond “Setting Kitchen Blinds volume to 50%”, but it’ll work :wink:

They are all set as “Lighting” - works like a charm with Alexa and openHab App…but google is weird :wink: