Google Home - Actions (API) now available!

i am stuck in the last part “Account Linkage & OAuth2” too

is that i need to setup my own reverse proxy server for the action?
is there anyway much easier without setting up reverse proxy server? e.g. using myopenhab.org instead???

If you can wait for the official Google Assistant, It will be using the myopenhab.org website.
This is what I understannd from reading this thread

i got the same error as yours

“couldn’t update the setting”

you can try edit the file config.js in openHAB Google Assistant /functions

host: ‘myopenhab.example.com’,
port: 443,
path: ‘/rest/items/’,

then deploy the files to google cloud again and try

i found out the problem, and fixed, MAKE SURE the path is set to /rest/items/

you can try edit the file config.js in openHAB Google Assistant /functions

host: ‘myopenhab.example.com’,
port: 443,
path: ‘/rest/items/’,

Firstly… let me say a huge thanks to Mehmet. Sounds like you have had an interesting time both in the development and in real life. Very up and down and therefore all the more thanks for sticking with it.

Secondly, I’d like to offer any help I can. Not sure what I can do as a fairly new openhab user but if you need either testers or feedback I’m more than happy to give (unlike some people) constructive feedback.

Eagerly awaiting the Google approval for your action!I’m not a coder but am technically proficient so reading this thread has been Very interesting.

Thanks again and let me know if there is anything you need.

O Openhab2 and mosquitto running on pi zero w ON raspbian stretch
O Google home mini UK version
O Tasmota flashed sonoff devices all over the place!

Hello everyone,

i am still having bad luck. For me even when it seems like it is all working, it still doesn’t. So logs show that everything is completed properly.

    LEVEL  NAME                    EXECUTION_ID  TIME_UTC                 LOG
