Google Home - Actions (API) now available!

Glad you have had some great news in your life :grinning:

I would like to join in and help with testing this as i just got a google home as well. Please let me know what you need on my end to add me to your testing group

there is no testing group anymore


1 Like

Is it possible to start test this.
Now i have setup Google Home - Harmony - Hue emulation - OpenHB 2 to get the functionality :slight_smile:
/Mike

now available ? should it show up on phones’ google home settings like the others do ?

You wouldn have to read the whole thread. Before comment


Hi Mehmet,

Hope you are doing great.

It would be great if you can please provide a quick update as to which phase are we at right now and let us know if you are facing some hindrance. In addition, please let us know if any help is required from any of us at the forum. I would be glad to help!

Keenly awaiting the API:slight_smile: Thanks in advance

Regards,
Kishan

1 Like

Hello @All,

I am happy to let you know that we finally submited the official openHAB Action for Google Assistant.
As soon the review process was successfully, I will let you asap know and you guys can all use the Google Assistant / Google Home Integration for openHAB. I had a difficult time (since I lost my father) and I hope this state of the Google Integration is acceptable and makes the community happy. Please remember I did this like other volunteers in my free time, next to my job, wife baby etc. I will try to improve it as much as I can, BUT from now on we also want YOU!
So please everybody willing to support and improve the openHAB Google Assistant Integration feel free to create Pull Requests to this repo and of course it is all open source (EPLv1):

CC @Kai, that you are aware of the progress and maybe we manage it to promote it with the OH 2.2/2.3 Release. Of course crossing fingers that Google will not be as Amazon Alexa Verification team and let us wait months. Thanks to @digitaldan who made the Alexa Skill and this served as a good starting point.

The latest version from github is already deployed and under Google verification process, so the latest version will include these small bugfixes/improvements (PRs):

Looking forward to your feedback as soon the openHAB Action is official. Until than my proposal is: Better use the time to get familiar with the code and help contributing :wink:

Thanks & BR
Mehmet

29 Likes

Thanks so much for your effort! Especially during this time when your personal life is so hectic. I hope that things are going well for you now! Enjoy the newest member of you family!

That is some great news !!!
Thanks very much for your work :wink:

Thank you for your effort and support :slight_smile:

Hi guys, I’m attempting to get the most recent release running to test with and help if I can. Am stuck with the Account linking page. If anyone could offer any tips on getting through that step I would be very grateful.

Thanks for all the hard work!

Same for me
followed the guide but got stuck on Actions on Google section

i put my url in action.json and invoke the upload
it asks for Oauth2 which i follow the url and enter the code but then get stuck with:

ERROR: Failed to update the app for the Assistant
ERROR: Request contains an invalid argument.
Field Violations:

Field Description

1 Query pattern contains invalid characters in custom intent ‘actions.intent.MAIN’: talk to
2017/12/05 16:55:20 Server did not return HTTP 200

Please read the whole thread. This is not currently working and will not be until google approve the action. Sit tight, it’s coming!

Hi Chris, I certainly did read the whole thread, a few times actually. I hate asking for help, but in this case, I just couldn’t figure out the oauth2 flow and where the values for account linking should come from.

The rest of the project is straight forward and very interesting. I would like to experiment with the code rather than be a burdensome end-user, but it seems I need a little help getting started.

I think, what he means, is that the error could be because at the moment you aren’t able to use the Action. There was a test run, but that has ended.
It has been submitted to Google now, we’re just waiting for it to be approved, then we should be able to integrate Google Home with Openhab. (Or rather, integrate Openhab with Google Home?).

So trying to set it up now might be futile, as it won’t be recognized as an Action for Google Assistant just yet.

So we just need to be patient. :+1:

@Ian_Bishop ,

I think the main problem for you is that you need to also understand the overall architecture.
You can play with the code and I will of course help you, but you need to read the readme. There you will see that ohcloud is the smarthome backend and you need to have a full instance of it tunning.
That means a SSL certificate based server in cloud with an HTTPs URL to be reachable in the internet.
Since you ask where you get thos account linkage from, I have the feeling that you werent aware that this is something you need to „wire“ together.
There is a tutorial at Google about oAuth 2 which could be a good start.

