Google Home - Actions (API) now available!

@mashborn,
I think you should create a dedicated bucket.
I recognized that the readme doesnt explain the GCF stuff.
Try to follow this: https://cloud.google.com/functions/docs/tutorials/storage
and create a bucket e.g. _bucket and follow the deployment steps.
I had problems once with buckets. So make sure you have a payment method added. This is tricky as hell, otherwise exception in GCLI.

And you shouldnt need to create a GCP project, cause if you follow the steps in readme,
you will have a GCP project automatically. Since you are using Actions SDK of Google Assistant. Under the hood it generates the GCP project to host it there.
Hope this helps a little.

BR mehmet

You are welcome!

Dont forget to make a PR to the docu :slight_smile:
And feel free to contribute.

We are happy if you love openHAB. Giving my best, in the limited time I sometimes have.

BR Mehmet

1 Like

I have created the bucket in the project and enabled the payment-checkbox.

This command still throws an error:

gcloud beta functions deploy openhabGoogleAssistant --stage-bucket staging.[WHAT TO WRITE HERE?].appspot.com --trigger-http

Do I have to edit one of these before deploying?
image
image

EDIT:
it worked with

D:\Projekte\openhab-google-assistant\functions>gcloud beta functions deploy openhabGoogleAssistant --stage-bucket myopenhab-bucket --trigger-http

Deploying function (may take a while - up to 2 minutes)…done.
availableMemoryMb: 256
entryPoint: openhabGoogleAssistant
httpsTrigger:
url: https://us-central1-openhab-assistant-123123.cloudfunctions.net/openhabGoogleAssistant
labels:
deployment-tool: cli-gcloud
name: projects/openhab-assistant-123123/locations/us-central1/functions/openhabGoogleAssistant
serviceAccountEmail: openhab-assistant-123123@appspot.gserviceaccount.com
sourceArchiveUrl: gs://myopenhab-bucket/us-central1-projects/openhab-assistant-123123/locations/us-central1/functions/openhabGoogleAssistant-abcdefghi.zip
status: ACTIVE
timeout: 60s
updateTime: ‘2018-01-26T12:36:11Z’
versionId: ‘1’

1 Like

Now I’m at this point, too.


From where do I have to take these values?
Are Id and secret my logincredentials from my myopenhab-installation?
And wich URLs should I use?

I don’t understand the concept:

  1. Tried it with user and url of my myopenhab-instance - without success
  2. Tried it with https://us-central1-openhab-assistant-123123.cloudfunctions.net/oauth and Google-Credentials. Then came an error

Hi everyone I’m still pretty new too OH I’m planning on buying a GH Mini later today

I have had a quick read through this post there is so much information it’s hard to understand

my understanding is
theres an official binding in the pipeline?
Hue emulation no longer works?

In short what’s the process for adding it too OH now is this beta testing?

I only want too use the GH to send commands too OH & use its audio sink

You can already use the Google Home mini as audio sink with the chromecast binding. If you have any trouble with that, check this thread here: Google Home Goes 'Offline' and audio sink doesn't work

You should be able to send commands to openhab via IFTTT, but it will be much easier and nicer with the official openhab action, for sure.

2 Likes

Thanks for that

But there is an official binding on the way?

Not so much a binding, it’s a Google Assistant skill. You’ll authorize the Google account to use openhab and then the Assistant will be able to see specifically tagged items.

I’ve got a PR with an updated README on setting up the google-cloud functions. If something is wrong feel free to comment and I’ll update it

That being said I’m still getting failures in my cloud function:

Error: getaddrinfo ENOTFOUND https://openhab.thejholmes.com https://openhab.thejholmes.com:443
at errnoException (dns.js:28)
at GetAddrInfoReqWrap.onlookup (dns.js:76)
2 Likes

Thanks for the replys I have brought a mini and got the audiosink up and running can anyone recommend a decent wall mount for the mini

Thanks for contributing @holmes.j!!

I made some review and would be great if you can check them out.
Thanks for your help!

BR Mehmet

Great job. This was overdue. Thanks!

I’m happy with a 3d printed invisible wall mount from eBay… For 2 €

1 Like

That’s the sort of think I have been looking at one of the ones that hold the device in 3 places look pretty decent

Hi all,

and special thanks to @MARZIMA … great effort. However I’m stuck in the same position as others e.g. @holmes.j

Function execution took 521 ms, finished with status: 'crash'
Error: getaddrinfo ENOTFOUND https://MYCORRECTDOMAIN https://MYCORRECTDOMAIN:443
    at errnoException (dns.js:28:10)
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:76:26)

openhabGoogleAssistant: Cloud function called:{"inputs":{"intent":"action.devices.SYNC"}],"requestId":"16969298799395762247"}
	
Function execution started 

Where “MYCORRECTDOMAIN” is properly setup with Let’s encrypt certificates. It’s gcloud.mydomainname.de (no not seestaedt.de :wink: ) and I have even verified it with google search console and put it in the domain verification section in the google cloud console.

My own openhab cloud instance is working and I can see the exposed items (actually for testing purpose exactly one item). During the enrollment process on my Android Pixel 2 in Google Home my Openhab Cloud instance is properly logging the oauth requests.

I’ve set up the whole thing three times. I even switched from an AWS EC2 to a google compute instance for my own openhab cloud server to have it “internal” to Google.

Has anyone figured out a solution for this behaviour? As mentioned elsewhere in this thread I tried to switch from free trial to blaze plan a couple of times.

I tried a nslookup on the copy and pasted domain name from the log file above. I return the IP of my openhab cloud instance. And I even tried this nslookup from a google cloud base compute instance.

After spending two days on this I’m lost - I have no further clue what to do - any help would be appreciated.

Thanks Elmar

P.S. I thought about whether the deployment on a US based server but a german google assistant could be a problem
I tried to set the locale to DE-DE in the dashboard for testing the action - but google refused to set it to a german locale

I’ve emailed Firebase support about the ENOTFOUND issue. Will update this thread if I get any useful information.

@Elmar out of curiosity, what did you use for scopes? Did it work properly for you or did you have to employ the workaround?

Hi Jason,

I used google-assistant scope … and openhab actually presents me my custom descriptive string

Cheers Elmar

I am not sure,
but I remember you were looking for alternatives since you doubt „the App will get done“. Why you didnt do that? Iam serious! I doubt you found a free Google Assistant integration.

You imply ppl have to do a readme update in a way like it is „normal“ that you get served and it is overdue.

Again stay fair. If you want something - Do it yourself.

I am a bit confused about the latest status about the Google Home Action? What was the actuall status?
Still under review @Google?

Yes,
still under Setup.
They are setting up OH. I will make pressure tomirrow again. I cant do much more than that…
I think we are fine for the v1.0 release of the Action.

Sorry, but the ball is on Googles field.

6 Likes