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 }}"