In short:
If you wanna use the code of openhab-google-assistant and openhab cloud to setup your private instance, you need to understand that it is a lot more to setup and make it run. As mentioned it all needs to be ssl protected, you need to understand the oAuth2 concept and how it is done by ohcloud, and last a clean setup of ohcloud with your own URL for the machine.

Hope this helped a little.

BR Mehmet

1 Like

Thanks for the reply. I had no idea I would have to run my own myopenhab.org instance to make this work. I assumed the google function could authenticate to the prod myopenhab.org using oauth2 and your account. Your notes above say:

  • Login at your Backend (e.g. myopenhab.org) with your username and password

Do the myopenhab.org guys need to authorize the google action first once it gets published to assistant?

@Ian_Bishop,

let me explain it this way:
If you want to have your openHAB, which runs locally at home, speak with Google Assistant you can

a) Wait for the official openHAB action and just set it up in the Google Assistant app (there everything is covered by the myopenhab.org cloud service)

b) You go advanced mode and use your local openHAB, make it speak with a backend of choice (e.g. openHAB cloud) which need to have OAuth2 capabilities etc. and „wire“ the Google Assistant Cloud to the Google Cloud Function code „openhab-google-assistant“ and that will need to speak to a fullfillment Backend (which is the cloud of ypur choice). And this Fullfillment Backend will actually fire requests to your local openHAB instance, controlling your items.

So you shouldnt go and just pick one piece without having all parts sorted out. My proposal go with the official openHAB action. If you know exactly what you are doing and have valid reason/concerns you can setup your own machines, which can be eg openhab cloud or anything else.

PS:
I think you should consider that the openhab foundation will not let anyones cloud function code make an OAuth authorization. Thats not the intention. You cant use „other peoples backend (myopenhab.org in this case)“ to be your OAuth Server. This you need to setup your own
if you go the „own instance and selfhosted for individual dev“ way. Otherwise your own version the cloud function could take myopenhab.org down. Despite this facts, Google wants Actions for smarthome systems
so what is your smarthome system? openHAB! So dont try to build what we made already available for you. Thats just my opinion. If you want to dev and want a setup to test the oh-google-assistant, you need to setup some own servers.

BR mehmet

3 Likes

Hello @MARZIMA.
Hope everything is going fine.

Can you please describe in details how to “wire” OpenHab Cloud and Google Assistant Cloud?
I have server that runs OpenHab, OpenHab Cloud and nginx proxy (with letsencrypt) in docker containers.
OH Cloud can access OH without any problems. config.json was configured as following:
“system”: {
“host”: “url_to_ohcloud.com”,
“port”: “443”,
“protocol”: “https”,


}

This gives me https access to my own OH Cloud (let’s say https://url_to_ohcloud.com), where I have a user promoted to admin (using makeadmin.js).

In addition to this, I have deployed openhab-google-assistant application. Which is visible in the list of devices in Home Control.

As I understand, the only thing is left to “wire” both apps to allow them communicate.
In https://console.developers.google.com/apis/credentials?project=myohproject I have created “Oauth Client ID” (Web application) with “Authorized JavaScript origins = https://url_to_ohcloud.com” and “Authorized redirect URIs = https://url_to_ohcloud.com/oauth2/authorize”.
In “Account linking” in Actions Project I set “Grant type = Authorization code”, “Client ID” and “Client secret” was taken from above, where “Authorization URL = https://accounts.google.com/o/oauth2/v2/auth” and “Token URL = https://www.googleapis.com/oauth2/v4/token”.

I’m sure config above is somewhere incorrect. Because when I’m trying to add new device and select “[test] openhab” it redirects me to login page of “https://url_to_ohcloud.com”. But after I provide login, it shows following error:

app-1 | Error
app-1 | at validated (/opt/openhabcloud/node_modules/oauth2orize/lib/middleware/authorization.js:134:36)
app-1 | at /opt/openhabcloud/routes/oauth2.js:111:20
app-1 | at model.Query. (/opt/openhabcloud/node_modules/mongoose/lib/model.js:4038:16)
app-1 | at /opt/openhabcloud/node_modules/kareem/index.js:273:21
app-1 | at /opt/openhabcloud/node_modules/kareem/index.js:131:16
app-1 | at _combinedTickCallback (internal/process/next_tick.js:73:7)
app-1 | at process._tickCallback (internal/process/next_tick.js:104:9)

Do you know what am I doing wrong? Could you please help me to fix this?