The action you said you are using is the correct syntax, but it looks like the entity ID you are using in it does not match the input_select entity you configured…
Thanks, The source of the list is in the climate.ground_hvac, but the target is input_select.ground_hvac_vertical_swing. The resulting error is:
Error:`template value should be a string for dictionary value @ data['actions'][0]['choose'][3]['sequence'][0]['data']. Got {'options': "{{ state_attr(!input hvac_entity_id, 'swing_modes') }}\n", 'target': {'entity_id': 'input_select.loft_hvac_vertical_swing_modes'}}` .
That is what I used in the post above… it is not what you used in your original post.
That is not what I suggested using.
You can’t use !input in templates. If you are creating a Blueprint that needs to get values from inputs into templates, there is a Cookbook article for that. If you are not creating a blueprint it is highly unlikely you actually have any inputs.
Sorry for the confusion. I did replace the !input in the first section, but did not in the second. I will edit to remove the confusion. The error is NOT as you have suggested, as the error is generated by the resulting automation, not the source blueprint.
I need to get the result of the state_attr('climate.ground_hvac', 'swing_modes') into the options of the input_select.set_options using code (jinja2). That is what I am asking, and that is what I am unable to do without error. Any help with the code necessary to do this correctly is much appreciated.
I’m very doubtful that is actually working. By that I mean it may be populating the options, but the value contained in options will not be a list containing multiple items… it will be a list containing a single list-shaped string like “[auto, on]”.
I did this originally, but it was generating errors. Found the errors in another part of the code that was impacting the variables I was using. All good now.