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


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 ./ “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]
test_cmd: ‘espeak “test123” >> /tmp/templated_shell_command_test &’

        alias: "test99"
            - service: templated_shell_command.test_cmd

File “/home/homeassistant/.homeassistant/custom_components/”, 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:

  test: espeak "test alert 765"

      alias: "test11"
          - 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.