Community Hass.io Add-on: Google Assistant Webserver (broadcast messages without interrupting music)

Yep same here. no go on latest HassIO

Same problem here as well! Running 0.74

Addon has not been working for me for a while now. It used to not work due to the google update/error that was fixed a few weeks back, worked a bit and then stopped again.

Today, I wanted to start from scratch, created a new json-file and wanted to uninstall and reinstall.

Problem 1: I cant uninstall the addon! After hitting uninstall and confirming I get sent back to the Hass.io Addon page and the GA Webserver is still there just greyed out/not running… Tried that several times, multiple hass.io restarts, cant uninstall.

Problem 2: When I start it now I get the following error in the log:

[Info] Install/Update service client_secrets file
Traceback (most recent call last):
  File "/hassio_gassistant.py", line 144, in <module>
    credentials.refresh(http_request)
  File "/usr/local/lib/python3.5/dist-packages/google/oauth2/credentials.py", line 136, in refresh
    self._client_secret))
  File "/usr/local/lib/python3.5/dist-packages/google/oauth2/_client.py", line 237, in refresh_grant
    response_data = _token_endpoint_request(request, token_uri, body)
  File "/usr/local/lib/python3.5/dist-packages/google/oauth2/_client.py", line 111, in _token_endpoint_request
    _handle_error_response(response_body)
  File "/usr/local/lib/python3.5/dist-packages/google/oauth2/_client.py", line 61, in _handle_error_response
    error_details, response_body)
google.auth.exceptions.RefreshError: ('deleted_client: The OAuth client was deleted.', '{\n  "error" : "deleted_client",\n  "error_description" : "The OAuth client was deleted."\n}')

I would guess that means it cannot find the json-file in my /share/ folder as the message never changed, even when i purposefully entered a wrong name for the json file. OR somehow it saved the old json-file and ignores the new one (i did delete the old client @ google and created a completely new one).

Help is appreciated. Any way to “hard uninstall” an addon?

Edit: Just tried uninstall via CLI, didn work either:

core-ssh:~# hassio addons uninstall -name fe49a976_google_assistant_webserver
Error decoding json invalid character '<' looking for beginning of value: <html><head><title>500 Internal Server Error</title></head><body><h1>500 Internal Server Error</h1>Server got itself in trouble</body></html>

I had the same problem after transitioning from ResinOS-based hassio to Hassos. Several of the plugins weren’t working including Google Assistant Webserver. It wouldn’t let me uninstall either. The work-around for me was to make a partial snapshot that did not include the Google Assistant Webserver plugin and then do a fresh install and restore.

Thank you, that worked (eventhough its an aweful lot of work for reinstalling an addon…)

After reinstall, atleast I dont get error messages in my log! The broadcast messages I am sending are showing unter “My activities” in Google Home, but the devices are not broadcasting for some reason :frowning:

@AndBobsYourUncle, hoping you can give me some guidance on a special use-case for your webserver. Here’s the scenario:

I’ve a MS6126 switch device (https://www.jaycar.com.au/240v-mains-wi-fi-wireless-switch-module-with-app/p/MS6126) that has no Home Assistant Component, however it is supported by Google Assistant (https://assistant.google.com/services/a/uid/00000040393e4c1c?hl=en-US)

Using your Google Assistant Webserver I can create a template switch in Home Assistant which will turn on or off the MS6126 by issuing the command “turn on XX light” and “turn off XX light”, but i’d also like for Home Assistant to be aware of the current status of the MS6126.

Using your “GAWS” addon is it possible to issue the command “is the XX light on” and parse the verbal response from Google Assistant so that Home Assistant can update the status of the switch? (i.e. update the template switch in Home Assistant UI so i can see remotely if the light is on or off).

Any advice would be appreciated!!! Thanks.

I discover every day some new awesome community add-on. I’ve migrate from a classic Rpi3 to hass.io today … and I will try this as soon as possible.

Just a question, why it need another add-on ? This feature could not be implemented in the normal Google Assistant add-on ?

Thanks for your work !

@12-hak @DFilippo @NicoS

Are all of you using the 64 bit version? There are other addons besides this one that you may have problems with as well when using it. As there were no apparent advantages to using 64 (it was much slower for me in every way), I switched to the 32 bit version.

I have the 32-bit version and can’t install the addon either.

What does it say in the hassio > system logs after you try to install?
(or hassio su logs using the cli)

I can’t install the add-on. I got to the step of “open web ui”, and after I paste in the authentication code I get an error (below). It suggests it’s a ‘temporary error’, but if I try later I get the same result. As others have found, the add-on will not uninstall (and I’m hoping I don’t have to go down the partial snapshot, blow it away and restore path). Any assistance would be appreciated, as I’m tired of the Google Home stopping the music.

This is the error in the hass.io log:

18-08-03 05:46:50 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_protocol.py", line 378, in start
    resp = await self._request_handler(request)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_app.py", line 341, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_middlewares.py", line 88, in impl
    return await handler(request)
  File "/usr/local/lib/python3.7/site-packages/hassio/api/security.py", line 56, in token_validation
    return await handler(request)
  File "/usr/local/lib/python3.7/site-packages/hassio/api/utils.py", line 32, in wrap_api
    answer = await method(api, *args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/hassio/addons/utils.py", line 34, in wrap_check
    return await method(addon, *args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/hassio/addons/addon.py", line 674, in start
    return await self.instance.run()
  File "/usr/local/lib/python3.7/site-packages/hassio/utils/__init__.py", line 25, in wrap_api
    return await method(api, *args, **kwargs)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.7/site-packages/hassio/docker/addon.py", line 272, in _run
    self.image, self.version)
  File "/usr/local/lib/python3.7/site-packages/hassio/docker/addon.py", line 47, in version
    return super().version
  File "/usr/local/lib/python3.7/site-packages/hassio/docker/interface.py", line 45, in version
    if self._meta and LABEL_VERSION in self._meta['Config']['Labels']:
TypeError: argument of type 'NoneType' is not iterable

And this is the error I get in the ui:

500 Internal Server Error
The server encountered an unexpected condition which prevented it from fulfilling the request.

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/urllib3/connection.py", line 171, in _new_conn
    (self._dns_host, self.port), self.timeout, **extra_kw)
  File "/usr/local/lib/python3.5/dist-packages/urllib3/util/connection.py", line 56, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
  File "/usr/lib/python3.5/socket.py", line 733, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -3] Temporary failure in name resolution

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/urllib3/connectionpool.py", line 600, in urlopen
    chunked=chunked)
  File "/usr/local/lib/python3.5/dist-packages/urllib3/connectionpool.py", line 343, in _make_request
    self._validate_conn(conn)
  File "/usr/local/lib/python3.5/dist-packages/urllib3/connectionpool.py", line 849, in _validate_conn
    conn.connect()
  File "/usr/local/lib/python3.5/dist-packages/urllib3/connection.py", line 314, in connect
    conn = self._new_conn()
  File "/usr/local/lib/python3.5/dist-packages/urllib3/connection.py", line 180, in _new_conn
    self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x7ff67a922c88>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/requests/adapters.py", line 445, in send
    timeout=timeout
  File "/usr/local/lib/python3.5/dist-packages/urllib3/connectionpool.py", line 638, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/usr/local/lib/python3.5/dist-packages/urllib3/util/retry.py", line 398, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='www.googleapis.com', port=443): Max retries exceeded with url: /oauth2/v3/token (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7ff67a922c88>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/cherrypy/_cprequest.py", line 627, in respond
    self._do_respond(path_info)
  File "/usr/local/lib/python3.5/dist-packages/cherrypy/_cprequest.py", line 686, in _do_respond
    response.body = self.handler()
  File "/usr/local/lib/python3.5/dist-packages/cherrypy/lib/encoding.py", line 221, in __call__
    self.body = self.oldhandler(*args, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/cherrypy/_cpdispatch.py", line 54, in __call__
    return self.callable(*self.args, **self.kwargs)
  File "/hassio_oauth.py", line 46, in token
    self.oauth2.fetch_token(self.user_data['token_uri'], client_secret=self.user_data['client_secret'], code=token)
  File "/usr/local/lib/python3.5/dist-packages/requests_oauthlib/oauth2_session.py", line 221, in fetch_token
    verify=verify, proxies=proxies)
  File "/usr/local/lib/python3.5/dist-packages/requests/sessions.py", line 559, in post
    return self.request('POST', url, data=data, json=json, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/requests_oauthlib/oauth2_session.py", line 360, in request
    headers=headers, data=data, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/requests/sessions.py", line 512, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.5/dist-packages/requests/sessions.py", line 622, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/requests/adapters.py", line 513, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='www.googleapis.com', port=443): Max retries exceeded with url: /oauth2/v3/token (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7ff67a922c88>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',))

Following error occurs:

18-08-03 09:08:57 ERROR (MainThread) [hassio.addons.addon] Addon a0f42afb_google_assistant_webserver not supported on i386

Hey all

Got it working on QNAP nas in docker, using version 0.0.4. [UPDATE] The trick to getting this working was to use different ports from 9324 and 5000.

Broadcast works fine, as does sending most other commands (eg “ask harmony to turn on the TV”). What I can’t get working is to get musing playing on my chromecast audio. The activity history says that google can’t help with that right now. But if I just say it to my google home, it works.

Any ideas how I can fix this?

2 Likes

@mooturner I have the same problem. I was hoping that creating a Routine to play music and naming it “Turn on music mode”, then issuing the command “Turn on music mode” from this addon would work, but it does nothing.

@masterfink It’s not a problem you can fix. This was made to take advantage of the “broadcast” feature, which isn’t involved in casting media (you don’t broadcast to a single device, but rather all google home devices). The “command” stuff was discovered later almost by accident and it doesn’t support casting media either. You can turn off lights and switches, but Home Assistant automations already cover that, so using command is not so useful. It’s not anything you’ve done, or the addon…it just isn’t supported on Google’s end.

Can you add aarch64 arquitecture please?

Addon fe49a976_google_assistant_webserver not supported on aarch64

I think this info should be noted in the 1st post like a FAQ @AndBobsYourUncle
What you can do or not with the addon, the DND setting etc…

Casting media is actually supported by Google with the Google Assistant Library but it’s only available for linux-armv7l and linux-x86_64 architectures with Audio capture and playback.
I use it everyday for my morning alarm.

Isn’t that basically the Google Assistant SDK though (a different addon for Hass.io) and not this “relay”? Or are they the same thing?

My solution is a mix between the official Hassio add-on and this one.

To summarize:

Official add-on This add-on My solution
Hassio ready (Docker)
SDK component used Google Assistant Library Google Assistant Service Google Assistant Library
Supported architectures linux-armv7l and linux-x86_64 All gRPC platforms linux-armv7l and linux-x86_64
Webserver embedded
Input method Voice only Text only Voice and text
Broadcasting
Remote media casting
3 Likes

I’m not sure why it’s not spoken of more on these forums or with this addon, but the command feature is extremely useful and might save you a bit of cash.

A fair bit of cheap smart devices that are not yet or unable to be implemented into HA do have Google Assistant support. There are occasionally other methods to get these into HA including IFTTT, but they are very slow to react. This is a great solution to use these devices in HA and have them react just as fast as officially supported devices.

Before finding HA I had a good number of Meross smart plugs, they were cheaper than sonoffs at the time and I built my own solution from Google’s SDK to do this once I fell in love with HA, but now I don’t have to worry about all that.

Thanks for this.