Google Home - Actions (API) now available!

If youā€™re hitting the ENOTFOUND issue try removing ā€œhttps://ā€ from the host url in functions/config.js , it fixed the issue on my side, my config.js now look like this:

module.exports = {
                host: 'openhab.[MY_DOMAIN].com',
                port: 443,
                path: '/rest/items/',
};

I hope it help! I got the hint that the problem might be coming from the https after trying to do a DNS lookup for my domain on https://www.dnsqueries.com/en/dns_lookup.php , it didnā€™t worked with the https:// prefix.

And huge thanks to @MARZIMA for the hard work on this :slight_smile:

2 Likes

OMG OMG OMG it worked!

Drop the https for the win!

1 Like

Please help me what to enter here:

Tried the whole weekend without success.

Post #260 will help you

the ID/secret can be generated in the google cloud console ā€œAPI und Diensteā€ -> Zugangsdaten
There you have to create web application oauth credential - you can leave the URL stuff blank there

Youā€™ll also have to insert the token and id/secret to the openhab cloud mongo db ā€¦ Itā€™s somewhere in this thread

@sebmarchand you are the one

Big kudos to you ā€¦ that fixed it

1 Like

Hmm, whats wrong now?
One last step is missing :frowning:

I have same issue. I have done own cloud instance as per instructions but now facing issues related to oauth2 configuration and local openhab not connecting to my cloud instance. Local instance is able to connect myopenhab cloud instance. Suggest me - how to enable oauth2 on my cloud instance and local openhab connection with own AWS cloud instance

I have been running openhab google assistant for 2 months now. Since a lot of people are waiting for Google, I just want to mention:

  • You donā€™t need any cloud service provider; no need for Google Cloud Services
  • You can run your own openhab-cloud locally

As a matter of fact, I am running openhab-cloud and openhab google assistant on the same raspberry pi with very good performance.

Of course some adjustment to the source code are needed.

Thanks for the infoā€¦ I have been wondering that very thing since watching this thread for some time. I have just bought a home mini and would like to use it with Openhab but I donā€™t want to connect to any cloud servicesā€¦ although of course you need to connect to google itself. Iā€™m in Australia, and the latency to US servers is a consideration, and the more intermediaries I have to use the slower it gets.

Have you created, or is there otherwise documentation on how to do the method you describe?

First, letā€™s talk security. To be safe, you need at least 2 routers/switches. The openhab-cloud/openhab-google assistant will seat behind your modem/router with the necessary ports opened. Your openhab server seats behind the second router, no port opened.

  1. install openhab-cloud first
  2. deploy openhab google assistant afterwards on the same machine

When you say ā€œsecond routerā€, what exactly do you mean? I have a single router (gateway) that my openhab/raspi sits behind.I havenā€™t installed openhab-cloud (in fact I dont even know what that is) but I can do so if its required. I have port forwarding on my router for incoming OH connections.

actuallyā€¦ minor correctionā€¦ my OH is running on a Pine64, not the raspi.

Thatā€™s good. You are able to configure everything.

I have an issue with Assistance account linking. I have provided endpoint as https://< cloud host >/oauth/authorize and error reported as Cannnot GET /oauth/authorize. Dont know how to enable oauth service on openhab cloud instance. Please suggest if any step missing

What does ā€œCannnot GET /oauth/authorizeā€ mean?

What do your openhab-cloud logs say? What about the openhabassistant function logs?

The more info the more helpful we can be.

What code changes and how do you deploy openhab-google-assistant locally?

Got something you can share? I have noticed a bit of latency, but I have a hard time imagining hosting it locally would improve many things. Iā€™d love to be wrong though.

in the attaed image thereā€™s my error message after oauth

Is there any guide in the net in order to set it up completely from scratch? Would be extremely appriciated!

Configured openhab-google-assistant with help of link https://github.com/openhab/openhab-google-assistant. Also, openhab AWS cloud instance configured as per link Githhub README.md

