Fulvi_Igor
(Fulvi Igor)
January 17, 2018, 10:46am
1
TTS service has stopped working and I don’t know why… before today all was worked fine with audio.
This is my config …
http:
api_password: ***********
base_url: https://www.******.online:8123
ssl_certificate: /home/****/.homeassistant/fullchain.pem
ssl_key: /home/****/.homeassistant/privkey.pem
media_player:
- platform: vlc
name: speaker_1
arguments: '--alsa-audio-device=hw:0,0'
tts:
- platform: google
language: 'it'
Tested audio output with …
cvlc --vout none LRMonoPhase4.wav
… all works good!
Tried to call tts.google_say in my config and even in the dev tools but I’ve no audio!
In the dev tools I called…
service: tts.google_say
entity: media_player.speaker_1
data: {"entity_id": "media_player.speaker_1", "message": "Hello"}
Why I’ve no audio?
Sunonline
(Sun K)
January 17, 2018, 10:52am
2
I see the space for name: speaker_1 and arguments: ‘–alsa-audio-device=hw:0,0’
- platform: vlc
name: HA Speaker
arguments: '--alsa-audio-device=hw:0,0'
Fulvi_Igor
(Fulvi Igor)
January 18, 2018, 8:13am
3
The spaces is a misformatting in the post (sorry about that) in my config the indentations it’s ok.
So… my config seems to be identical to your.
Did you try from ssh.
sudo usermod -a -G audio homeassistant <== this to allow homeassistant user to use pi audio. From your test in ssh console you test from pi user not from homeassistant user.
also the (ha ip) base_url: ip_address:8123 <== this has to be the ip address not localhost or 127.0.0.1
I found that some people setting are different depending on hardware they use.
arguments: ‘–alsa-audio-device=hw:0,0’
some use
arguments: ‘–alsa-audio-device=hw:1,0’
also I got tts google work from this
I am using TTS on my RPi3 (which hosts Home Assistant ). Here is a walktrough to make everything work
First you have to install a media player. I use VLC:
sudo apt-get install vlc-nox
Then add Hass to audio group:
sudo usermod -a -G audio homeassistant
I also use the following to increase the volume of the output to 100%
In HA, I have declared the media player using
media_player:
- platform: vlc
name: speaker_1
arguments: '--alsa-audio-device=hw:0,0'
And finally I declare g…
Fulvi_Igor
(Fulvi Igor)
January 19, 2018, 8:51am
5
Logged in as homeassistant user and tested with …
cvlc --vout none LRMonoPhase4.wav
… sound output is good.
The output of my aplay -l
is…
**** Lista di PLAYBACK dispositivi hardware ****
scheda 0: PCH [HDA Intel PCH], dispositivo 0: ALC662 rev3 Analog [ALC662 rev3 Analog]
Sottoperiferiche: 1/1
Sottoperiferica #0: subdevice #0
scheda 0: PCH [HDA Intel PCH], dispositivo 3: HDMI 0 [HDMI 0]
Sottoperiferiche: 1/1
Sottoperiferica #0: subdevice #0
… so
- platform: vlc
name: HA Speaker
arguments: '--alsa-audio-device=hw:0,0'
… must be the right config.
But still no audio on Home Assistant… I don’t remember after doing “what” the audio stop working, but I’m sure that before of a “certain point” my audio was playing.
Fulvi_Igor
(Fulvi Igor)
January 19, 2018, 9:21am
6
From the log I saw that the event it’s fired…
2018-01-19 10:18:11 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: service=play_media, service_data=entity_id=['media_player.speaker_1'], media_content_type=music, media_content_id=https://www.*******.online:8123/api/tts_proxy/1e4e888ac66f8dd41e00c5a7ac36a32a9950d271_it_-_google.mp3, domain=media_player, service_call_id=140706656706064-37>
… and the media_content_id
if played from a web browse it’s okay.
1 Like
base_url has to be ip with port. no need https://www ( try put ddns.online:8123 without https://www ) . Then you can test with tts google. just click on media player and type. it would be able to speak what you type.
Fulvi_Igor
(Fulvi Igor)
January 19, 2018, 9:58am
8
No way… nothing is changed neither without https://… neither with numeric IP…
Sunonline
(Sun K)
January 19, 2018, 10:01am
9
I mean if your base_url is https://www.dynamicname.online ( put the https://www away) the base_url will be
dynamicname.online:8123 <== ip with port no need https://www
to test it locally instead of dynamicname put the local_ip:port
after change restart your ha and test from your media player directly
Fulvi_Igor
(Fulvi Igor)
January 19, 2018, 10:39am
10
http:
api_password: ***********
base_url: *******.online:8123
ssl_certificate: /home/****/.homeassistant/fullchain.pem
ssl_key: /home/****/.homeassistant/privkey.pem
… same issue! nothing is changed…
Sunonline
(Sun K)
January 19, 2018, 11:18am
12
I see the different is the name of the speaker is different.
media_player:
platform: vlc
name: speaker_1
arguments: ‘–alsa-audio-device=hw:0,0’
you speaker name is speaker_1
but from media player I see name myspeaker
Fulvi_Igor
(Fulvi Igor)
January 19, 2018, 11:22am
13
I’ve changed the name to myspeaker
for test… maybe something is wrong with the underscore… but nothing… same “no audio”.
Sunonline:
You press > no sound?
Uhm… I think no… how I can check?
The following are the attributes of the media player…
"media_content_type": "music",
"media_duration": 0,
"media_position": 0,
"is_volume_muted": false,
"volume_level": 1,
"friendly_name": "myspeaker",
"media_position_updated_at": "2018-01-19T10:52:08.775600+00:00",
"supported_features": 16909
Sunonline
(Sun K)
January 19, 2018, 11:22am
14
also can you try set the language from ‘it’ to ‘it-IT’
Fulvi_Igor
(Fulvi Igor)
January 19, 2018, 11:24am
15
… no I haven’t tried with “it-IT” but I’ve tried with no “language: it” at all.
Sunonline
(Sun K)
January 19, 2018, 11:26am
16
When you test from Speaker. Type the word you want to test and press >
my media player setting
platform: vlc
name: HA Speaker
arguments: ‘–alsa-audio-device=hw:0,0’
my tts google
platform: google
language: ‘en-uk’
cache: true
cache_dir: /tmp/tts
time_memory: 300
for cache_dir: /tmp/tts <== you have to manually create
The language page support I check from here https://cloud.google.com/speech/docs/languages
Fulvi_Igor
(Fulvi Igor)
January 20, 2018, 10:05am
17
The problem is the encryption! Let’s Encrypt broke the TTS service due to NAT loopback.
Fulvi_Igor
(Fulvi Igor)
January 21, 2018, 1:50pm
18
Tried Yandex, Pico and VoiceRSS… no way… no audio!
The strange thing are that Pico is running on local mode, so TSL, NAT and loopback should be excluded!
Sunonline
(Sun K)
January 21, 2018, 2:26pm
19
from my router, I forward port external 443 to internal 8123 (when I use let encrypt) also I forward external port 8123 to internal 8123.
currently I use
base_url: dns:8123 without http://www and without https://www this will be automatic forward to HA by router
first when i test tts google I try by local ip of HA and port
base_url: ha-internal-ip:8123 without http://www and without https://www
on tts google platform, for the cache_dir: /tmp/tts I create tmp folder manually in HA configuration directory.
Any way to make it work. I am also stuck with same issue.