Dynamic entity (Helper)

Hello,

It would be great to have a helper that returns an entity based on different conditions. In my case I would like to define a media_player for each user of HA and based on conditions like in what room that user is it would be the media player that is located in that room. This should also work in the UI not just through a script. In this scenario I would have just one media page and could control the media player in every room without creating a media page for every room where the page is identical and just the entity_id is different.

The helper should be written like a script. You should be able to add different conditions and return an entity_id inside the script. If no entity_id is returned the device becomes unavailable.

What do you guys think? Or maybe it is already possible, and I just didn’t find this?

There are already a variety of dynamic entities, including some that are similar to core helpers. Template entities

Some of what you have described sounds similar to an automation with an Input select or a Template select