Help needed: Espeak & Google-TTS work from cmd line but not from HA

Hello

So I want to play text-to-speech commands through a speaker connected to Rasbperry Pi3’s 3.5mm plug. Should be pretty straightforward with all the guides and discussion already available but I just can’t get it working. Currenlty I can play sound using Espeak and Google (guide I mainly used) when I send commands directly from command line using SSH e.g ./speech.sh “Please, speak to me.” or espeak “Please, speak to me.”. HA is installed as user homeassistant and is run in a virtual environment, if that matters. I can also play sound from command line using homeassistant user so I’ve already added that to the audio group. I read that HA’s command line notify didn’t work for some people so I tried shell_command as was suggested (here and here) but still no sound. No errors either, for that matter. Templated shell command example (explained here) is something I don’t quite understand but it doesn’t work either, gives me some errors below.

[details=templated shell command]
templated_shell_command:
test_cmd: ‘espeak “test123” >> /tmp/templated_shell_command_test &’

script:
    test9:
        alias: "test99"
        sequence:
            - service: templated_shell_command.test_cmd

File “/home/homeassistant/.homeassistant/custom_components/templated_shell_command.py”, line 30, in service_handler
_ cmd = template.render(hass, conf[call.service])_
AttributeError: ‘module’ object has no attribute ‘render’[/details]

I’ve got normal shell command configured and used for testing like this:

shell_command:
  test: espeak "test alert 765"

script:
  test1:
      alias: "test11"
      sequence:
          - service: shell_command.test

Could someone provide any suggestions or point to a right direction?
The main goal here is to use these semi-dynamic voice feedbacks telling me todays weather forecast and driving time to work and so on. But first this simple static text. Thanks!

Have you looked at vlc or vlc-nox as the local media player? That is working for me on my pi…

Dude that was the magic word, “vlc-nox”. Thanks!

Got it working following this and configured dynamic voice feedbacks with using commands shown in here. Works with SSL after adding base_url to http config.

Glad to help. That’s what these forums are all about.