I      openhabGoogleAssistant  v3tw5diq3ahd  2018-01-25 15:05:16.953  openhabGoogleAssistant - syncAndDiscoverDevices - SYNC is adding: Entrance_Dimmer with tag: Lighting
I      openhabGoogleAssistant  v3tw5diq3ahd  2018-01-25 15:05:16.953  openhabGoogleAssistant - syncAndDiscoverDevices - SYNC is adding: ButtomCabinets_Switch with tag: Lighting
I      openhabGoogleAssistant  v3tw5diq3ahd  2018-01-25 15:05:16.953  openhabGoogleAssistant - syncAndDiscoverDevices - SYNC is adding: DiningArea_Dimmer with tag: Lighting
I      openhabGoogleAssistant  v3tw5diq3ahd  2018-01-25 15:05:16.953  openhabGoogleAssistant - syncAndDiscoverDevices - SYNC is adding: TVarea_Dimmer with tag: Lighting
I      openhabGoogleAssistant  v3tw5diq3ahd  2018-01-25 15:05:16.953  openhabGoogleAssistant - syncAndDiscoverDevices - SYNC is adding: BreakfastArea_Dimmer with tag: Lighting
I      openhabGoogleAssistant  v3tw5diq3ahd  2018-01-25 15:05:16.953  openhabGoogleAssistant - syncAndDiscoverDevices - SYNC is adding: Landscaping_Switch with tag: Switchable
I      openhabGoogleAssistant  v3tw5diq3ahd  2018-01-25 15:05:16.953  openhabGoogleAssistant - syncAndDiscoverDevices - SYNC is adding: Guest4Lights_Dimmer with tag: Lighting
I      openhabGoogleAssistant  v3tw5diq3ahd  2018-01-25 15:05:16.953  openhabGoogleAssistant - syncAndDiscoverDevices - SYNC is adding: KitchenTrack_Dimmer with tag: Lighting
I      openhabGoogleAssistant  v3tw5diq3ahd  2018-01-25 15:05:16.953  openhabGoogleAssistant - syncAndDiscoverDevices - SYNC is adding: Patio_Switch with tag: Switchable
I      openhabGoogleAssistant  v3tw5diq3ahd  2018-01-25 15:05:16.953  openhabGoogleAssistant - syncAndDiscoverDevices - SYNC is adding: BathroomCabinets_Switch with tag: Switchable
I      openhabGoogleAssistant  v3tw5diq3ahd  2018-01-25 15:05:16.953  openhabGoogleAssistant - syncAndDiscoverDevices - SYNC is adding: BedroomFan_Dimmer with tag: Switchable
I      openhabGoogleAssistant  v3tw5diq3ahd  2018-01-25 15:05:16.953  openhabGoogleAssistant - syncAndDiscoverDevices - SYNC is adding: Hallway_Dimmer with tag: Lighting
I      openhabGoogleAssistant  v3tw5diq3ahd  2018-01-25 15:05:16.953  openhabGoogleAssistant - syncAndDiscoverDevices - SYNC is adding: KitchenSink_Dimmer with tag: Lighting
I      openhabGoogleAssistant  v3tw5diq3ahd  2018-01-25 15:05:16.953  openhabGoogleAssistant - syncAndDiscoverDevices - SYNC is adding: KitchenCountertop_Dimmer with tag: Switchable
I      openhabGoogleAssistant  v3tw5diq3ahd  2018-01-25 15:05:16.953  openhabGoogleAssistant - syncAndDiscoverDevices - SYNC is adding: Bedroom2Lights_Dimmer with tag: Lighting
I      openhabGoogleAssistant  v3tw5diq3ahd  2018-01-25 15:05:16.953  openhabGoogleAssistant - syncAndDiscoverDevices - SYNC is adding: FrontDoor_Switch with tag: Switchable
I      openhabGoogleAssistant  v3tw5diq3ahd  2018-01-25 15:05:16.953  openhabGoogleAssistant - syncAndDiscoverDevices - SYNC is adding: BackyardSconces_Switch with tag: Switchable
I      openhabGoogleAssistant  v3tw5diq3ahd  2018-01-25 15:05:16.953  openhabGoogleAssistant - syncAndDiscoverDevices - SYNC is adding: Bedroom4Lights_Dimmer with tag: Lighting
I      openhabGoogleAssistant  v3tw5diq3ahd  2018-01-25 15:05:16.953  openhabGoogleAssistant - SYNC result: {"requestId":"4382706004076349964","payload":{"devices":[{"id":"Office_Dimmer","type":["action.devices.types.LIGHT"],"traits":["action.devices.traits.Brightness","action.devices.traits.OnOff"],"name":{"name":"Dimmer"},"willReportState":true,"attributes":{},"deviceInfo":{"manufacturer":"openHAB","model":"Lighting","hwVersion":"2.1","swVersion":"2.1"},"customData":{"itemType":"Dimmer","itemTag":"Lighting","openhabVersion":"2.1"}},{"id":"BackyardFlood_Switch","type":["action.devices.types.LIGHT"],"traits":["action.devices.traits.OnOff"],"name":{"name":"Switch"},"willReportState":true,"attributes":{},"deviceInfo":{"manufacturer":"openHAB","model":"Lighting","hwVersion":"2.1","swVersion":"2.1"},"customData":{"itemType":"Switch","itemTag":"Lighting","openhabVersion":"2.1"}},{"id":"BackyardFlood_Switch","type":["action.devices.types.SWITCH"],"traits":["action.devices.traits.OnOff"],"name":{"name":"Switch"},"willReportState":true,"attributes":{},"deviceInfo":{"manufacturer":"openHAB","model":"Switchable","hwVersion":"2.1","swVersion":"2.1"},"customData":{"itemType":"Switch","itemTag":"Switchable","openhabVersion":"2.1"}},{"id":"TopCabinets_Switch","type":["action.devices.types.SWITCH"],"traits":["action.devices.traits.OnOff"],"name":{"name":"Switch"},"willReportState":true,"attributes":{},"deviceInfo":{"manufacturer":"openHAB","model":"Switchable","hwVersion":"2.1","swVersion":"2.1"},"customData":{"itemType":"Switch","itemTag":"Switchable","openhabVersion":"2.1"}},{"id":"Guest2Lights_Dimmer","type":["action.devices.types.LIGHT"],"traits":["action.devices.traits.Brightness","action.devices.traits.OnOff"],"name":{"name":"Dimmer"},"willReportState":true,"attributes":{},"deviceInfo":{"manufacturer":"openHAB","model":"Lighting","hwVersion":"2.1","swVersion":"2.1"},"customData":{"itemType":"Dimmer","itemTag":"Lighting","openhabVersion":"2.1"}},{"id":"PatioLED_Switch","type":["action.devices.types.SWITCH"],"traits":["action.devices.traits.OnOff"],"name":{"name":"Switch"},"willReportState":true,"attributes":{},"deviceInfo":{"manufacturer":"openHAB","model":"Switchable","hwVersion":"2.1","swVersion":"2.1"},"customData":{"itemType":"Switch","itemTag":"Switchable","openhabVersion":"2.1"}},{"id":"Entrance_Dimmer","type":["action.devices.types.LIGHT"],"traits":["action.devices.traits.Brightness","action.devices.traits.OnOff"],"name":{"name":"Dimmer"},"willReportState":true,"attributes":{},"deviceInfo":{"manufacturer":"openHAB","model":"Lighting","hwVersion":"2.1","swVersion":"2.1"},"customData":{"itemType":"Dimmer","itemTag":"Lighting","openhabVersion":"2.1"}},{"id":"ButtomCabinets_Switch","type":["action.devices.types.LIGHT"],"traits":["action.devices.traits.OnOff"],"name":{"name":"Switch"},"willReportState":true,"attributes":{},"deviceInfo":{"manufacturer":"openHAB","model":"Lighting","hwVersion":"2.1","swVersion":"2.1"},"customData":{"itemType":"Switch","itemTag":"Lighting","openhabVersion":"2.1"}},{"id":"DiningArea_Dimmer","type":["action.devices.types.LIGHT"],"traits":["action.devices.traits.Brightness","action.devices.traits.OnOff"],"name":{"name":"Dimmer"},"willReportState":true,"attributes":{},"deviceInfo":{"manufacturer":"openHAB","model":"Lighting","hwVersion":"2.1","swVersion":"2.1"},"customData":{"itemType":"Dimmer","itemTag":"Lighting","openhabVersion":"2.1"}},{"id":"TVarea_Dimmer","type":["action.devices.types.LIGHT"],"traits":["action.devices.traits.Brightness","action.devices.traits.OnOff"],"name":{"name":"TV Area Dimmer"},"willReportState":true,"attributes":{},"deviceInfo":{"manufacturer":"openHAB","model":"Lighting","hwVersion":"2.1","swVersion":"2.1"},"customData":{"itemType":"Dimmer","itemTag":"Lighting","openhabVersion":"2.1"}},{"id":"BreakfastArea_Dimmer","type":["action.devices.types.LIGHT"],"traits":["action.devices.traits.Brightness","action.devices.traits.OnOff"],"name":{"name":"Dimmer"},"willReportState":true,"attributes":{},"deviceInfo":{"manufacturer":"openHAB","model":"Lighting","hwVersion":"2.1","swVersion":"2.1"},"customData":{"itemType":"Dimmer","itemTag":"Lighting","openhabVersion":"2.1"}},{"id":"Landscaping_Switch","type":["action.devices.types.SWITCH"],"traits":["action.devices.traits.OnOff"],"name":{"name":"Switch"},"willReportState":true,"attributes":{},"deviceInfo":{"manufacturer":"openHAB","model":"Switchable","hwVersion":"2.1","swVersion":"2.1"},"customData":{"itemType":"Switch","itemTag":"Switchable","openhabVersion":"2.1"}},{"id":"Guest4Lights_Dimmer","type":["action.devices.types.LIGHT"],"traits":["action.devices.traits.Brightness","action.devices.traits.OnOff"],"name":{"name":"Dimmer"},"willReportState":true,"attributes":{},"deviceInfo":{"manufacturer":"openHAB","model":"Lighting","hwVersion":"2.1","swVersion":"2.1"},"customData":{"itemType":"Dimmer","itemTag":"Lighting","openhabVersion":"2.1"}},{"id":"KitchenTrack_Dimmer","type":["action.devices.types.LIGHT"],"traits":["action.devices.traits.Brightness","action.devices.traits.OnOff"],"name":{"na
D      openhabGoogleAssistant  v3tw5diq3ahd  2018-01-25 15:05:16.956  Function execution took 416 ms, finished with status code: 200

Code 200: HOORAY!!!

However my app keeps showing: Couldn't update setting. Check your connection.

Any ideas???

YESSSSSSSS!!! Finally got it working. Must have only 1 tag per item. Multiple tags break linking!!!

@MARZIMA Mehmet, thank you for all the help and hard work you did to make OpenHAB supported with Google Home!

This community is awesome! Thats why I love OpenHAB.

2 Likes

Hmm! Now you got me to want to install it myself… is it pretty easy? Do you have any documents you saved while doing it? :slight_smile:

First one took me couple weeks. Second time I was doing it, took me about 1 hour.
I’ll post some notes I took when I get home.

1 Like

Thanks! If you’re able to do that i’ll probably attempt it myself and document it all for anyone else to do it more easily in the future.

2 Likes

That could be realy cool !!

I have a running myopenhab-instance on my own server that’s available via https.

When I try to deploy the action with

gcloud beta functions deploy openhabGoogleAssistant --stage-bucket staging.openhab-assistant-123123.appspot.com --trigger-http

I get an error:

ERROR: (gcloud.beta.functions.deploy) Failed to upload the function source code to the bucket gs://staging.openhab-assistant-123123.appspot.com/

I created a project called ‘openhab-assistant’ in GCP and the project id was generated as 'openhab-assistant-123123’
I did nothing else than creating this empty project.

What did I missed?

1 Like

@mashborn,
I think you should create a dedicated bucket.
I recognized that the readme doesnt explain the GCF stuff.
Try to follow this: https://cloud.google.com/functions/docs/tutorials/storage
and create a bucket e.g. _bucket and follow the deployment steps.
I had problems once with buckets. So make sure you have a payment method added. This is tricky as hell, otherwise exception in GCLI.

And you shouldnt need to create a GCP project, cause if you follow the steps in readme,
you will have a GCP project automatically. Since you are using Actions SDK of Google Assistant. Under the hood it generates the GCP project to host it there.
Hope this helps a little.

BR mehmet

You are welcome!

Dont forget to make a PR to the docu :slight_smile:
And feel free to contribute.

We are happy if you love openHAB. Giving my best, in the limited time I sometimes have.

BR Mehmet

1 Like

I have created the bucket in the project and enabled the payment-checkbox.

This command still throws an error:

gcloud beta functions deploy openhabGoogleAssistant --stage-bucket staging.[WHAT TO WRITE HERE?].appspot.com --trigger-http

Do I have to edit one of these before deploying?
image
image

EDIT:
it worked with

D:\Projekte\openhab-google-assistant\functions>gcloud beta functions deploy openhabGoogleAssistant --stage-bucket myopenhab-bucket --trigger-http

Deploying function (may take a while - up to 2 minutes)…done.
availableMemoryMb: 256
entryPoint: openhabGoogleAssistant
httpsTrigger:
url: https://us-central1-openhab-assistant-123123.cloudfunctions.net/openhabGoogleAssistant
labels:
deployment-tool: cli-gcloud
name: projects/openhab-assistant-123123/locations/us-central1/functions/openhabGoogleAssistant
serviceAccountEmail: openhab-assistant-123123@appspot.gserviceaccount.com
sourceArchiveUrl: gs://myopenhab-bucket/us-central1-projects/openhab-assistant-123123/locations/us-central1/functions/openhabGoogleAssistant-abcdefghi.zip
status: ACTIVE
timeout: 60s
updateTime: ‘2018-01-26T12:36:11Z’
versionId: ‘1’

1 Like

Now I’m at this point, too.


From where do I have to take these values?
Are Id and secret my logincredentials from my myopenhab-installation?
And wich URLs should I use?

I don’t understand the concept:

  1. Tried it with user and url of my myopenhab-instance - without success
  2. Tried it with https://us-central1-openhab-assistant-123123.cloudfunctions.net/oauth and Google-Credentials. Then came an error

Hi everyone I’m still pretty new too OH I’m planning on buying a GH Mini later today

I have had a quick read through this post there is so much information it’s hard to understand

my understanding is
theres an official binding in the pipeline?
Hue emulation no longer works?

In short what’s the process for adding it too OH now is this beta testing?

I only want too use the GH to send commands too OH & use its audio sink

You can already use the Google Home mini as audio sink with the chromecast binding. If you have any trouble with that, check this thread here: Google Home Goes 'Offline' and audio sink doesn't work

You should be able to send commands to openhab via IFTTT, but it will be much easier and nicer with the official openhab action, for sure.

2 Likes

Thanks for that

But there is an official binding on the way?

Not so much a binding, it’s a Google Assistant skill. You’ll authorize the Google account to use openhab and then the Assistant will be able to see specifically tagged items.