TTS update

Hi,

since the last update, i try to test TTS option.
My mp3 is built normally, when i test like that

My chromecast become online but no sound.

In my log i see the content
16-12-18 11:38:15 homeassistant.core: Bus:Handling <Event state_changed[L]: old_state=<state media_player.chromecast2=off; supported_media_commands=5053, friendly_name=Chromecast2 @ 2016-12-18T11:33:58.388722+01:00>, entity_id=media_player.chromecast2, new_state=<state media_player.chromecast2=idle; volume_level=1.0, supported_media_commands=5053, friendly_name=Chromecast2, media_position=0, is_volume_muted=False, media_position_updated_at=2016-12-18T11:38:15.500908+01:00, media_content_id=https://192.168.10.32:8123/api/tts_proxy/5ed25af7b1ed23fb00122e13d7f74c4d8262acd8_google.mp3, app_name=Default Media Receiver, app_id=CC1AD845 @ 2016-12-18T11:38:15.503394+01:00>>

The problem is the following
when i test to get https://192.168.10.32:8123/api/tts_proxy/5ed25af7b1ed23fb00122e13d7f74c4d8262acd8_google.mp3 on my computer i get a security error (with https because my certificate is on a domain not on ip).
I need to accept exception and my sound play on my computer.

Have you an idea or a workaround for that ?
Is that possible to get my name domain in place to mt ip from my URL content ?

1 Like

I have a similar issue. I’m using Let’s Encrypt for my SSL. When I try to play TTS on a sonos speaker I get an error in the sonos app saying the Connection was lost. In the HASS logs everything appears OK an no error is thrown. I can manually browse to the generated URL (obtained from the logs) and the TTS file plays without issue in my browser.
Any ideas?

EDIT: When I reproduce the play media call i get the same behaviour. However when I replace the local IP with my external host name (which the SSL cert is set up as) it works perfect!
Looks like it’s an SSL issue

Yes same problem…

I have a problem where not sure if the BOSE Soundtouch works with this.

get error

16-12-18 18:34:08 homeassistant.components.media_player.soundtouch: Unable to find preset with id http://192.168.1.22:8123/api/tts_proxy/050ec95c2b742880ec912ab6e6084678bc1d9ef2_google.mp3

I don’t have https://

Any Help

I was getting the same issue with trying to play tts on a google home. I found where the url was being generated in https://github.com/home-assistant/home-assistant/blob/master/homeassistant/components/tts/init.py#L269 and realized there’s a base_url option that can be set under the http component section in the home-assistant config.

However, when I try to set that, I get an error saying it’s an invalid config :frowning:

16-12-18 17:11:25 homeassistant.bootstrap: Invalid config for [http]: [base_url] is an invalid option for [http]. Check: http->http->base_url. (See /root/.homeassistant/configuration.yaml:33). Please check the docs at https://home-assistant.io/components/http/

Edit: I’m dumb, 0.35.1 added this option :smiley:

1 Like

Ohhhhhh i see the update ;p

I’ll test that tonight thanks to you !

Hi,

now it works … almost :stuck_out_tongue:
When i call my chromecast it works.

When i call vlc (in component media_player), i have non sound and no errors

16-12-19 17:09:57 homeassistant.core: Bus:Handling <Event call_service[L]: service_data=media_content_id=https://ganhome.duckdns.org/api/tts_proxy/0cd1ce9b41d979c8db9b75e2da5d5f730d7cffcf_google.mp3, entity_id=media_player.vlcpine, media_content_type=music, service_call_id=548273564640-23, domain=media_player, service=play_media> 16-12-19 17:09:57 homeassistant.core: Bus:Handling <Event state_changed[L]: entity_id=media_player.vlcpine, old_state=<state media_player.vlcpine=idle; media_position=6.23351111984253, media_position_updated_at=2016-12-19T17:09:50.518502+01:00, is_volume_muted=False, friendly_name=vlcpine, media_duration=6.432, volume_level=1.0, media_content_type=music, supported_media_commands=525 @ 2016-12-19T17:09:31.753041+01:00>, new_state=<state media_player.vlcpine=idle; media_position=0.0, media_position_updated_at=2016-12-19T17:09:57.106140+01:00, is_volume_muted=False, friendly_name=vlcpine, media_duration=0.0, volume_level=1.0, media_content_type=music, supported_media_commands=525 @ 2016-12-19T17:09:31.753041+01:00>> 16-12-19 17:09:57 homeassistant.core: Bus:Handling <Event service_executed[L]: service_call_id=548273564640-23> 16-12-19 17:09:57 homeassistant.components.http: Serving /api/tts_proxy/0cd1ce9b41d979c8db9b75e2da5d5f730d7cffcf_google.mp3 to 127.0.0.1 (auth: False)

