How can I reference a local file to be played via mpd?

The automation below works great, however I cannot get it work for local files (saved in my media folder)

  alias: ZZZ - Play media
  description: ''
  trigger: []
  condition: []
  action:
  - service: media_player.play_media
    data:
      entity_id: all
      media_content_id: http://soundbible.com/grab.php?id=2142&type=mp3
      media_content_type: audio/mp3
    entity_id: media_player.mpd
  mode: single

Here are my files:

I tried the following ways but no success:

media_content_id: root/media/ alert-outdoor.mp3
media_content_id: /root/media/ alert-outdoor.mp3
media_content_id: media/ alert-outdoor.mp3
media_content_id: /media/ alert-outdoor.mp3
media_content_id: local:track:alert-outdoor.mp3
media_content_id: alert-outdoor.mp3

How can I reference those mp3 files so the automation works?

See the docs here on how to use it:

media-source://media_source/local/alert-outdoor.mp3

with media-source i get this error in log:
mpd.base.CommandError: [5@0] {} Unsupported URI scheme

It is working with files inside the www folder:

media_content_id: http://HA-IP:8123/local/sounds/file.mp3

But the last second is always cut off, any Ideas about that?

Just tried it and it also doesn’t work for me. However, I get a different error about the file/directory not found. You could file an issue on Github.

I have found a solution for the cut off. I had to add buffer_time "100000" to the audio_output section inside the mpd.conf. So with files inside the www folder its working fine for me now :slight_smile: