VLC for TTS is fine but it is not playing music

I am having problem playing an MP3 file via the VLC media player. However TTS is working fine via VLC.

I have put the MP3 file in this folder /home/pi/.homeassistant/www/sounds/

When I go to http://192.168.1.999:8123/local/sounds/dog-barking-noise.mp3 in my browser, the file is there and can be played directly from the browser.

This is the script that I have…

dog_barking:
  alias: 'Dog Barking'
  sequence:
    - alias: 'Dog Barking'
      service: media_player.play_media
      data:
        entity_id: media_player.vlc_living_room
        media_content_id: http://192.168.1.999:8123/local/sounds/dog-barking-noise.mp3
        media_content_type: 'music'

When I activate the script, it is not working. Is this a bug?

Hmm, strange.
Have you checked your logs?

can’t find any errors in the log :confused:

There are two lines with “Alias” maybe this is the problem.

Regards

I have removed the additional line to this…

dog_barking:
  alias: 'Dog Barking'
  sequence:
    - service: media_player.play_media
      data:
        entity_id: media_player.vlc_living_room
        media_content_id: http://192.168.1.999:8123/local/sounds/dog-barking-noise.mp3
        media_content_type: 'music'

and still fail. Can you reproduce the problem?

Try:
media_content_id: /home/pi/.homeassistant/www/sounds/dog-barking-noise.mp3

2 Likes

Why I didn’t think of that? It works! Thanks :relaxed:

Nice, then it seams that we are missing support for streaming audio with the vlc component.

@Danielhiversen how can play mp3 with vlc via shell_command?
shell_command: sudo vlc /home/sound/xxxx.mp3
???