This blueprint will help you create select
entities that are automatically populated with all the scene
entities from the selected Areas. Selecting a value from the entity’s options through dashboard or script action will activate that scene.
Features:
- Both Area IDs and Area Names are supported as input
- Multiple Areas can be used.
blueprint:
author: Didgeridrew
homeassistant:
min_version: 2025.7.0
name: Area-Based Scene Select
description: |
Creates a Select entity that is automatically populated with all the
scene entities from the selected Areas. Selecting a value from the
entity's options will turn that scene on.
domain: template
input:
areas:
name: Areas
description: 'The Area(s) you want to select Scenes from'
selector:
area:
multiple: true
entity:
domain: scene
variables:
area_ids: !input areas
select:
state: |
{% set area_ids = [area_ids] if area_ids is not list else area_ids %}
{% set ent = (area_ids|map('area_entities')|flatten|select('match', 'scene.')
|sort(attribute='state', reverse=true)|list|first) %}
{{ state_attr(ent, 'friendly_name') | default('No Scene Selected', 1)}}
optimistic: true
options: |
{% set area_ids = [area_ids] if area_ids is not list else area_ids %}
{% set ents = area_ids|map('area_entities')|flatten|select('match', 'scene.')|list %}
{{ ['No Scene Selected'] + expand(ents)|map(attribute='name')|list|sort }}
select_option:
- condition: template
value_template: "{{ option != 'No Scene Selected' }}"
- service: scene.turn_on
target:
entity_id: |
{{ states.scene | selectattr('name', 'eq', option) | map(attribute='entity_id') | first }}