Spotify controls with Sonos idea (Questions about setup)

Hi there,

pretty new to Home Assistant,so please excuse some possible dumb questions. I currently do have 2 Sonos Speakers, One Google Home plus a Denon AVR Receiver with Spotify. They are all integrated into Home Assistant and can be controlled on their own without any problems.

As the documentation states the Sonos speakers aren’t supported by the Spotify API, so they can’t be selected as a music player, nor can songs be paused or skipped. Here is an image from the concept I want to make work:
Capture

Basically the Spotify integration up top should be able to control whichever device is currently playing, plus I want to be able to see all my devices in the dropdown menu. From what I’ve learned so far this can be probably down with scripting, so here is my idea:

  • create a new entity, called just spotify (my other spotify entity does have a different name)
  • copy attributes from spotify_integration over to spotify (is this possible?)
  • change source list to present the right speakers
  • add a script that will call media_player.start based on the selection (I’m only using Spotify so this is enough for me)
  • update the play/pause and skip buttons to call media_player.skip / media_player.pause on the device, which has a state ‘playing’
  • tell my entity to use the new spotify, which should still work because the attributes are still the same

Would this be doable with HomeAssistant? Mainly the part about copying attributes and replacing some off them. Also how would you do the scripting on which entity was selected. Some guidances would be greatly appreciated.

Thanks!

1 Like

hi did you ever got this working?