I am trying to loop through and play favorite on sonos with a button press. (Mirrors the behavior of a pico audio remote)
This works to play an item in the list
WORKING
service: media_player.select_source
data:
source: "{{ (state_attr(\"sensor.sonos_favorites\", \"items\").values() | list)[2] }}"
target:
entity_id: media_player.basement
Tried the below and it does not work
NOT WORKING
service: media_player.select_source
data:
source: "{{ state_attr('sensor.sonos_favorites','items').values() | list | join('\n') }}"
target:
entity_id: media_player.basement