I have integrated Google Assistant and Home assistant so that, for instance, when I say “activate play dinner music” it does the following:
play_dinner_music_script:
sequence:
- service: media_player.select_source
data:
entity_id: media_player.dining
source: "Dinner Playlist"
- service: media_player.play_media
data:
entity_id: media_player.dining
media_content_id: "Dinner Playlist"
media_content_type: music
Playing the playlist “Dinner Playlist” which is in my Sonos Favourites on my Sonos Media Player in the dining room.
Now I’d like it to pick a random playlist from a list and say what it has chosen.
So far, I have done this:
play_random_music_script:
sequence:
- service: media_player.play_media
data:
entity_id: media_player.office
media_content_id: >
{{ ['Dinner Playlist',
'Jazz & Classic Dinner Playlist',
'Top 1000 van 80s 90s 00s',
'Mijn Shazam-nummers'] | random}}
media_content_type: music
and added
tts:
- platform: google_translate
However, it already fails with the random music and I haven’t gotten to the tts part yet. Any help?