Media player mpd load playlist

I just saw that media_player component can load/play playlists. How is this configured in a n automation? currently I use a command_line switch

 - platform: command_line
    switches:
      load_DLF:
        oncmd: "/usr/bin/mpc -h 192.168.178.80 load file:/mnt/tank0/iTunes/Music/InternetRadio"
        offcmd: "/usr/bin/mpc -h 192.168.178.80 clear"
      play:
        oncmd: "/usr/bin/mpc -h 192.168.178.80 play"
        offcmd: "/usr/bin/mpc -h 192.168.178.80 pause"

I guess that can be done without mpc and directly. Anyone can point me to how to set this up?

Your current command line switches could be used with an automation.

yes of course they can be used in an automation…
However I’d rather be using the MPD component instead of the command line switches. Especially because I’m using a docker image which does not come with mpc pre-installed. So I have to exec into the image and install it after each update.

Currently the media player component for mpd cant load playlist. Play, pause etc wont be a problem on the other hand.

As this was the topic I kept coming back to when searching for this, I figure I might as well add the solution despite the thread being fairly old. (psv being the name of the playlist)

service: media_player.play_media
data:
  media_content_id: psv
  media_content_type: playlist
entity_id: media_player.mpd

where is your “psv” playlist saved? locally on the media_player.mpd device?