From 8091596e12a4df93506bffd271fd4ad904e1bd56 Mon Sep 17 00:00:00 2001 From: OzGav Date: Tue, 25 Mar 2025 00:47:00 +1100 Subject: [PATCH 1/9] Add browse media section --- source/_integrations/music_assistant.markdown | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/source/_integrations/music_assistant.markdown b/source/_integrations/music_assistant.markdown index ae804021bfd..47bf48a125e 100644 --- a/source/_integrations/music_assistant.markdown +++ b/source/_integrations/music_assistant.markdown @@ -69,6 +69,36 @@ media_content_type: playlist media_content_id: 'The Best of Disco' ``` +### Action `media_player.browse_media` + +Browse the media available on a Music Assistant server. The action configuration is as described in the [media player documentation](https://www.home-assistant.io/integrations/media_player/#action-media_playerbrowse_media) + +The `media_content_id` must be a URI which is understood by MA such as: `library://artist/1`, `library://album/20` or `spotify://album/5zj4Ej0FrlJQaSo0d6cttH`. These URIs can be obtained from a variety of places such as the output of the `get_library` or `search` actions described below or the `media_player.browse_media` HA action. The type of item must be an album or artist. + +#### Examples + +Get all tracks of an album + +```yaml +action: media_player.browse_media +data: + media_content_type: music + media_content_id: library://album/20 +target: + entity_id: media_player.ma_study_player_provsp +``` + +Get all albums of an artist + +```yaml +action: media_player.browse_media +data: + media_content_type: music + media_content_id: library://artist/1 +target: + entity_id: media_player.ma_study_player_provsp +``` + ## Additional actions ### Action `music_assistant.play_media` From bdad177fa377f0418482d4eaa62185ad8f6ddeca Mon Sep 17 00:00:00 2001 From: OzGav Date: Tue, 25 Mar 2025 00:56:53 +1100 Subject: [PATCH 2/9] Code rabbit suggestions --- source/_integrations/music_assistant.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/_integrations/music_assistant.markdown b/source/_integrations/music_assistant.markdown index 47bf48a125e..bdbb53ab13a 100644 --- a/source/_integrations/music_assistant.markdown +++ b/source/_integrations/music_assistant.markdown @@ -73,7 +73,7 @@ media_content_id: 'The Best of Disco' Browse the media available on a Music Assistant server. The action configuration is as described in the [media player documentation](https://www.home-assistant.io/integrations/media_player/#action-media_playerbrowse_media) -The `media_content_id` must be a URI which is understood by MA such as: `library://artist/1`, `library://album/20` or `spotify://album/5zj4Ej0FrlJQaSo0d6cttH`. These URIs can be obtained from a variety of places such as the output of the `get_library` or `search` actions described below or the `media_player.browse_media` HA action. The type of item must be an album or artist. +The `media_content_id` must be a URI which is understood by MA such as `library://artist/1`, `library://album/20` or `spotify://album/5zj4Ej0FrlJQaSo0d6cttH`. These URIs can be obtained from, for example, the output of the `get_library` or `search` actions described below or the `media_player.browse_media` HA action. The type of item must be an album or artist. #### Examples From 459aa929f5513e7e30e87d84a8ac10c3f6f1167a Mon Sep 17 00:00:00 2001 From: OzGav Date: Tue, 25 Mar 2025 01:04:43 +1100 Subject: [PATCH 3/9] Update music_assistant.markdown --- source/_integrations/music_assistant.markdown | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/_integrations/music_assistant.markdown b/source/_integrations/music_assistant.markdown index bdbb53ab13a..99004c843eb 100644 --- a/source/_integrations/music_assistant.markdown +++ b/source/_integrations/music_assistant.markdown @@ -73,7 +73,9 @@ media_content_id: 'The Best of Disco' Browse the media available on a Music Assistant server. The action configuration is as described in the [media player documentation](https://www.home-assistant.io/integrations/media_player/#action-media_playerbrowse_media) -The `media_content_id` must be a URI which is understood by MA such as `library://artist/1`, `library://album/20` or `spotify://album/5zj4Ej0FrlJQaSo0d6cttH`. These URIs can be obtained from, for example, the output of the `get_library` or `search` actions described below or the `media_player.browse_media` HA action. The type of item must be an album or artist. +The `media_content_type` is optional but if used will always be `music`. + +The `media_content_id` must be a URI which is understood by MA such as `library://artist/1`, `library://album/20` or `spotify://album/5zj4Ej0FrlJQaSo0d6cttH`. These URIs can be obtained from, for example, the output of the `get_library` or `search` actions described below or the `media_player.browse_media` HA action. The type of item that the URI refers to must be an album or artist. #### Examples From 24c2208ca88ce82f8612e6d2a8ba1fa2ea9a057d Mon Sep 17 00:00:00 2001 From: OzGav Date: Tue, 25 Mar 2025 01:12:02 +1100 Subject: [PATCH 4/9] code rabbit punctuation --- source/_integrations/music_assistant.markdown | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/_integrations/music_assistant.markdown b/source/_integrations/music_assistant.markdown index 99004c843eb..5392b5bb8ff 100644 --- a/source/_integrations/music_assistant.markdown +++ b/source/_integrations/music_assistant.markdown @@ -73,13 +73,13 @@ media_content_id: 'The Best of Disco' Browse the media available on a Music Assistant server. The action configuration is as described in the [media player documentation](https://www.home-assistant.io/integrations/media_player/#action-media_playerbrowse_media) -The `media_content_type` is optional but if used will always be `music`. +The `media_content_type` is optional, but if used will always be `music`. -The `media_content_id` must be a URI which is understood by MA such as `library://artist/1`, `library://album/20` or `spotify://album/5zj4Ej0FrlJQaSo0d6cttH`. These URIs can be obtained from, for example, the output of the `get_library` or `search` actions described below or the `media_player.browse_media` HA action. The type of item that the URI refers to must be an album or artist. +The `media_content_id` must be a URI which is understood by MA such as `library://artist/1`, `library://album/20`, or `spotify://album/5zj4Ej0FrlJQaSo0d6cttH`. These URIs can be obtained from, for example, the output of the `get_library` or `search` actions described below or the `media_player.browse_media` HA action. The type of item that the URI refers to must be an album or artist. #### Examples -Get all tracks of an album +Get all tracks from an album ```yaml action: media_player.browse_media From 5dabfc5badcec1f4837ca5ea1ba7e0e35f266e4e Mon Sep 17 00:00:00 2001 From: OzGav Date: Fri, 28 Mar 2025 01:41:39 +1100 Subject: [PATCH 5/9] Amend docs to Bronze standard Add integration removal section. Remove HA media player actions Add valid media_content_id info --- source/_integrations/music_assistant.markdown | 90 +++++-------------- 1 file changed, 20 insertions(+), 70 deletions(-) diff --git a/source/_integrations/music_assistant.markdown b/source/_integrations/music_assistant.markdown index 5392b5bb8ff..172532815a2 100644 --- a/source/_integrations/music_assistant.markdown +++ b/source/_integrations/music_assistant.markdown @@ -23,85 +23,35 @@ There is currently support for the following Home Assistant Platforms: All of the Home Assistant [Media Player Control Actions](https://www.home-assistant.io/integrations/media_player/#media-control-actions) are supported. +The `media_content_id` payload for `media_player.play_media` can be any of the following: + +- The name of a track, artist or album. (for example, "Queen") +- A track or album combined with the artist name (for example, "Queen - Innuendo") +- A streaming provider URI (for example, `spotify://artist/12345`) + +The `media_content_id` payload for `media_player.browse_media` must be a URI of the form `library://artist/1`, `library://album/20`, or `spotify://album/5zj4Ej0FrlJQaSo0d6cttH`. The type of item that the URI refers to must be an album or artist. + +These URIs can be obtained from, for example, the output of the `get_library` or `search` actions described below or the `media_player.browse_media` HA action. + {% include integrations/config_flow.md %} ### Manual configuration Under normal circumstances, Home Assistant automatically discovers your running Music Assistant Server. If there is something special about the HA or MA setup (for example, the MA server is running as a remote Docker container) or discovery is not working, you can manually specify the URL to your Music Assistant server. If the Music Assistant Server is not installed then follow these [installation instructions](https://music-assistant.io/installation/). -## Media player +## Removing the integration + +This integration follows standard integration removal. No extra steps are required. + +{% include integrations/remove_device_service.md %} + +After deleting the integration, go to the HA SETTINGS >> ADD-ONS and remove the Music Assistant Add-on from there as well (if installed). + +## Media player entities The Music Assistant integration creates media player entities for all players available in MA including those imported from Home Assistant. This is needed to provide the full functionality Music Assistant has to offer. These entities will display media information, playback progress, and playback controls. -### Action `media_player.play_media` - -Play media hosted on a Music Assistant server on a Music Assistant player. The action configuration is as described in the [media player documentation](https://www.home-assistant.io/integrations/media_player/#action-media_playerplay_media) - -The `media_content_id` payload can be any of the following: - -- The name of a track, artist or album. (for example, "Queen") -- A track or album combined with the artist name (for example, "Queen - Innuendo") -- A streaming provider URI (for example, `spotify://artist/12345`) - -#### Examples - -Play Adele's album 25 - -```yaml -entity_id: media_player.music_assistant_player -media_content_type: album -media_content_id: 'Adele - 25' -``` - -Play all tracks from Stevie Wonder in random order - -```yaml -entity_id: media_player.music_assistant_player -media_content_type: artist -media_content_id: 'Stevie Wonder' -``` - -Play the playlist The Best of Disco - -```yaml -entity_id: media_player.music_assistant_player -media_content_type: playlist -media_content_id: 'The Best of Disco' -``` - -### Action `media_player.browse_media` - -Browse the media available on a Music Assistant server. The action configuration is as described in the [media player documentation](https://www.home-assistant.io/integrations/media_player/#action-media_playerbrowse_media) - -The `media_content_type` is optional, but if used will always be `music`. - -The `media_content_id` must be a URI which is understood by MA such as `library://artist/1`, `library://album/20`, or `spotify://album/5zj4Ej0FrlJQaSo0d6cttH`. These URIs can be obtained from, for example, the output of the `get_library` or `search` actions described below or the `media_player.browse_media` HA action. The type of item that the URI refers to must be an album or artist. - -#### Examples - -Get all tracks from an album - -```yaml -action: media_player.browse_media -data: - media_content_type: music - media_content_id: library://album/20 -target: - entity_id: media_player.ma_study_player_provsp -``` - -Get all albums of an artist - -```yaml -action: media_player.browse_media -data: - media_content_type: music - media_content_id: library://artist/1 -target: - entity_id: media_player.ma_study_player_provsp -``` - -## Additional actions +## Actions ### Action `music_assistant.play_media` From d7f00b4406eee7181a0073fa48b11120720a5da1 Mon Sep 17 00:00:00 2001 From: OzGav Date: Fri, 28 Mar 2025 02:03:24 +1100 Subject: [PATCH 6/9] Code rabbit suggestions --- source/_integrations/music_assistant.markdown | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/_integrations/music_assistant.markdown b/source/_integrations/music_assistant.markdown index 172532815a2..fc6a4b55cac 100644 --- a/source/_integrations/music_assistant.markdown +++ b/source/_integrations/music_assistant.markdown @@ -25,8 +25,8 @@ All of the Home Assistant [Media Player Control Actions](https://www.home-assist The `media_content_id` payload for `media_player.play_media` can be any of the following: -- The name of a track, artist or album. (for example, "Queen") -- A track or album combined with the artist name (for example, "Queen - Innuendo") +- The name of a track, artist or album. (for example, `Queen`) +- A track or album combined with the artist name (for example, `Queen - Innuendo`) - A streaming provider URI (for example, `spotify://artist/12345`) The `media_content_id` payload for `media_player.browse_media` must be a URI of the form `library://artist/1`, `library://album/20`, or `spotify://album/5zj4Ej0FrlJQaSo0d6cttH`. The type of item that the URI refers to must be an album or artist. @@ -37,7 +37,7 @@ These URIs can be obtained from, for example, the output of the `get_library` or ### Manual configuration -Under normal circumstances, Home Assistant automatically discovers your running Music Assistant Server. If there is something special about the HA or MA setup (for example, the MA server is running as a remote Docker container) or discovery is not working, you can manually specify the URL to your Music Assistant server. If the Music Assistant Server is not installed then follow these [installation instructions](https://music-assistant.io/installation/). +Under normal circumstances, Home Assistant automatically discovers your running Music Assistant Server. If there is something special about the HA or MA setup (for example, the MA server is running as a remote Docker container) or discovery is not working, you can manually specify the URL to your Music Assistant server. If the Music Assistant Server is not installed, then follow these [installation instructions](https://music-assistant.io/installation/). ## Removing the integration @@ -49,7 +49,7 @@ After deleting the integration, go to the HA SETTINGS >> ADD-ONS and remove the ## Media player entities -The Music Assistant integration creates media player entities for all players available in MA including those imported from Home Assistant. This is needed to provide the full functionality Music Assistant has to offer. These entities will display media information, playback progress, and playback controls. +The Music Assistant integration creates media player entities for all players available in MA, including those imported from Home Assistant. This is needed to provide the full functionality Music Assistant has to offer. These entities will display media information, playback progress, and playback controls. ## Actions From d556ff7c1423753033f91c3ab2fedbd69f15a714 Mon Sep 17 00:00:00 2001 From: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com> Date: Fri, 28 Mar 2025 07:11:11 +0100 Subject: [PATCH 7/9] tiny tweaks --- source/_integrations/music_assistant.markdown | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/source/_integrations/music_assistant.markdown b/source/_integrations/music_assistant.markdown index fc6a4b55cac..275912f693e 100644 --- a/source/_integrations/music_assistant.markdown +++ b/source/_integrations/music_assistant.markdown @@ -25,19 +25,19 @@ All of the Home Assistant [Media Player Control Actions](https://www.home-assist The `media_content_id` payload for `media_player.play_media` can be any of the following: -- The name of a track, artist or album. (for example, `Queen`) -- A track or album combined with the artist name (for example, `Queen - Innuendo`) -- A streaming provider URI (for example, `spotify://artist/12345`) +- The name of a track, artist, or album. For example, `Queen`. +- A track or album combined with the artist's name. For example, `Queen - Innuendo`. +- A streaming provider URI. For example, `spotify://artist/12345`. The `media_content_id` payload for `media_player.browse_media` must be a URI of the form `library://artist/1`, `library://album/20`, or `spotify://album/5zj4Ej0FrlJQaSo0d6cttH`. The type of item that the URI refers to must be an album or artist. -These URIs can be obtained from, for example, the output of the `get_library` or `search` actions described below or the `media_player.browse_media` HA action. +These URIs can be obtained from, for example, the output of the `get_library` or `search` actions described below or the `media_player.browse_media` action from Home Assistant. {% include integrations/config_flow.md %} ### Manual configuration -Under normal circumstances, Home Assistant automatically discovers your running Music Assistant Server. If there is something special about the HA or MA setup (for example, the MA server is running as a remote Docker container) or discovery is not working, you can manually specify the URL to your Music Assistant server. If the Music Assistant Server is not installed, then follow these [installation instructions](https://music-assistant.io/installation/). +Under normal circumstances, Home Assistant automatically discovers your running Music Assistant Server. If there is something special about the Home Assistant or MA setup (for example, the MA server is running as a remote Docker container) or discovery is not working, you can manually specify the URL to your Music Assistant server. If the Music Assistant Server is not installed, then follow these [installation instructions](https://music-assistant.io/installation/). ## Removing the integration @@ -45,7 +45,7 @@ This integration follows standard integration removal. No extra steps are requir {% include integrations/remove_device_service.md %} -After deleting the integration, go to the HA SETTINGS >> ADD-ONS and remove the Music Assistant Add-on from there as well (if installed). +After deleting the integration, go to the {% my supervisor_addon title="**Settings** > **Add-ons**" addon="core_samba" %} and remove the **Music Assistant** add-on from there as well (if installed). ## Media player entities From 341bf9a984edf6cbf11fe1011b1b0903d2fdf6dd Mon Sep 17 00:00:00 2001 From: OzGav Date: Sat, 29 Mar 2025 01:41:37 +1100 Subject: [PATCH 8/9] Review suggestions --- source/_integrations/music_assistant.markdown | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/source/_integrations/music_assistant.markdown b/source/_integrations/music_assistant.markdown index 275912f693e..54884419e35 100644 --- a/source/_integrations/music_assistant.markdown +++ b/source/_integrations/music_assistant.markdown @@ -39,14 +39,6 @@ These URIs can be obtained from, for example, the output of the `get_library` or Under normal circumstances, Home Assistant automatically discovers your running Music Assistant Server. If there is something special about the Home Assistant or MA setup (for example, the MA server is running as a remote Docker container) or discovery is not working, you can manually specify the URL to your Music Assistant server. If the Music Assistant Server is not installed, then follow these [installation instructions](https://music-assistant.io/installation/). -## Removing the integration - -This integration follows standard integration removal. No extra steps are required. - -{% include integrations/remove_device_service.md %} - -After deleting the integration, go to the {% my supervisor_addon title="**Settings** > **Add-ons**" addon="core_samba" %} and remove the **Music Assistant** add-on from there as well (if installed). - ## Media player entities The Music Assistant integration creates media player entities for all players available in MA, including those imported from Home Assistant. This is needed to provide the full functionality Music Assistant has to offer. These entities will display media information, playback progress, and playback controls. @@ -203,3 +195,11 @@ Get the queue details of a Music Assistant player queue. ## Notes - Any Home Assistant players added to Music Assistant will appear duplicated as the MA version of the player is created. The original HA player can be hidden if desired. + +## Removing the integration + +This integration follows standard integration removal. No extra steps are required. + +{% include integrations/remove_device_service.md %} + +After deleting the integration, go to the {% my supervisor_addon title="**Settings** > **Add-ons**" addon="music_assistant" %} and remove the **Music Assistant** add-on from there as well (if installed). From 0e7fafee231725f4ebf57038ee8972aa0dd70461 Mon Sep 17 00:00:00 2001 From: OzGav Date: Sat, 29 Mar 2025 01:48:32 +1100 Subject: [PATCH 9/9] Update source/_integrations/music_assistant.markdown Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com> --- source/_integrations/music_assistant.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/_integrations/music_assistant.markdown b/source/_integrations/music_assistant.markdown index 54884419e35..ef03cbfaf55 100644 --- a/source/_integrations/music_assistant.markdown +++ b/source/_integrations/music_assistant.markdown @@ -198,7 +198,7 @@ Get the queue details of a Music Assistant player queue. ## Removing the integration -This integration follows standard integration removal. No extra steps are required. +This integration follows standard integration removal. {% include integrations/remove_device_service.md %}