Input_select value in new play_media feature?

Is it possible to use the value of an input_select for the target entity_id (media player)?

I tried simply removing the speaker entity id with the input_select entity id that contains the speaker entity id, but that doesn’t seem to work.

Use the states function in a template to get the input_select’s value.

For example, if input_select.rooms contains names like kitchen, family_room, bedroom, etc then the template can be something like this:

service: media_player.play_media
target:
  entity_id: "media_player.{{ states('input_select.rooms') }}"
data:
   ... etc ...

The exact form of the template will depend on how closely the input_select’s values match the names of your media_players.

Thank you, that worked perfectly.

1 Like