To clarify a couple points in addition to Edwin’s answer…
The configuration I posted was to meet the criteria you gave i.e. “scene name starting with scene.living…”. To do that I used the test match which is specific to the start of the ID string. If you want it to find all the scenes that have “studio” anywhere in the ID string, replace match with search.
It is also possible to use the scene entities’ Areas directly instead of basing if off the entity ID, but these templates do not actually check the Area.
Edwin has already covered the concept of “active” scenes…
What is displayed is the entity’s state which is only kind of the selection. The select entity’s state is determined by the template, which will always return the scene that was most recently activated.
As Edwin stated it is possible to add another option like a blank or “No Scene Selected”, etc. And it is also possible to have the state reset to that value if no scene has been activated with a given amount of time.
template:
- select:
- name: "Studio Scenes"
state: >
{% set reset_minutes = 5 %}
{% set recent = states.scene | selectattr('object_id', 'search', 'studio')
| sort(attribute='state', reverse=true) | list | first %}
{{ recent.name if recent.state|as_datetime >
now() - timedelta(minutes=reset_minutes) else 'No Scene Selected' }}
options: >
{{ ['No Scene Selected'] +
states.scene | selectattr('object_id', 'search', 'studio')
| map(attribute='name') | list | sort }}
select_option:
- service: scene.turn_on
target:
entity_id: >
{{ states.scene | selectattr('name', 'eq', option)
| map(attribute='entity_id') | first }}
I have posted a Blueprint for Area-based Scene Selects in the Blueprint Exchange.
* Please note that the blueprint does not include the auto-reset functionality.