I read this thread some time ago but just revisited the issue. There is an official VLC add-on in the Settings > Add-ons > ADD_ON STORE.
This installs and runs the add-on under the HA OS. No manual config file editing, no yaml or other code needed. You may have to configure its inputs and outputs in the add-on’s Configuration tab (two pull-down menus), although defaults worked for me. Then you start the add-on (check the log tab for errors and if all looks good, enable the watchdog and start on boot).
With the add-on running (and this part is key), you go to Settings > Devices & Services, and should have the VLC telnet integration auto-discovered. You add it (again, via UI - no manual config needed) and there’s not much to do after that. Everything should just work out of the box - or at least it did for me on 3 HA OS instances I’ve done this so far.
If you’ve some VLC integration manual install config entries pre-dating this, you may have to take it out and clean that up very thoroughly and redo this procedure.
When running the command from Advanced SSH & Web Terminal it works fine. When running from an automation I get “return code: 127” in the logs.
Running pactl info > meh.txt works and I get the output in the meh file, but paplay won’t budge, return code 127 no matter what I do with this command. It’s also not permissions as the file is 777 and I can make the pacat work using /config/scripts/pacat --list-file-formats -v > meh.txt again. But it won’t play
Several versions ago HA removed PulseAudio libraries from the main container (in addition to the binaries which were removed even earlier). This breaks the setup described in my earlier post.
Solution: to copy the required library from hassio_audio to the same location on the host machine, to which the binaries were copied before. There is one additional command besides the ones I listed in my previous post:
It’s using the network to play the audio. Audio plays fine when using the command from within the Advanced SSH and Web Terminal addon from within Home Assistant:
I gave up trying to make it work. I simply connect to the host using SSH and play the audio there. Audio file needs to be on the host. It’s a bit overkil, but at least it’s also futureproof as it doesn’t depend on any configuration in the homeassistant container itself.
You do need to setup SSH rsa keys for a ‘ha_audio’-like user on the host ofc.