Google Home - Actions (API) now available!


(Trey Sheldon) #303

As a Google employee, I can tell you that you won’t get very far with the agent as they should only give information about the approval process to the project owner.


(Mehmet Arziman) #304

Hi all,

I ve a hangout on Monday to clearify the QA process for our OH Action. Since we are not a regular smarthome system the QA needs to be handled differently. Actually checking the QA list and
if we are fullfilling these requirements.

So please stay patient, we are on it to get it through.

We just received 2 days earlier that excel what needs to work in the Action and were a little shocked about sending devices to google as we dont have own devices at OH. But Google is quite cool with OH and wants to support to make the Action happen.

So I just have this new infos and that normally QA is done by a partner company. And I hope we can take a short path with our demo server and the current version, send for verification.

@greg I was thinking if I should redo a small tesibg squad with 5 person. The problem is that people see to much info of the „production“ OH Action, which make me feet uncomfortsble with that approach.

FYI: The normal Smarthome Actions process includes sending devices to Google etc. So all the integrations already in assistant had way more time to go through QA process.

We need to approach this another way.
Kerping you all in the loop…

BR Mehmet


(Brett Hiltbrand) #305

I don’t know what kind of QA Google is looking for here, but I am a senior software quality assurance architect by profession, and I’m willing to help out where I can. I have 2 google homes and 2 google home minis, as well as a smartthings hub, wink hub, and iris hub. OpenHAB controls my UPB light switches and dimmers, as well as my garage doors so far. I can provide a fair amount of QA for various technologies available in the IoT space right now.


(Dominic Bonneau) #306

I know if we have something official it’s WAY more easy for the end user but Home Assistant have it done with OAuth Client ID. I know you did it but do you documented it ?


(Chris M) #307

Mehmet thats great news; there’s progress and a way forward.

It’s surprising this hasn’t come up already - I would imagine there’s a few other OSS software-only projects out there that want to integrate with Home. From what you say it sounds like they don’t have an internal procedure for OSS software at all yet. So evidently you might be paving the path for all the other community efforts!

Word of caution - since the openHAB Cloud protocols are well documented, if openHAB becomes the first OSS software project to be listed in the “home control” section in Google Home, you might end up seeing a ton of new signups from people who’ve written emulation layers so myopenHAB can control their other (not-Google-approved, non-openHAB) home projects. :slight_smile:


(Mehmet Arziman) #308

Hi,

as I understood from Google colleague, the home assistant way is not an „official way“, since the interaction etc with end users shouldnt require anyone to setup oAuth stuff etc.
Thats cool for us tech dudes, but we should have the official Action which is easy to setup and usable without being a Cloud /OAuth guru :slight_smile:

Yeah, I ve done that but only once pointing to the myopenhab reference hosting of the OHF.
Any of you willing to go the „own OHcloud installation way“ will end up dealing with OAuth & Security stuff by the way. For this folks we opensourced the implementation.

But this shouldnt be for normal OH DIY users, it is more for advanced people knowing what they are doing and of course not expecting 24/7 support and professional dev support.
I know sometimes people think OSS is free food and maintainers have nothing else to do than helping and implementing stuff people want, BUT always remember that we all together do this for the love of openHAB and in our free time, with getting no cent. So there is never 100% free food everywhere :slight_smile:

BR Mehmet


(Mehmet Arziman) #309

Thanks man! I will know more soon and get back if we need help!


(Nathan Stratton) #310

Will it be possible to use it without openHAB cloud? I am using the Amazon skill direct to my public IP on my openHAB box nginx port 443 with valid SSL certs and it’s working great. Would be nice if I can do the same thing with Google and skip the cloud connector.


(Mihir Patil) #311

Does that mean that there won’t be any official Google Home action?


(Nick) #312

Sounds like there will be, but the one that’s out isn’t official because it’s difficult to set up. Hopefully more info after today? Let me know if they need openHAB hardware. I can send them an old computer :wink:


(Rar9) #313

Would it be possible to record a short video on how to setup cloud authentication to get Google Home working before the official release, as we have been waiting for months now.


(Massimo) #314

Hi,
are the testing app and demo server offline now ?
I tried to resume the test app and re-link it from the Google Home app, but the OpenHAB test device is not found anymore in the “Add devices” list .
Can we have the test app available at least until Google will approve the OH Action ?
Massi


(Tadey Stasevych) #315

What exactly is needed in MongoDB for oauth2?
oauth2clients only has id and clientId_1, where do i insert secret?

This is the last step I got stuck on, please help.

Thanks,
Tadey


(Tadey Stasevych) #316

Viktor, how were you able to add ClientID and Secret into Mongo? Which collection? What was added for Scope?

Thank you,
Tadey


(Dennis Persinger) #317

To add the client ID and Secret, use the mongo CLI and enter:

use openhab
db.oauth2clients.insert({ clientId: “client id here”, clientSecret: “secret here”})

[Note that the “d” in clientId is lower case–that bit me also]

Now I’m stuck at what scope to add, as well as what to put for the “Authorized redirect URIs” field in the credential. Does anyone know?


(Tadey Stasevych) #318

Was anyone successful integrating Google Actions with private OpenHAB-cloud instance? I, as many others, am stuck on account linking using oauth2. Specifically, which attributes need to be added to MongoDB for authentication to work correctly. Please help!!!

Thanks,
Tadey


(Marcus) #319

