TTS problem. mp3 files generated but not played on any device

Hi, my tts (Google) is not working since a long time (can’t say exactly, maybe early .8 versions). I googled a lot but found no solution for my problem. Now i hope that anyone here can help me.

I use the latest version of Home Assistant. When i use the mediaplayer tts-input, the mp3-files are successfully generated in the config/tts - folder but not played back in any mediaplayer-component. I tried appletv, volumio, … With “call service” it do not work either. I think it is not a problem with Google-TTS. Yes i know, there was a problem with using google-tts and SSL but the files were generated without any problem so i think It must be a local problem.

This is the error-log i get:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/websocket_api/commands.py", line 148, in handle_call_service
    connection.context(msg))
  File "/usr/local/lib/python3.7/site-packages/homeassistant/core.py", line 1133, in async_call
    self._execute_service(handler, service_call))
  File "/usr/local/lib/python3.7/site-packages/homeassistant/core.py", line 1155, in _execute_service
    await handler.func(service_call)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/tts/__init__.py", line 153, in async_say_handle
    DOMAIN_MP, SERVICE_PLAY_MEDIA, data, blocking=True)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/core.py", line 1133, in async_call
    self._execute_service(handler, service_call))
  File "/usr/local/lib/python3.7/site-packages/homeassistant/core.py", line 1155, in _execute_service
    await handler.func(service_call)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity_component.py", line 188, in handle_service
    self._platforms.values(), func, call, service_name
  File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/service.py", line 278, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/service.py", line 294, 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/local/lib/python3.7/site-packages/homeassistant/components/media_player/__init__.py", line 581, in play_media
    raise NotImplementedError()
NotImplementedError

Maybe the Platform / Media Player does not support playing the mp3 from HA?

It works with my Logitech Squeezeboxes since HA 0.86+ or so.

It definitively played on AppleTV and should do on Volumio as well.

Can you control normal Playback of your Device(s) via HA?

Please post the related parts of your HA configuration and System details.

Play/Pause/Skip work fine. When i use tts the playback stops but the tts-message don’t start. HA runs on a Raspi3b, Apple TVs are not the latest 4k-versions. One is the 720p and one the 1080p version (the black ones). As mentioned: I did work in early days… HA-configuration is split to a components-folder.

One of my AppleTVs (apple_tv:):

host: 192.168.178.xx
login_id: !secret apple_tv_login_id
name: AppleTV Büro
start_off: false
credentials: !secret apple_tv_office_credentials

Google-TTS-Integration (tts:):

platform: google
language: 'de'

I tried “base_url” in configuration of the tts-component but nothing changed. Seems to work, the mp3s are generated. Problem must be somewhere in the playback-part.

The problem with Logitech Media Server (the software used to control Squeezeboxes devices) does not accept https (ssl) sources. If you dont setup hassio to use https, then sending tts to LMS works ok, but if setup hassio to use https then it does not work. In my case I leave the default http config in hassio by default (http, port 8123) and then install nginx add-on to use it as a https proxy. With this configuration, hassio now is listening on 80-http and 443-https. So now you can expose hassio to internet using 443 port forwarding and use http-80 internally.

The reason LMS does not work with SSL is because by default some perl modules (IO::Socket:SSL) are missing and are needed for LMS to work properly with SSL conections.

I have tryed to install LMS 7.9.x on several systems (debian 9 / raspbian / windows, etc) and those needed perl modules, but unfortunatelly I did not found the way for LSM to detect them.

Thoughts?

I’m running HA 0.89.2 in Docker with SSL and LMS 7.9.1 - 1505480690 @ Fri Sep 15 14:05:22 UTC 2017 , Perl-Version: 5.24.1 - x86_64-linux-gnu-thread-multi (without Docker) on Debian 9 x64 on my home server.

TTS works for me with SSL enabled.

2019-03-17 15:26:14 INFO (MainThread) [homeassistant.components.http.view] Serving /api/tts_proxy/984816fd329622876e14907634264e6f332e9fb3_de_-_google.mp3 to 192.168.0.5 (auth: False)
2019-03-17 15:26:14 INFO (MainThread) [homeassistant.components.http.view] Serving /api/tts_proxy/984816fd329622876e14907634264e6f332e9fb3_de_-_google.mp3 to 192.168.0.5 (auth: False)

I lovelace i see the Adresse playing: https://192.168.0.5:8123/api/tts_proxy/984816fd329622876e14907634264e6f332e9fb3_de_-_google.mp3

grafik

foo@foo-srv:~$ apt list | grep logitechmediaserver
logitechmediaserver/now 7.9.1~1505480690 all  [Installiert,lokal]

perl-openssl-defaults/stable,now 3 amd64 [Installiert,automatisch] is installed.

As the slimdevices debian repro is no more i think i’m use the debian stable package.

Please check HA and LMS Logs if you can find simular messages like mine.

The package perl-openssl-defaults is the key. After install it, it works like a charm !!!

Thanks a lot mate!!!

@JBelinchon Could you please provide some details on how/where you installed the perl-openssl-defaults that solved your issue above?

I am running HA and LMS in separate docker containers, both being hosted on Unraid. I’m using LetsEncrypt to generate the certs for HA.

I setup SSL on Home Assistant in an effort to get LMS Controls working from @ynot, and it has been working to the degree that i’m looking for, except that it broke my TTS using the Google TTS service to LMS devices. Google TTS still works for Google devices.

Based on the above thread, it looks like you solved this. Any help you could offer would be appreciated!

Thanks!

Check out 3 solutions on this thread