Google_say

I’m trying to use the TTS service and am having issues that I don’t understand so any help would be very welcome please.

Configuration is HASS.IO on a NUC, Ubuntu and Docker.

When I ask HASS to speak I get errors in the logs - typical set below:

2019-07-27 07:45:55 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.140558218977040] 
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 121, in handle_call_service
    connection.context(msg))
  File "/usr/src/homeassistant/homeassistant/core.py", line 1150, in async_call
    self._execute_service(handler, service_call))
  File "/usr/src/homeassistant/homeassistant/core.py", line 1172, in _execute_service
    await handler.func(service_call)
  File "/usr/src/homeassistant/homeassistant/components/tts/__init__.py", line 156, in async_say_handle
    DOMAIN_MP, SERVICE_PLAY_MEDIA, data, blocking=True)
  File "/usr/src/homeassistant/homeassistant/core.py", line 1150, in async_call
    self._execute_service(handler, service_call))
  File "/usr/src/homeassistant/homeassistant/core.py", line 1172, in _execute_service
    await handler.func(service_call)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 194, in handle_service
    required_features
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 316, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 339, in _handle_service_platform_call
    await func(entity, data)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 562, in play_media
    raise NotImplementedError()
NotImplementedError

My configuration.yaml file has this entry:

# Text to speech
tts:
  - platform: google_translate
    service_name: google_say

What am I missing, please?

I don’t think you need the service name, if you do I think it should be google_translate_say.

It’s not mentioned here

So you could probably remove it.

Thank you, @eggman

I have removed that line but it has not helped unfortunately.

Re-reading the page you pointed to may have the key, though. The last section covers base_url and says it may be needed with Docker. I am using Docker but have no idea how to set base_url for it. I’ll do some homework so thank you for the pointer!

I’ve added a base_url entry but it hasn’t helped, unfortunately.

# Text to speech
tts:
  - platform: google_translate
#    service_name: google_say

http:
   base_url: http://192.168.0.1:8123

The IP address is the IP address of the Ubuntu box, should it be a different address for Docker?

I’ve also managed to capture a message that displays on the lower left side of the console when I call TTS function. It doesn’t last long so isn’t easy to catch.

Failed to call service tts/google_translate_say

tts:
  - platform: google_translate
    base_url: https://hass.hostname:8123
    service_name: google_say

Base url is of your hass. If you have https, declare it, otherwise it won’t work. I’ve put my hostname on that if it helps.

EDIT:
In your case it should be:

tts:
  - platform: google_translate
    base_url: http://192.168.0.1:8123
    service_name: google_say

Is your hass really 192.168.0.1? x.x.x.1 usually is your network manager (ie router, firewall etc)

Thanks, @pvakerlis

Good spot on my IP address - no, it isn’t that one as I have changed it for on here but I know how to correct that! :wink: I am using http, not https

My configuration.yaml now has the following but it still isn’t working. I still see Failed to call service tts/google_say.

# Text to speech
tts:
  - platform: google_translate
    base_url: http://192.168.0.1:8123
    service_name: google_say

The errors in the log look very similar / identical to those in my first post.

If using Docker do I need different IP addresses - perhaps of the Docker container? I’m really inexperienced with Docker so may be worrying unnecessarily.

Which media_player are u using?

File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 562, in play_media
    raise NotImplementedError()

Can’t really answer that as I’m using Pi and haven’t played with docker and hass. Should be the Hass IP.

Thanks, @gieljnssns I was trying to use a hama Internet radio that is integrated into my HASS setup. I can control all other functions on it (volume, mode, on / off, etc.) . After your question I re-directed the output to a chromecast device and it works!

So the problem is something to do with the hama radio integration, not a wider issue.

Thanks again for helping me get closer to the problem!

For what it’s worth, I’m able to call the google_translate tts service to a Chromecast, but not Roku devices. I’m running hassio in Docker if it matters.

Hope this helps someone!

hello there, sorry to necro a slightly old thread, but I really couldn’t find anything to the same issue and my solution was the following

Text to speech

tts:

because I’m running home assistant as https and from my understanding google whats proper ssl certs before you can cast from a https location, I had to get a proper cert first, install that then pop that base url in and all worked.

I only came across the google casting issue as I couldn’t cast my emby movies at my parents place to google cast devices until I have emby coming across on a non-self-signed cert… I used rapidSSL

hope that helps someone. :slight_smile: