Google Home - Actions (API) now available!

Yes. Re Meet Google, they will make end to end test. Just writing some docu together…so we can overjump official QA process…

7 Likes

Hey Marzima

Please don’t take the frustration/ignorance of others to stop your hard work. I and many others really do appreciate the work you are doing :grinning:

Best regards

Nick

19 Likes

Sorry guys. Will not happen again.

Thank you for all the work! It’s because of the people like you this community is so strong!

I used your suggestion to use Amazon Login for oauth service. Do we need to add Amazon Login SDK for JavaScript as described here to OpenHAB-Cloud?
Otherwise how does openhab-cloud knows that clientID and client secret are to be used via AWS?

Thanks a lot. Your post helped me get through some hurdles, however i am still not finished.

One thing, authorization url, is it /oauth2/oauth or /oauth2/authorize??

When using /oauth2/oauth, i am getting blank page, however when using /oauth2/authorize, i do get Allow/Deny page with message: "Application is requesting access to your account for the following scope: " And there is no name of scope. I added google-assistant to mongodb as scope and to google action linking as suggested by Mehmed @MARZIMA . I can still press allow, but after pressing the button, it says that “Couldn’t update the setting. Check your connection.”

Any suggestions much appreciated. Thank you all for help!

1 Like

I was using Google Home with IFTTT, but the problem is the latency, Google -> IFTTT -> Openhab cloud-> Local. I found the Openhab cloud to be a bit unstable with long latency at times.

So now my solution is IFTTT with web hook which connects to my local nodejs server, then it connects to the local openhab controller via REST API. I find this method to be quite snappy.

Hi,

You need to add this scope:

db.oauth2scopes.insert( { name : "google-assistant", description: "Access to myopenHAB specific API for Actions on Google Assistant", } )

In Actions Console add this:
Authorization URL: https://your-instance/oauth2/authorize
Token URL: https://your-instance/oauth2/token

I also have this error sometimes. This seems to be the app of Google.
Please retry and maybe we again should file an issue at Google Assistant Smarthome github?

BR Mehmet

Didnt understand this one. Can you explain more?
I am little confused :slight_smile:

@ALL,

lets wait until Google has setup openHAB and connected their test setup to the myopenhab.org service.
After that they gonna make a QA of our Action. As mentioned the official QA Testing way is much longer compared to the current approach for openHAB.

Everybody feel free to contribute to the Google Assistant integration here at https://github.com/openhab/openhab-google-assistant so as soon we go into further testing, maybe we can have as much as possible stable features in Version 1.0 of the Action. If not, we can extend the Action later everytime.

BR Mehmet

@MARZIMA

I’d love to contribute but am waiting for Google to approve first. I don’t really want to set up my own dev environment quite yet.

Does Google have to approve every update or can we just roll them out on our own schedule?

1 Like

Hey, don’t understand the trouble in here.
I am very pleased this project is active.

Thank you for your effort, I hope Google will do his job soon.

1 Like

Hello Mehmet,

Thank you for taking time to answer my questions. Sorry for not being more specific.

So, I am using Amazon Login for OAuth2.
Client ID amzn1.application-oa2-client.fc0ce1xxxxxxxxxxxxxxxxxxxxxxxxx
Client Secret 68531ff5c4f0afdcc6xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Added to MongoDB:
db.oauth2clients.insert({ clientId: "amzn1.application-oa2-client.fc0ce1xxxxxxxxxxxxxxxxxxxxxxxxx", clientSecret: "68531ff5c4f0afdcc6xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" })

Added to Google Account Linking:

Whitelisted at Amazon Login:
image

So, Google Assistant trying to authenticate with clientid and secret against OpenHAB-Cloud. How does OpenHAB-Cloud know that to verify information, it needs to use AWS. All we added are strings, without Amazon Login SDK they don’t mean much, correct?

Thank you!

Tadey

Hi @dapanda,

I am not sure why you add the allowed origin stuff.
You just need a ClientID and secret, add it in Actions Console and into OHC mongoDB. Than the trust is created…
I am not sure why you go with AWS here?
In your Google Cloud project (not Actions Console) go to API section. There you should find the OAuth web credentials (ClientID & secret) and those you need to use within Actions Console and for your own version of openhab-google-assistant and your OHC database OAuth.

BR Mehmet

Dont wait…they are on it.
Start contributing by setting it up. It is not that complicated to run it all locally.

Looking forward…

Thanks Mehmet, that makes more sense. I was just trying to follow github instructions and they mention Amazon Login:

I will give it a try again!

Tadey

Mehmet,

So using oauth google credentials got me another step closer. Now, application is authorized in openhab-cloud:

Clicked allow:
image

Showed up message that it is linking:

However then got a message that couldn’t update the setting:

I got “Lighting” tag on my items:
image

And got it shared to the cloud:

Looked at firebase logs:

Shows some dns.js error. After quick google search, found that some people fixed issue by starting billing. But I am already on Blaze plan. I got credit card on account. So, all should be good on that front:

Any ideas what that could be?

Thank you!

Tadey

Seems like the SYNC doesnt go through.
I am not sure what the DNS should cause for problems. It is difficult from remote to understand.
What does the CloudFunction Logs say? Check for the logs of Google Cloud Function (openHabGoogleAssistant function) at Google Cloud CLI?
When you deployed the openHabGoogleFunction, I hope you adjusted in the config the endpoint and the endpoint for /rest API. This should point to your instance URL.
Proposal for future:
Check logs of the Cloud Function, which should be always the first things when trouble shootung or posting here, than you might see that there is maybe your URL missing. Just assuming, not sure if it is sth else…Maybe you already checked those logs…

BR Mehmet

Thanks for all the help Mehmet!

I downgraded to Free tier and upgraded to Blaze again and DNS error disappeared. Weird.

However, now getting another error:

Cloud Assistant Action Log: 2018-01-17 23:24:54.616 CST
SYNC: Request ID 2008519581790820420 failed with code: BACKEND_FAILURE
Expand all | Collapse all {
insertId: "134r0neg43oghd4"
logName: "projects/openhab-gassist/logs/actions.googleapis.com%2Factions"
receiveTimestamp: "2018-01-18T05:24:54.630778793Z"
resource: {…}
severity: "ERROR"
textPayload: "SYNC: Request ID 2008519581790820420 failed with code: BACKEND_FAILURE"
timestamp: "2018-01-18T05:24:54.616508921Z"
}

So this is giving me BACKEND FAILURE. Does that mean issue with OpenHAB-cloud?

I hoping its both ways
So we can ask google whats the level in my water tank and will get a answer like 43%

Hello @dapanda.
I didn’t reply since you have got answer before I read your question. You are doing good progress!
I stoped on “Couldn’t update the setting. Check your connection.” Do you use docker for running openhab-cloud or you have installed it on the server?