Using templates for input_select.set_options (populating options within an input selector)

If you simply want to create a list of each zone’s object_id (the object_id in zone.office is office) then you can do that, without using a for-loop, like this:

action:
  - service: input_select.set_options
    target:
      entity_id: input_select.di_zhi
    data:
      options: "{{ states.zone | map(attribute='object_id') | list }}"
3 Likes