TTS questions

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.

I’ve had no issues with my tts setup since I sorted it out all those months ago. Can only think something else might be affecting it that was changed in the config, especially as it works directly on the pi.

You’re not using encryption suddenly now are you?

I’m using encryption… but I do not remember if I was already using it when it still worked.
What problem does it involve?

Okay I’ve just saw, googling, that the SSL break the TTS service due to NAT loopback restriction.
But in my case (I’ve a FRITZ!Box 7490) my router support NAT loopback.
I’m able to call Home Assistant with external name (https://www.******.online) from within my internal network but the TTS still not work.
If I disable the SSL all works good.

that is why I ask you to put base_url without https://www
You still can use with ssl by change the base_url to ddns:8123 without https://www <== let your router do this part for port forward 443 to 8123

Or you can just put the local ip:8123 in base_url. You still can acess via https because it has to pass through your router setting.

I put my base URL in as

base_url: https://myduckdnsname.duckdns.org

With ‘myduckdnsname’ obviously changed to what yours is named. All under the http: heading in the config.

This is definitely the thing that fixed my TTS issues.

Tried all… @Sunonline and @jonathanp … no way … no audio!

That’s a bit frustrating. I know I was so happy to get it working. But you had it working, right? it’s just messed up and stopped since something has happened.

Best to go back through everything you’ve done, regardless of how much it would seem to have nothing to do with the audio and remove those new things one by one and test.

All I can really suggest at this stage, sorry.

Hi guys,
For me, my mistake was didn’t restart my RPi after install vlc and add group permissions to homeassistant user. After restart my RPi everything works.

I hope that this can be helpful to anybody that can find themselves in the same situation.

P.

Good point, you have to have permissions for the homeassistant user but seeing as Fulvi_Igor seemed to have it working previously that shouldn’t be the issue one would think

I’m thinking to mod the media player component to set the right path for me… anyone know what is and where is the media player component source file?

root\srv\homeassistant\lib\python3.5\site-packages\homeassistant\components\media_player\

1 Like

Im having a hard to getting the data template to work with TTS… here is my automation… I can get audio if I do the same but with only one argument… {“message”: “Test”}. Can you see anything wrong here
@lambtho @dingleydell

- id: welcome_message
  alias: Welcome Message  
  initial_state: 'on'
  trigger:
    - platform: state
      entity_id: sensor.keys
      from: 'not_home'
      to: 'Bedroom'
  action:    
    service: tts.amazon_polly_say
    data_template:
      entity_id: media_player.boss
      data_template:
            message: >-
            {{ [
            "Good night. " ,
            "Good evening. " ,
            "Sweet dreams. " ,
            "See you tomorrow. " ,
            "Have a wonderful night. " ,
            "See you soon. "
            ] |random }}'

I just don’t get it why Google TTS sound different in home assistant and not like in my phone. Anyone knows?
It uses too much intonation, it’s annoying

Probably because of space and indent. Copy and paste this will do. And one more thing trigger is it normal from not_home to bedroom instead of not_home to home, or home to bedroom. Sorry to ask about this.

- id: welcome_message
  alias: Welcome Message  
  initial_state: 'on'
  trigger:
    - platform: state
      entity_id: sensor.keys
      from: 'not_home'
      to: 'Bedroom'
  action:    
    service: tts.amazon_polly_say
    data_template:
      entity_id: media_player.boss
      data_template:
        message: >-
          {{ [
          "Good night. " ,
          "Good evening. " ,
          "Sweet dreams. " ,
          "See you tomorrow. " ,
          "Have a wonderful night. " ,
          "See you soon. "
          ] |random }}
1 Like

see post above.

There’s a random, unpaired single quote on the end of that FYI

1 Like

Thank you so much.

1 Like

I believe the state name ‘Bedroom’ comes from my happy bubbles device settings… so if you have multiple rooms it should feed in the device location name instead of just ‘home’

MQTT room presence

  • platform: mqtt_room
    device_id: a0e6f893ea78
    name: ‘Keys’
    state_topic: ‘happy-bubbles/presence/ha’
    timeout: 3
    away_timeout: 1

So, total noob here, in order to run these two steps:

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

do I have to have hassbian on my pi as well or can I do it with an SD card flashed with only hassio? Basically, I’m trying to setup a TTS to my local HDMI speaker and so want to use VLC player to play the media for me.