Create a helper with enum , based on a generated list in template

hello

i created a helper {{states(‘input_select.enum’)}} , with 2 random options just to have a HA entity to start with.

in a template i generated a list with the options to overwrite to my helper.

how can i modify or set the attribute to : [‘10.0’, ‘36.0’, ‘59.0’, ‘77.0’, ‘94.0’]

{{state_attr('input_select.enum', 'options') == ['10.0', '36.0', '59.0', '77.0', '94.0']}}


{{states('input_select.enum')}}

thx

You can make an automation, but you should probably use an select template instead.

As petro says, you could use an automation for this with the input_select.set_options action, which you could run at HA start, or triggered by a state change in a given sensor.

However, if you wanted to follow his suggestion regarding a select template, which combines the helper and automation in one place, then I found this post by Didgeridrew to be really helpful.