Template list to yaml format

alias: Enable ZEN71 scene and white indicator
sequence:
  - service: zwave_js.set_config_parameter
    data:
      endpoint: 0
      parameter: "9"
      value: "1"
    target:
      device_id:
        - zwave.id1
        - zwave.id2
{{ state_attr('sensor.device_ids','device_ids') }}
[
  "zwave.id1",
  "zwave.id2"
]

How can I pass the state_attr('sensor.device_ids','device_ids') to device_id. I have tried this, but it’s not working
device_id: "{{ state_attr('sensor.device_ids','device_ids') }}"

I also tried this:

      device_id: >
        {% for device_id in state_attr('sensor.zen71_device_ids','device_ids') %}
        - {{ device_id }}
        {% endfor %}

Added screenshot of {{ state_attr('sensor.device_ids','device_ids') }}

The value of a device_id should be a long alphanumeric string like this:

4d008806cd3f0815b7c45579c71444de

Does this:

{{ state_attr('sensor.device_ids','device_ids') }}

report a list of long alphanumeric strings?

If it does then this should work:

alias: Enable ZEN71 scene and white indicator
sequence:
  - service: zwave_js.set_config_parameter
    data:
      endpoint: 0
      parameter: "9"
      value: "1"
      device_id: "{{ state_attr('sensor.device_ids','device_ids') }}"

Here is the screenshot of {{ state_attr('sensor.device_ids','device_ids') }} . It’s a list of device_id