Google Home - Actions (API) now available!

Just a remark, can someone fix this link:
https://myopenhab.org/img/oauth2/google-assistant.png

It’s a missing icon when you visit https://myopenhab.org/applications

Stef

1 Like

The scope in the Google Action just needs to be “google-assistant”. The code you pasted in belongs in the My Openhab instance (type into console: mongodb, use openhab, ). However, if you don’t want to deal with development version it was approved by Google and should be available now in the Home App as of yesterday, I believe.

Hi,

I’ve made the following two changes and am currently getting “Account Linking Failed” after clicking Allow.
Is there any thing that I’ve missed?

db.oauth2scopes.insert( { name : “google-assistant”, description: “Access to myopenHAB specific API for Actions on Google Assistant”, } )
db.oauth2clients.insert({ clientId: “client id here”, clientSecret: “secret here”})

That explains why it’s working for you. The difference between autodiscovered and manual items files

I simply do not get it… Please elaborate…
You (@MARZIMA) makes a nice feature to the Google Assistant, spend alot (all) your free time on doing this, you get alot of grattitude for this… and his is what I don’t get…
Many people tres to hack your work, by doing workarounds and what not. There’s people who simply are so rude to you and your work, that they have to write about it IN YOUR OWN THREAD, and what do you, @MARZIMA get? Well do you get anyhing at all?
How can I be sure, that when I make a donation, that you get what you really deserve?

Thanx alot @MARZIMA for all the time you have put in to this, and all the writing, updates and so on that you have made along the way.

If any, I know the effort it takes to contribute to volunteering where your work are needed.

hey guys

i have made the changes in my openhab, now i only have switchable and dimmable, but i keep getting forbidden on the second authorization question. Any ideas??

I am not able to connect to the “Openhab” Action…

Delete the old test action…delete all applications regarding to google in myopenhab.org
Clear Cache of the apps…

still says: no connection possible check your connection…
tested with 3 devices android and ios…still no chance :frowning:
any idea?

I am happily using this now. Thanks!!!

I tried again and now it says, “Accounts Now Linked”, but then it fails to pull the items and says, “Something has gone wrong. Try again.”.
It works if I flick over to the Official one and MyOpenhab.org…so I must still be missing something on mine,

Chris,

Check your config.js, I have my url as “/rest/items/”. Also, for good measure plug the full URL into a web browser and make sure you get the JSON return. Also, watch your logs like a hawk on the cloud function.

Ryan

I found that all the tagged items must have a name, description to be recognized. Ofcourse you can only use supported tags (Switchable and Lighting) and tags must appear before channel configuration block. These changes and then restart made my setup work.

1 Like

is it possible that someone could show an example of tags in the items file? My openhab blows chunks every time i try to implement them, so I would like the chance to figure out what I am obviously doing wrong.

Switch Heating_GF_Stue “Living room Heat” (GF_Stue, Heating) [ “Switchable” ] {mqtt=">[mosquitto:/gulvvarme/gpio/0 -m:command:ON:0],>[mosquitto:/gulvvarme/gpio/0 -m:command:OFF:1]"}

yes! that works, thanks, not sure what i did wrong, may simply have been the location of the tag in the syntax

That is important - the tag has to be before your channel description ( square brackets before curly ones )

Sorry for asking again, but what about Roller shutters / blinds? I guess I could make a “pseudo item” (Switch Rollershutter_Kitchen_Switch [ “Switchable” ]), and a rule that closes/opens the shutters in response to the switch changing from off to on and vice versa. But the Google Assistants response might be a little off then? “Okay, turning off the …”?

1 Like

@MARZIMA

Great work, Mehmet!
We all thank you for your efforts!

However, I’d like to propose something…
What about ignoring tags that are not yet supported?
I’m using Google Home alongside Amazon Echo and I had to remove the tags like TargetTemperature to make it work…
I’m sure that they’ll be supported sooner or later, but in the meantime…

I keep getting "Something went wrong, Try again."
Right after hitting “Allow” I get a white page with “Accounts now linked” but a couple seconds later I get the something went wrong message. I am using IOS 11.2.5 on iphone 6.

I tried:

  • Clearing applications in myopenhab.org and trying again
  • Un-shared all my items to openhabcloud from openhab except for one (Switch testGswitch “Test Switch” [ “Lighting” ]).
  • Cleared all my items and events in myopenhab so all my previously existing items are not there, only testGswitch

I have tried all the combinations of the above with no luck. Please help.

Here’s an Insteon example:

Switch mKitchenUnderCounter "Kitchen Under Counter Lights" (mKitchen, lights) ["Lighting"] {insteonplm="24.31.81:F00.00.12#switch"}
Dimmer mKitchenCeiling      "Kitchen Ceiling Lights"       (mKitchen, lights) ["Lighting"] {insteonplm="23.9F.55:F00.00.11#dimmer,related=23.A0.D9+23.9F.C9"}
Dimmer mKitchenLamp         "Kitchen Lamp"                 (mKitchen, lights) ["Lighting"] {insteonplm="21.F6.AF:F00.00.13#dimmer"}


Thanks skimdankish. That has got me closer again. Google Home can now see and add my devices. The full URL to the rest api also returns all the items that I’ve tagged too as json.

When I attempt to turn them on and off I get an error "I’m sorry, there was an error and I’m unable to control your home device."
The cloud functions logs show a 404 error. I can’t work out what’s it’s trying to retrieve though.

D      openhabGoogleAssistant  tikmmkfl7req  2018-02-22 20:59:00.483  Function execution started
I      openhabGoogleAssistant  tikmmkfl7req  2018-02-22 20:59:00.510  openhabGoogleAssistant: Cloud function called:{"inputs":[{"intent":"action.devices.EXECUTE","payload":{"commands":[{"devices":[{"customData":{"itemTag":"Lighting","itemType":"Switch","openhabVersion":"2.1"},"id":"Light_Deck_voice"}],"execution":[{"command":"action.devices.commands.OnOff","params":{"on":true}}]}]}}],"requestId":"8260819171890989604"}
I      openhabGoogleAssistant  tikmmkfl7req  2018-02-22 20:59:00.510  openhabGoogleAssistant - turnOnOff reqCommand:{"devices":[{"customData":{"itemTag":"Lighting","itemType":"Switch","openhabVersion":"2.1"},"id":"Light_Deck_voice"}],"execution":[{"command":"action.devices.commands.OnOff","params":{"on":true}}]}
E      openhabGoogleAssistant  tikmmkfl7req  2018-02-22 20:59:01.629  openhabGoogleAssistant - turnOnOff failed: Error response 404
D      openhabGoogleAssistant  tikmmkfl7req  2018-02-22 20:59:01.631  Function execution took 1148 ms, finished with status code: 500