From 6d29aff93c4eb6b0bfa937dd2be5237d135cd7fe Mon Sep 17 00:00:00 2001 From: Juri Calleri Date: Fri, 14 Mar 2025 02:09:16 +0100 Subject: [PATCH] add workaround to use spotify on sonos --- source/_integrations/spotify.markdown | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/source/_integrations/spotify.markdown b/source/_integrations/spotify.markdown index a5762fdc29d..4ff60b63a9a 100644 --- a/source/_integrations/spotify.markdown +++ b/source/_integrations/spotify.markdown @@ -156,4 +156,18 @@ The `media_content_id` value can be obtained from the Spotify desktop app by cli ## Unsupported devices -- **Sonos**: Although Sonos is a Spotify Connect device, it is not supported by the official Spotify API. +- **Sonos**: Although Sonos is a Spotify Connect device, it is not supported by the official Spotify API. One workaround to use Sonos players with Spotify is through [Music Assistant](https://www.music-assistant.io/) using the action `music_assistant.play_media`. Music Assistant creates another media_player entity named after the original media_player, which you can use to play from Spotify. + +```yaml +# Example script to play playlist using Music Assistant +script: + play_jazz_guitar: + sequence: + - action: music_assistant.play_media + target: + entity_id: media_player.living_room_player + data: + media_id: "https://open.spotify.com/playlist/5xddIVAtLrZKtt4YGLM1SQ?si=YcvRqaKNTxOi043Qn4LYkg" + media_type: playlist +``` +