Using input_number Delay Variable from call-service

Maybe I’m trying to do something that’s not allowed and needs to be done from a data_template, but I don’t seem to see that as an option from the call-service action. I keep getting format errors like below (tested with ’ in multiple places)

Run Sprinklers Schedule: Error rendering Run Sprinklers Schedule delay template: offset 00:00:{{ states('input_number.sprinkler_zone_1_timer') | int }} should be format 'HH:MM' or 'HH:MM:SS'
Run Sprinklers Schedule: Error rendering Run Sprinklers Schedule delay template: offset 00:00:'{{ states(''input_number.sprinkler_zone_1_timer'') | int }}' should be format 'HH:MM' or 'HH:MM:SS'
                tap_action:
                  action: call-service
                  service: script.run_sprinklers_schedule
                  service_data:
                    sprinkler_zone_1_delay: '00:00:{{ states(''input_number.sprinkler_zone_1_timer'') | int }}'
                    sprinkler_zone_2_delay: '00:00:{{ states(''input_number.sprinkler_zone_2_timer'') | int }}'
                    sprinkler_zone_3_delay: '00:00:{{ states(''input_number.sprinkler_zone_3_timer'') | int }}'
                    sprinkler_zone_4_delay: '00:00:{{ states(''input_number.sprinkler_zone_4_timer'') | int }}'
                    sprinkler_zone_5_delay: '00:00:{{ states(''input_number.sprinkler_zone_5_timer'') | int }}'
                    sprinkler_garden_delay: '00:00:{{ states(''input_number.sprinkler_garden_timer'') | int }}'
                type: 'custom:button-card'

I don’t know if you can use templates there. I’d suggest moving that code into another script, and then calling that script instead from the tap_action.

Yeah, I think I was being a little hopeful in having a single script to hold the delays and passing the variables to it. I ended up coding them in to the script itself to read the input_number like the documentation shows and moved on. Thanks for the response!