Establishing input_select options from a template

Hi,
Is this possible to define the input_select entity with the option list evaluated when it is needed? Which for my case means when I am opening the dashboard.

The list of options available is the result of iterating over some entities from a particular device, and then checking if some condition is met.

What I am trying to achieve is a working version of:

input_select:
  test_select:
    name: Test
    options: >
      {{ device_entities('c65373d57e19a5f717fa330e1970157e') }}

The final version would be more complex, as the output of the device_entities() will be processed to determine if and what should be provided for each entity. But for starters I would like this (or a functional counterpart) working.

The problem is, that it seems the template is not evaluated here, and the result of this configuration snippet is that I have an input_select field proposing the single option being {{ device_entities(‘c65373d57e19a5f717fa330e1970157e’) }}

Any suggestion how to achieve it?

My guess would be that this is impossible with an input_select. Instead, use a template entity select. Same same but different.

Input Selects do not support templating. You can check whether a given configuration variable accepts templates by looking in the “Configuration Variables” section of the integration’s docs.

image

The word directly after the variable name is the accepted data type; if it doesn’t say “template”, then templates are not accepted for that variable.

You will need to use a Template Select as Magnus stated above. In addition to the official docs linked above, there is a Community Cookbook article about them available:

https://community.home-assistant.io/t/template-select-entities/715177

Thanks. That works as expected. I am marking this one as a solution, as it mentions the comment with documentation, and gives a link to good example.