I doubt that Marzipan will get his Google Home App released.

So maybe let’s look for alternatives.

What worked for me so far is to use the Logitech Harmony Hub. I am using it anyway to control my various monitors, cameras and receivers and it works quite well with Google Home.

In order to be able to control my HomeMatic CCU2 devices (e.g. lights) I just did the following:

  • Adding a dummy device to the Harmony Hub
  • Adding a few activities for the dummy device (e.g. switchone, switchtwo, …)
  • Added the HarmonyHub Binding to openHAB
  • Added rules for each activity with the appropriate commands
  • Created Google Home shortcuts like “Switch Lights on” --> “ask harmony to switchone on”

If you want to add just a few commands to GH and if you already have a HarmonyHub, I think that’s no bad solution.


(Dennis Persinger) #320

An update, since I spent some time with it yesterday. Here are all the elements that I configured.
Note that in the following, my private OH cloud is “myopenhab. example. com”.
config.js in the openhabGoogleAssistant Google Cloud function (lines 34 - 36):

 host: 'myopenhab.example.com',
 port: 443,
 path: '/rest',

[I’ll talk more about that " ‘/rest’ " below].

The API credential. Create an oauth client ID of type Web Server. Set name to whatever you want, and Authorized JavaScript origins and Authorized redirect URIs are set to https:// myopenhab. example. com.

Action Account Linking.
Grant Type: Authorization code
Client ID and client secret: the data from the credential you created
Authorization URL: https://myopenhab.example.com/oauth2/oauth
Token URL: https://myopenhab.example.com/oauth2/token
Scopes: any

Lastly, the mongodb additions. Using the mongo CLI, enter the following lines:

use openhab
db.oauth2clients.insert({ clientId: “client id here”, clientSecret: “secret here”})
db.oauth2scopes.insert({ name: "any"})

So after I did all of this and try to add the openhab “device” in the Android Home app, I get the error: “The application requested access to unknown scope”. Sticking in some debug stmts, the scope being passed from the cloud function seems to be null(!?). So I cheated :slight_smile:. In the google-cloud directory of you private cloud, edit the file routes/oauth2.js: Comment out line 121 (“scope = req.oauth2.req.scope;”), and insert the following line above it:

scope = 'any';

I’m certain that messing up some configuration above is what necessitated this, but hey, it works. If you do this, remember to stop and restart your private cloud to pick up the change.

After doing this, I get the OAuth2 authorization screen, I press Allow, and eventually get the message “Successfully linked [test] my test app to your account”. Hurray! Except that it didn’t actually add any devices!

I have a couple of sample devices with the [ “Lighting” ] tag. I tried exporting them in the openhab cloud connector binding (like you would for IFTTT). I tried substituting “/oauth2/token” for “/rest” in the cloud function config.js file (it no longer successfully linked at that point, so I think “/rest” is correct).

I’ll try poking around in the code and see if I can figure out where it’s hanging up, but I’m kinda stuck at this point. But close…


(Mike Klein) #321

but you can only talkt to the harmony in the US :frowning: Europe is currently not working


(Marcus) #322

You can, I am actually from Germany, but you need to set Harmony it to english.

Even though all of my OSes (Win, MacOS, iOS, Android) are setup in English (UK, not US) it was enough to select English for the Harmony Hub setup but of course you also have to select English for Google Home.

And yes, you have to speak in English to Google Home.

My Google Home setup controls the following:

  • A few Hue Lights directly via GH (e.g. “OKG TV Lights on”)

  • Chromecast Pro directly (e.g. “OKG show Mix Country on Youtube”)

  • A few monitors, outside security Cameras, IR HDMI Switch, VU Due and Teufel Decoder Station all controlled via IR Interface of the Harmony Hub (e.g. “OKG Show Cameras” or “OKG watch TV” or “OKG Chromecast on” (which switches one Monitor on and selects HDMI input to the Chromecast, switches the Teufel Decoder Station audio to the right channel).

  • And a few ‘artificial actions’ that connect the HarmonyHub to a few HomeMatic CCU2 Things via openHAB as described before (e.g. “OKG turn lights on”)

In the latter case, I am using a shortcut for “OKG turn lights on” to translate to “ask to harmony to switchone on”. “switchone” is a Harmony Hub action which just connects to a dummy Device. In openHAB I setup a rule like this:

rule "Rule Lights On"
when
   Item harmonyActivity changed to Switchone
then
   logInfo("Harmony", "1 Lights On")
   sendCommand(HM_LichtBuero,ON)
end

That’s basically all and working well. Also, no Oauth and myopenhab needed. All is running on my RasPi on the local Network and no ports have to be opened to the outside.

The only drawbacks I noticed:

  • Yes, of course, you need to talk to GH in English - which is my preference anyway but not applicable to everybody. But it’s easy to get used to and you also benefit from the better speech recognition and additional GH features which are yet only available in english.

  • You need to carefully pick names for the artificial Harmony Hub actions. Real names like “Office Lights” don’t work well so I decided to use “switchone”, “switchtwo” etc. and you always need two artificial actions. One to turn things on and one to turn things off. The PowerOn/Off event can’t be used.

  • It’s a bit odd when you ask “OKG lights off” and it replies with “Sure, asking harmony” and then harmony answers “turning switchtwo on”. But it’s really fast and I can live with that.

Hope this helps,
Regards,
Marcus