Setting up Google Actions for Assistant

Will this work now? Or do i have to wait for a new home assistant release? If it works, can anyone tell me how i would set it up? I cant find much information on how to set it up.

Go to the following link then click on the ā€œfiles changedā€ tab and then hit the ā€œviewā€ button to make things easier to read. That is what I did but I canā€™t get it to work on Hassio yet because it requires a modified init.py file in homeassistant/components/http, which I donā€™t have access to in hassio (I think).

edit: you have to create a bunch of files as well and place them in homeassistant/custom_component/google_assistant I am going to wait for saturday, I have all the preliminary stuff completed as per the setup but it will be easier once this component gets integrated into HA.

ok thats actually really confusingā€¦

yeah, it is. I edited my post to try to make things clearer but keep in mind, I was just trying to figure it out on my own and I do not have any advanced knowledge.

Yeah I think Iā€™ll just waitā€¦ Iā€™m running hassio too. Any idea when itā€™ll be integrated?

Thank you.

I verified all the settings on both ends but still ending up with HTTP 500 error when I try to open that app from Google Home.

Btw, I have these files in custom_components. Do I need another file for http component?

image

So I have a quick question. I still have a functional Emulated Hue instance working with my GH, so Iā€™m obviously worried about changes. How does this handle multiple users? If itā€™s tied to my account, does it only work with my account, or does it also work with my wifeā€™s? Do I have to add her to something? How about third parties using my GH?

@sbmlat yeah, thereā€™s another file under components/http/__init__.py thatā€™s required. I donā€™t know how hassio works so I canā€™t recommend editing/replacing it but that sounds like what youā€™re missing. You should see an error in your hass logs about json_message() got an unexpected keyword argument 'headers' which is because I had to add support for passing arbitrary headers in the http component.

@dramamoose it doesnā€™t handle multiple users (since you canā€™t/donā€™t want to publish it as an assistant app people can add). That said any people using your Google Home should be able to use it (my girlfriend uses it just fine), it just wouldnā€™t work in the Assistant app for her. If you wanted to make that work you could probably go through the setup steps again on her account and point it to the same place. You can also test it without breaking your emulated_hue setup by just setting a different name than your hue entities with google_assistant_name while youā€™re making sure it works.

1 Like

I am running HA AIO in the virtual environment.

From where can I get init.py file for HTTP component.

Yes, I do get those errors that you mentioned in the log file.

2017-10-18 13:59:39 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/aiohttp/web_protocol.py", line 422, in start
    resp = yield from self._request_handler(request)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/aiohttp/web.py", line 306, in _handle
    resp = yield from handler(request)
  File "/usr/lib/python3.4/asyncio/coroutines.py", line 143, in coro
    res = yield from res
  File "/usr/lib/python3.4/asyncio/coroutines.py", line 143, in coro
    res = yield from res
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/http/ban.py", line 58, in ban_middleware_handler
    return (yield from handler(request))
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/http/__init__.py", line 428, in handle
    result = yield from result
  File "/usr/lib/python3.4/asyncio/coroutines.py", line 141, in coro
    res = func(*args, **kw)
  File "/home/homeassistant/.homeassistant/custom_components/google_assistant/auth.py", line 80, in get
    headers={'Location': generated_url})
TypeError: json_message() got an unexpected keyword argument 'headers'

@kernald I remember what youā€™re talking about but I think they just removed the limited time test in the v2 API. In the help for the test command it says itā€™s deprecated anyway.

--preview_mins value This flag is deprecated and will be removed in a subsequent update. (default: 0)

@sbmlat this is the file that needs to be updated

Thatā€™s great news! I donā€™t have time to tinker with hass this week, but I definitely look forward to see this integrated. Thanks a lot for your awesome work!

@dramamoose It works with multiple users on the Google Home (speaker), my wife and I are both able to tell it to do stuff. Just like the emulated_hue does. (We have the Google home linked to our individual accounts and trained to our individual voices).

@PhilK I feel like it would be most user-friendly to do a SYNC request on startup, as that is probably the most likely place where changes could happen.

Also a note on the multiple users on Google assistant (Not a speaker), there is some stuff in one of Googleā€™s docs about sharing the test version with other people, I havenā€™t tested it out, as my wife does not use the Google assistant app anywhere. Not sure how many accounts are able to share the test version, but that may be an easier way than setting up multiple instances.

@cnrd any idea what event gets sent once all devices have initialized and platforms set up? Specifically Iā€™m thinking of Zwave where it can take awhile. Iā€™ll need to do some testing with dropping and re-adding devices especially until roomHint works.

I dropped that file into custom_components\http folder but HA failed with multiple errors. I was not sure what part of that file needs to be updated.

I will wait for the official release. Great work :ok_hand:

You can definitely test applications with other users - even with a Google Group. Iā€™m not aware of any limitations regarding the number of users using the application.

Thanks guy, Iā€™ve got it working in 0.55.x with venv, but it is rather hacky:

  • put google_assistant in custom_components (so far it is easy)
  • put http/__init.py__ in site-packages/home-assistant/components/http/ overwriting the one you previously had

Restart HA, then you can follow the very well written guide that has been merged in PR#3657.

Hi, I am very excited about this new component.

I am running 0.55.2 in a docker on unRAID.
Have copied the files into custom_components and the http/__ init.py __ file as well.
Then I followed the instructions and created the app. It shows up for testing in Google Assistant.
But when I open it I only get:

405: Method Not Allowed

No logs and no errors that I can see.
Any idea where to go next?

@datamonkey

Step 6.3 3.

Authorization URL (replace with your actual URL): `https://[YOUR HOME ASSISTANT URL]/api/google_assistant/auth

You probably misspelled the url, donā€™t forget the Ā« auth Ā» part at the end.

2 Likes

So this is not published app (not submitted to Google) will that expire in few hours(days?) same as API.IO app and we will have to re-enable the app from the Google console again?