Google Home integration without the provided OpenHAB Cloud

Hi everyone,

I have been playing around with HomeAssistant for the past few weeks and decided to give OpenHAB a try as I heard some good stuff about it.

As I have a Google Home Mini the possibility of Google Home integration was important for me to decide which tool I should be using in the end but I read that OpenHAB supports Google Home integration so I thought that would be fine.

As I started to set up the OpenHAB system and wanted to set up the Google Home integration, I noticed that I needed an OpenHAB cloud account in order to get this to work.

This by itself is no problem of course, but this indicates that all the communication between my Google Home and my OpenHAB server flows through the OpenHAB cloud that is provided by the developers.

In my configuration of HomeAssistant, I was able to set up Google Home integration by directly connecting to my own HomeAssistant server using my own ip-address/domain name.

This would be my perfered way as the connection between the Google Home and my home wouldn’t have any depedencies on other servers/services that could potentially go down in the future and will cause my Google Home integration to fail.

My question is whether this is a posibility with OpenHAB at all or if using the provided cloud service is the only option to achieve Google Home integration.

I’ve been trying to find more information about this but unfortunately wasn’t able to find much, so hopefully you guys might have some experience with this or have any ideas to overcome the provided cloud dependency.

Thanks!

Yes, you can implement your own cloud server:

Thanks for the reply. That sounds promising. Although I have my doubts about whether this is going to work together with the Google Home integration as the OpenHAB item in the Google Home app seems to be directly linked to myopenhab.org. Do you have any idea if this can be changed some way?

1 Like

There is Google twice in this sentence, what if Google goes down.
You’ll have to trust the openHAB cloud, very secure, very reliable and built to last
Remember that the openHAB community is going from strength to strength and the OH cloud is not about to disappear.

That’s not really an answer to my question but I agree what you’re saying to a certain extend.
The dependency to Google’s services is something that will always be there and stay there, of course. If those services go down, nothing works anymore. Over and out for Google Home.
But to be honest, I prefer only relying on one single depedency, as the entire configuration fails when only one single dependency fails.
On top of that, I have a bit more confidence in Google’s services staying up then OH’s (also looking at the future).

Don’t get me wrong, I think it’s absolutely great that developers like the developers of OH and HomeAssistant provide end-users with a way to eliminate many dependencies of services provided (and sometimes forced) by companies that sell smart devices, but why not take it a step further by eliminating all dependencies possible? I think HomeAssistant really took a smart move there, by allowing both a cloud-based solution for users that don’t want to deal with the hassle of setting everything up themselves and also allowing users to set it up themselves to eliminate all the dependencies if they wanted to.

So has openHAB. See openhab-cloud/README.md at master · openhab/openhab-cloud · GitHub and GitHub - openhab/openhab-google-assistant: openHAB Google Assistant: Actions on Google for openHAB and Securing Communication and Access | openHAB.

The biggest issue is there are lots of manual steps to get your own instance of openHAB Cloud to work with Google Assistant because you have to set up your own OAuth2 tokens and such. When using myopenhab.org it just works.

1 Like

I have always wondered how home assistant connects without a cloud, have u ever done it and how much work is it to get it running? Is it free?

I am more keen to move away from google home / Alexa and move towards something more along the lines of habot that looks to be fully cloudless. If you have not seen the videos of habot check them out.

Yes, I have set up Home Assistant to work with Google Assistant directly.

It’s a bit of DIY solution as you have to create a “Test Application” within Google’s API, but I think you should be able to do it within 30-60 minutes. You’ll link that test application to your own server running Home Assistant. Add the test application using the Google Home app on your phone and you’re pretty much done. There is a tutorial on the Google Assistant component on the Home Assistant website (https://www.home-assistant.io/components/google_assistant/). The only thing you have to keep in mind is that you’ll need an SSL certificate for your domain name as this is a requirement by Google, in order to link your test application to your Home Assistant server.

1 Like

I have successfully tested Google Home Integration without OpenHAB cloud using service called https://about.gbridge.io/
The Idea is that this service translates google home commands into MQTT messages and back. So if you have OpenHAB and, for example Node-RED for MQTT commands conversion, you can work without OpenHAB cloud.

The only problems is that gBridge service is not free, and unfortunately this is still 3-rd party service.

2 Likes

if still relevant: maybe if u set up your own dns server where u hard pin myopenhab.org to your local server? and you have to forbid every other dns requests other to your own dns server in your router settings otherwise google home etc. will use their own dns servers

does this mean I have to say something like “hey google, speak to home automation” followed by “close the blinds”?

No, you can just say “Hey Google, close the blinds”. You basically add those entities as regular devices that can be controlled using Google Home.

1 Like

Oh cool. I thought using a test application you always have to call the name of the app. Awesome

@Artyom_Syomushkin any instruction how to make this gbridge working wiht OpenHab?

Gbridge seems to die soon. So it’s not a solution.

I’m currently testing node-red-contrib-nora project for NodeRED, connected to my OH via MQTT. It’s quite easy to configure, but still requires external service.

How do you get the fulfillment URL?

1 Like

I’m a bit confused about this portion under the openhab-cloud docs.

Do I have to install this gactions CLI on the openhab-cloud server or is this something I can run anywhere, upload to google cloud, then forget about it?

Also, by uploading the function to google, does this mean I’ll be billed monthly for the storage/compute used?

Is there an option to run this function on the openhab-cloud server that I’m already setting up anyway?

Google Cloud Functions
Enable the Cloud Functions API and install the Google Cloud SDK by following this quickstart
gactions CLI (https://developers.google.com/actions/tools/gactions-cli)
curl -O https://dl.google.com/gactions/updates/bin/linux/amd64/gactions/gactions
chmod +x gactions
Modify functions/config.js
Change host to point to your openHAB Cloud instance, for example: openhab.myserver.com. Do not include https, if you do you'll get DNS errors.
Change path to the rest API. Defaults to /rest/items/.
Deploy the openhabGoogleAssistant (openHAB home automation) function:

Create a storage bucket (https://console.cloud.google.com/storage/browser)
cd openhab-google-assistant/functions
gcloud beta functions deploy openhabGoogleAssistant --runtime nodejs10 --stage-bucket <BUCKET_NAME> --trigger-http --project <PROJECT ID>
This commands will deploy the function to Google Cloud and give you the endpoint address.
Keep the address somewhere, you'll need it (something like https://us-central1-<PROJECT ID>.cloudfunctions.net/openhabGoogleAssistant).