Service call with template

I would like to call the following service (zone cleaning for roborock vacuum)

                action: call-service
                service: vacuum.send_command
                target:
                  entity_id: vacuum.roborock_s8_pro_ultra
                data:
                  command: app_zoned_clean
                  params:
                    - - 19608
                      - 31338
                      - 23947
                      - 34364
                      - 1

instead of using a “1” in the last line, i would like to use

- {{states('input_select.roborock_durchlaufe')}}

but after saving (its used in a button card), its replaced with

"[object Object]": null

Using

- "{{states('input_select.roborock_durchlaufe')}}"

does not work.

Any ideas?

Thank you for your support.

Use a script:

Where are you trying to set this up?

The action key of an automation shouldn’t have call-service after it, and card actions do not normally accept templating at all.