Confused on how to use a template for displaying a list of scenes that I can activate

What I want to do is add a card with all the scenes for an area and be able to activate them.

I found this great post with examples in the comments, but for the life of me I can’t figure out how to insert a template into a card.

Template Select - Configuration - Home Assistant Community (home-assistant.io)

I’m guessing that I’ve got this all wrong in my head, but all I want is for a card to have a current list of all scenes for an area.

The template doesn’t go in the card. The Template select is setup in your configuration.yaml file which creates an entity you can place in a card. Here’s a basic example of the entity from the post you linked:

Another option would be to use a Auto-Entities custom card like:

Thanks, the auto entities is more what I was looking for.

One question, do you know of an easy way to filter the scenes so that it only includes lights scenes? I can’t seem to find the correct property/value combination to only show those.

How are you identifying light scenes?

If you include “light” in the entity ID or name, or give them a custom attribute, you can use a variation of the template from the thread you linked in your first post in an Auto-Entities card:

type: custom:auto-entities
card:
  type: entities
  title: Basement Light Scenes
  show_header_toggle: false
filter:
  template: |
    {{ expand(area_entities("Basement"))
    | selectattr('domain', 'eq', 'scene')
    | selectattr('entity_id', 'search', 'light')
    | map(attribute='entity_id')
    | list }}

Thanks for the suggestion. While it didn’t work (mainly because hue entities aren’t names in a standardized fashion), it did lead me to the solution I wanted. Which is to exclude scenes that have a naming convention that I CAN control. In this case, blinds.

Are the scenes coming directly from the Hue integration? (I don’t have any Hue devices, so forgive my ignorance)

Using custom attributes can be a handy trick when you need a way to select entities and altering entity ids or names is out of the question.

Yep, Hue scenes aren’t editable in any way, but my blind scenes are all me!

1 Like