From 942198773cb2a6cc6f16a18759bb4d9a0d02b86b Mon Sep 17 00:00:00 2001 From: Will T <40162687+WillT93@users.noreply.github.com> Date: Tue, 15 Apr 2025 08:01:22 +1200 Subject: [PATCH] Instructions for deriving media-source:// from Media Browser URL (#38252) Co-authored-by: Shay Levy --- source/_integrations/media_source.markdown | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/source/_integrations/media_source.markdown b/source/_integrations/media_source.markdown index a8c82ed2b43..9f98b47403f 100644 --- a/source/_integrations/media_source.markdown +++ b/source/_integrations/media_source.markdown @@ -96,4 +96,19 @@ data: media_content_id: "media-source://media_source/local/videos/favourites/Epic Sax Guy 10 Hours.mp4" ``` -[basic-configuration]: /integrations/homeassistant/#media_dirs \ No newline at end of file +[basic-configuration]: /integrations/homeassistant/#media_dirs + +### Identifying a media source from the media browser + +If you wish to make use of the `media-source://` URI for an action, and the media is already available in the media browser (either as locally stored on the Home Assistant machine, or mapped using network storage) the following steps can help to determine the `media-source` uri. + +1. Select **Media** in the sidebar. +2. Navigate to the folder containing the media you wish to play.\ + *In this example, we will go **My media** > **NAS_Media**. This folder is a network share containing a collection of .mp3 files. One of which is named `my-music.mp3`.* +3. Copy the current URL from the URL bar.\ + *for example: `https://home-assistant.local/media-browser/browser/app%2Cmedia-source%3A%2F%2Fmedia_source/%2Cmedia-source%3A%2F%2Fmedia_source%2Flocal%2FNAS_Media`* +4. Search for an online URL Decoder, paste in the copied text and decode.\ + *`https://home-assistant.local/media-browser/browser/app,media-source://media_source/,media-source://media_source/local/NAS_Media`* + +The last media source, in this case `media-source://media_source/local/NAS_Media` makes up the first part of the path, with the complete path being: +`media-source://media_source/local/NAS_Media/my-music.mp3`