I've been breaking my head over this for a few weeks now. Reading https://www.home-assistant.io/integrations/media_source/ does not really help as it does not properly explain what the interaction of these mapped paths with HAOS' network storage settings are.
Basically, I want to play a media file that is stored on a NFS share served by a NAS in my network.
action: media_player.play_media
data:
media_content_id: media_source://media_source/media/music/ambients/recorded-rain.mp3
media_content_type: music
target:
entity_id: media_player.home_assistant_voice_0971ee_media_player
The file is a regular MP3, nothing special. However I cannot for the life of me figure out how to access the path that the file lives on.
The file itself is visible in HA in the /media path:
➜ ~ ls /media/music/ambients
ocean.mp3 recorded-rain.mp3
So I would think that I would have to refer to that path when trying to play my media, but while I can use the above YAML in the actions tab of Developer Tools and run it, there's nothing happening on the actual media player device. HA also doesn't seem to register that something should be playing there.
Lifting this from the documentation page:
To play media from a media source via an action, use the uri scheme media-source://media_source/<media_dir>/<path>. Default media_dir is local.
I do not know how to interpret this. I have added a new key under homeassistant.media_dirs with a new value for /media which seems a bit redundant, but I was hoping that explicitly defining it would work: it doesn't.
Do I need the homeassistant.media_dirs key at all to get this to work? And how do I figure out the mapping between where the file lives on my network and how to get HA to play that on some media player?