My server is a pine64, i configured my sound output correctly.

It’s strange because i can call in command line on my server
vlc /tmp/tts/0cd1ce9b41d979c8db9b75e2da5d5f730d7cffcf_google.mp3

and it works …

If you have an idea.

Ok it works after edit permission to pulseaudio !

@hokagegano It would be great if you can help update and improve the documentation. In the upper right corner of any documentation page, you will find “Edit this page on GitHub”. Follow the link and submit your suggested change. Demonstrated here: https://youtu.be/dRfk9JAlPJk?t=1h16m17s

I am not sure if its compatible (Please tell me if it is), but I have a MaryTTS Server I am happy to share if needed. Also, if anyone has used one I am interested.

Where and how to edit the permission of pulseaudio?

1 Like

Second that. What and where to edit regarding permissions.

pi@Livingroom:~$ ps aux | grep [t]ts
pi@Livingroom:~$ ps aux | grep [h]ass
root       728  9.2  5.3 344276 50920 ?        Sl   12:38   3:32 /usr/bin/python3 /usr/local/bin/hass -v --config /var/opt/homeassistant --pid-file /var/run/hass.pid

Hi,

My problem was the user running hass-daemon (root) was unable to run audio on soundcard.
So i had to configure pulseaudio to do that

addgroup --system pulse adduser --system --ingroup pulse --home /var/run/pulse pulse addgroup --system pulse-access adduser pulse audio adduser root pulse-access

if already is fine you need to do that as root
pulseaudio -D --system

now you can test the mp3 generated
cd /tmp/tts vlc generated.mp3

if it works now you need to execute pulseaudio -D --system at startup.

I modifiy /etc/init.d/hass-daemon with that:
start() { if [ -f $PID_FILE ] && kill -0 $(cat $PID_FILE) 2> /dev/null; then echo 'Service already running' >&2 return 1 fi echo 'Starting service…' >&2 local CMD="$PRE_EXEC hass $FLAGS $REDIRECT;" su -c "$CMD" $RUN_AS echo 'Service started' >&2 su -c "pulseaudio -D --system" $RUN_AS }

it’s so dirty because if i restart hass, pulseaudio -D --system is already active, but it’s not a big deal.

for me new TTS component is perfect.
it’s integrated to hass properly.

it works fine.
Only problem is Google (big brother) but it’s so powerful, it’s difficult to have an equivalent …

I submit my changes on the documentation page for TTS and RFXcom sensor component

1 Like

Where?

Is it possible to send TTS to Alexa?
I read that it is to Google Home

My dot is not appearing as a media player which I think is required?

Just to add my 2cent to this. I installed the full VLC package to my Ubuntu and the TTS actually played the text, but I couldn’t hear it. As a last resort I started the VLC gui on Ubuntu and the volume was at ZERO. That’s a new installation of Ubuntu and never seen vlc before that.

I believe that my changes are lost …
when i edited the github i received this message

You’re editing a file in a project you don’t have write access to. Submitting a change to this file will write it to a new branch in your fork hokagegano/home-assistant.io, so you can send a pull request.

You just forgot to create a pull request. If you go to https://github.com/home-assistant/home-assistant.github.io/compare/current...hokagegano:patch-3?expand=1
You can make a pr for patch-2 and patch-3