Openhab and Google Assistant - Oauth2 Config


I’m attempting to configure my Google Homes to control my OpenHAB items. I have been following the instructions at , but have got stuck right near the end.

For the “Account Linkage & OAuth2” section, I need four pieces of information.
The authorisation and token URLs. Are these the URLs to my OpenHAB cloud instance?

Does anyone know where can I obtain the Client ID and Client Secret from?

Currently when I attempt to use the Web Functions app that I have created, I get a “Cannot GET /oauth” message. In this consistent with OAuth not being configured correctly?

since yesterday it finally works for me - after a lot of trial and error.
I used the credentials from

The credentials and the scope I had to enter in the MongoDB of my myopenhab-installation.


1 Like

Thanks Michael. I’m now much further along.
When “testing” my app, I get a login prompt from my OpenHAB Cloud instance, but, after logging in, I don’t get an option to authorize the app though. I get the following error.

Do you have any idea why I’m getting this?

“The credentials and the scope I had to enter in the MongoDB of my myopenhab-installation.” Did you do this during the authorizing stage in Openhab?

I switched from my Openhab cloud instance to and now I get a message saying “forbidden” when I login.

HI Michael,

Could you please tell me how to enter the credentials and scope in the MongoDB of myopenhab installation ?

Thanks and Regards,

I used these 2 commands:
db.oauth2scopes.insert( { name : “google-assistant”, description: “Access to myopenHAB specific API for Actions on Google Assistant”, } )
db.oauth2clients.insert({ clientId: “xxxxx”, clientSecret: “xxxxxxxxx” })

Hi guys,

I am attempting also to configure my google home to control my openHAB items. I 've also followed the instructions from with success but i got stuck on the same point.

Does anyone know how i can get the authorization code and the token from myopenhab?

I am getting bad request.

I’ve got wrong configuration?


Thanks in advance,

You should be following the instructions here. the instructions in the README on github are for when you are hosting your own instance of

Thanks a lot @rlkoshak. I think i took the hard way :stuck_out_tongue:
I follow the instructions and as myopenhab works properly the only think i had to do was to create an item file for my temperature sensor with a simple line:

Number Temperature “Temperature [%1.f °C]” [ CurrentTemperature", “Celcius” ]

After that i’ve added openhab in Google Assistant and after the authorization my item added properly and works perfect! :slight_smile: