Script with passed field / list (multiple label selection) not working

Hi probably something very simple - but I try now already for houres:

My script should get a list of labels (I love the new labels) and run some services with it.

Here is an example with a single service:

alias: set_sonnenschutz
fields:
  labels:
    selector:
      label:
        multiple: true
    name: Label_Test
    required: true
sequence:
  - alias: Set tilt
    service: cover.set_cover_tilt_position
    target:
      label_id: '{{ labels }}'
    data:
      tilt_position: 60

no matter what I try it gives me an error, I tried for the target: lable_id:

label_id: '{{ labels }}'
label_id: '{{ labels | string }}'
label_id: '{{ labels | list}}'
label_id: '{{ labels | join('', '') }}'

I call it as (created in the UI / dev tools / services) :

service: script.1714122790820
data:
  labels:
    - rechts
    - vorne

And always get errors like:

with this additional but wrong “list dash”

  target:
    label_id:
      - - rechts
        - vorne

Hard coding it like:

    service: cover.set_cover_tilt_position
    target:
      label_id: 
        - rechts
        - vorne
    data:
      tilt_position: 60

works fine.

Regarding this result:

target:
    label_id:
      - - rechts
        - vorne

It created a list whose first item is the list you passed to it. In other words, regardless of what you pass to it (a string, list, or even dictionary), it simply becomes the first item of a list.

I’m not sure if that’s intentional or a bug but it makes passing lists to label_id ineffective. It seems like a bug so I suggest you report it as an Issue in Home Assistant’s GitHub Core repository.