Checked openhab cloud logs and there is nothing for ā€œCannnot GET /oauth/authorizeā€. Logs as below

2018-01-30T08:23:31.132Z - debug: openHAB-cloud: Checking for offline openHABs (0)
2018-01-30T08:23:31.132Z - debug: openHAB-cloud: Checking orphaned rest requests (0)
2018-01-30T08:24:31.188Z - debug: openHAB-cloud: Checking for offline openHABs (0)
2018-01-30T08:24:31.189Z - debug: openHAB-cloud: Checking orphaned rest requests (0)
2018-01-30T08:25:00.452Z - info: openHAB-cloud: every5min statistics collection job started
2018-01-30T08:25:00.457Z - info: openHAB-cloud: every5min statistics collection job finished
2018-01-30T08:25:31.217Z - debug: openHAB-cloud: Checking for offline openHABs (0)
2018-01-30T08:25:31.217Z - debug: openHAB-cloud: Checking orphaned rest requests (0)
2018-01-30T08:26:31.277Z - debug: openHAB-cloud: Checking for offline openHABs (0)
2018-01-30T08:26:31.277Z - debug: openHAB-cloud: Checking orphaned rest requests (0)
2018-01-30T08:27:31.326Z - debug: openHAB-cloud: Checking for offline openHABs (0)
2018-01-30T08:27:31.327Z - debug: openHAB-cloud: Checking orphaned rest requests (0)
2018-01-30T08:28:31.374Z - debug: openHAB-cloud: Checking for offline openHABs (0)
2018-01-30T08:28:31.374Z - debug: openHAB-cloud: Checking orphaned rest requests (0)
2018-01-30T08:29:31.430Z - debug: openHAB-cloud: Checking for offline openHABs (0)
2018-01-30T08:29:31.430Z - debug: openHAB-cloud: Checking orphaned rest requests (0)
2018-01-30T08:30:00.463Z - info: openHAB-cloud: every5min statistics collection job started
2018-01-30T08:30:00.471Z - info: openHAB-cloud: every5min statistics collection job finished
2018-01-30T08:30:31.461Z - debug: openHAB-cloud: Checking for offline openHABs (0)
2018-01-30T08:30:31.462Z - debug: openHAB-cloud: Checking orphaned rest requests (0)

Also checked nginx openhab-cloud.org-access.log as below but no error
80.213.114.104 - - [30/Jan/2018:06:34:47 +0000] ā€œGET / HTTP/1.0ā€ 400 682 ā€œ-ā€ "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)"
54.183.171.240 - - [30/Jan/2018:06:51:47 +0000] ā€œGET / HTTP/1.1ā€ 200 3504 ā€œ-ā€ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 S$
115.110.104.225 - - [30/Jan/2018:07:54:40 +0000] "GET /oauth/authorize?response_type=code&client_id= &redirect_uri=ht$
115.110.104.225 - - [30/Jan/2018:07:54:41 +0000] ā€œGET /favicon.ico HTTP/1.1ā€ 200 2180 "https://< host >/oauth/authorize?response_type=code&client_id=
115.110.104.225 - - [30/Jan/2018:08:27:37 +0000] "GET /oauth/authorize?response_type=code&client_id=< Id >&redirect_uri=ht$

Please suggest anything missing or need to check

This oauth issue has been resolved. Its my bad - in url added /oauth/ instead of /oauth2/

However, another issue still not resolved. Local openhab running on Raspberry pi is not connecting to my cloud instance but it can connect to myopenhab.org instance. Please suggest.

Have you set the openHAB cloud addon to point your myopenhab cloud instance? If not, do that.

Yes I did that. Whenever change the host name from OH cloud to my OH cloud host., log shows that ā€œShutting cloud serviceā€¦ā€ but no more logs to connect to my host. However, when I changed from my OH cloud host to myopenhab.org host then I can see logs that indicating ā€œShutting cloud instanceā€ and ā€œConnecting to myopenhab.org with client id ā€¦ā€

So openHab could addon configuration in place