I have been trying to adapt this neat Sonos Control Card to work with spotify playlists: https://github.com/vmcosco/HA-Sonos
It almost works, just that if I set it to use the speaker that I set as the input at the top I get the error “Unable to find referenced entities input_select.sonos_master”
When I check the entity list in HA, I see this entity is there though and that its also set.
This is the part of the ui_lovelave.yaml that send stuff to the card.
# selects the playlist/source to play and calls the script
spotify_playlist:
default:
- shuffle: true
card:
name: '[[name]]'
color: var(--paper-card-background-color)
tap_action:
action: call-service
service: media_player.play_media
service_data:
entity_id: input_select.sonos_master
media_content_type: '[[media_content_type]]'
media_content_id: '[[media_content_id]]'
enqueue: '[[enqueue]]'
template: input_button_thick_name
type: 'custom:button-card'
The input.select in the configuration.yaml looks like this
sonos_master:
name: Sonos Master Speaker
options:
- media_player.sonos_wohnzimmer
- media_player.sonos_move
- media_player.sonos_kuche
- media_player.sonos_schlafzimmer
initial: media_player.sonos_wohnzimmer
If I set the entity_id as one of my sonos speakers directly (e.g. media_player.sonos_wohnzimmer) it works, but obviously always plays the playlist on that speaker instead of what I previously clicked at the top of the cards.