I am trying to create a dropdown select within my dashboard, that allows me to select a media player I can “target”. Once this is selected, I wish to press a button on the same tile to play a media item on that player (I wish for there to be “many” buttons, each one corresponding to what to play on the device. Potentially even a further dropdown.
Using the forums, searching tool and a bit of ChatGPT, I managed to get the following as some “test” code, but I always get Message Malformed errors “not a valid value for dictionary value @ data[‘sequence’][0][‘entity_id’]”.
The code I have is as follows:
alias: Play Radio Media
sequence:
- service: media_player.play_media
data:
media_content_id: media-source://radio_browser/16aef2cf-caf8-48f6-9d60-69196661dfd1
media_content_type: audio/mpeg
metadata:
title: Tomorrowland One World Radio
thumbnail: https://www.tomorrowland.com/home/apple-icon-120x120.png
media_class: music
children_media_class: null
navigateIds:
- {}
- media_content_type: app
media_content_id: media-source://radio_browser
- media_content_type: music
media_content_id: media-source://radio_browser/popular
entity_id: >
{% if is_state('input_select.media_player_dropdown', 'Living Room') %}
media_player.living_room_speaker
{% elif is_state('input_select.media_player_dropdown', "Pedro's Room") %}
media_player.pedro_s_speaker
{% elif is_state('input_select.media_player_dropdown', "Laura's Room") %}
media_player.laura_s_speaker
{% elif is_state('input_select.media_player_dropdown', "Tiago's Room") %}
media_player.tiago_s_speaker
{% elif is_state('input_select.media_player_dropdown', 'Kitchen') %}
media_player.kitchen_speaker
{% elif is_state('input_select.media_player_dropdown', 'Garden') %}
media_player.garden
{% endif %}
mode: single
Any suggestions on how to get this working as I descrbibed? Thank you