This part to set the options of a select field works perfectly, however I want to replace 'type = 1 with the ‘type’ variable and I am struggling to find the right syntax. The method itself works in cards like “markdown” and " entities" but is it here possible? Perhaps/Likely the devil is in the syntax.
Guidance appriciated.
actions:
- variables:
type: "{{ states['input_select.my_contact_type'].state[:1] | int }}"
- action: input_select.set_options
data:
options: |
{{ states.binary_sensor
| selectattr('attributes.last_advert', 'defined')
| selectattr('attributes.type', 'eq', 1 )
| map(attribute='name')
| list
}}
target:
entity_id: input_select.my_selection