I am looking to set up a single automation to play music from a voice command. I currently have it set up to listen for a sentence, and then I have a “Choose” action set up with several different play lists that I would like it to randomly select from to play on the given media device. As it stands now, it looks like it will only play the first one (I am trying to avoid tying the choose options to custom trigger_ids to make the selection). Below is an example of what I have so far:
alias: Voice - Play Music
description: ""
trigger:
- platform: conversation
command: play music
- platform: conversation
command: play something else
condition: []
action:
- choose:
- conditions: []
sequence:
- service: media_player.play_media
target:
entity_id: media_player.spotify_device
data:
media_content_id: spotify:playlist:example
media_content_type: spotify://playlist
metadata:
title: Title
thumbnail: >-
https://mosaic.scdn.co/640/ab67616d0000b2736da502e35a7a3e48de2b0f74ab67616d0000b2738f6b4035c82eb9cf42e9d8d7ab67616d0000b273d1fd8f264564d9eef7617a45ab67616d0000b273f9b3ece3271d3a5fa73d3759
media_class: playlist
children_media_class: track
navigateIds:
- {}
- media_content_type: spotify://current_user_playlists
media_content_id: current_user_playlists
- media_content_type: spotify://playlist
media_content_id: spotify:playlist:example
- conditions: []
sequence:
- service: media_player.play_media
target:
entity_id: media_player.spotify_device
data:
media_content_id: spotify:playlist:example
media_content_type: spotify://playlist
metadata:
title: Title
thumbnail: >-
https://mosaic.scdn.co/640/ab67616d0000b2732b617b9b905a71a023912f14ab67616d0000b2739d9f314922f1decc81349d93ab67616d0000b273b42c10508ff1318d68663421ab67616d0000b273e673240af5b70b96fddac9dc
media_class: playlist
children_media_class: track
navigateIds:
- {}
- media_content_type: spotify://current_user_playlists
media_content_id: current_user_playlists
- media_content_type: spotify://playlist
media_content_id: spotify:playlist:example
- conditions: []
sequence:
- service: media_player.play_media
target:
entity_id: media_player.spotify_device
data:
media_content_id: spotify:playlist:example
media_content_type: spotify://playlist
metadata:
title: Title
thumbnail: https://i.scdn.co/image/ab67706f000000039205ddd6990d57d56db91b81
media_class: playlist
children_media_class: track
navigateIds:
- {}
- media_content_type: spotify://categories
media_content_id: categories
- media_content_type: spotify://category_playlists
media_content_id: id_here
- media_content_type: spotify://playlist
media_content_id: spotify:playlist:example
mode: single