Script - apply sequence to multiple entities

How can I apply the sequence in this script to multiple entities ?

Without “multiple: true” the script works as expected
But looking for a way apply the sequence to multiple selected entities.
I do get the selector and can select multiple entities but it fails to run and returns
" Error rendering data template: TemplateError: Must provide a device or entity ID"

saw “for each” , “loop” options but not totally sure how to implement correctly and looking for advice.

Thank you,

alias: THERMOSTATS sinope set floor control mode ZHA 
fields:
  entity_id:
    required: true
    description: Entity ID of your thermostat
    selector:
      entity:
        multiple: true
        filter:
          domain: climate
  mode:
    required: true
    description: Select desired option
    default: ambiant
    selector:
      select:
        options:
          - floor
          - ambiant
mode: single
icon: mdi:account
sequence:
  - service: zha.set_zigbee_cluster_attribute
    data:
      ieee: >-
        {{ device_attr(entity_id, 'identifiers') | selectattr(0,'eq','zha') |
        map(attribute=1) | first }}
      endpoint_id: 1
      cluster_id: 65281
      cluster_type: in
      attribute: 261
      value: "{{'1' if mode == 'ambiant' else ('2' if mode == 'floor' else '1')}}"
sequence:
  - repeat:
      for_each: "{{ entity_id }}"
      sequence:
        - variables:
            ieee: |
              {{ device_attr(repeat.item, 'identifiers') 
              | selectattr(0, 'eq', 'zha') | map(attribute=1) | first }}
        - service: zha.set_zigbee_cluster_attribute
          data:
            ieee: "{{ ieee }}"
            endpoint_id: 1
            cluster_id: 65281
            cluster_type: in
            attribute: 261
            value: "{{'1' if mode == 'ambiant' else ('2' if mode == 'floor' else '1')}}"

Works perfectly.
One more thing in my overloaded HA toolbox :grinning:
Thank you!