Jinja2 syntax - How to pass int variable into script

I have been trying to figure this out for several hours now. I have two scripts and I am trying to pass an int variable from one to the other.


master_bed_transition: 
  sequence:
    - service: script.turn_on
      entity_id: script.light_transition 
      data:
        variables: 
          time: 2 # <-- this is part of my problem
          lightname: 'ge_12724_3way_dimmer_switch_level'_switch_level'



light_transition:
  sequence
    ....

    - delay: 
        seconds: "{{ time }}"  <-- I don't know what to put here
    ....

I have tried a lot of different variations of syntax, but no dice. Any help would be appreciated.

why is there 3 single quotes in there?

For light_transition script, did you add data_template before the delay?

I must have put that extra quote in while formatting the post, because its not in the script.yaml file. Do you mean I need to format it like this?


- delay:
  data_template:
    seconds: "{{ time }}"


As far as I know, it’s currently still not possible to use a template for delay:. Have a look at this feature request.

Oh hold on, look at this! So try using delay_template: