Template delay in automation

Hi,

If I test
( ‘input_number.temps_d_arrosage’ = 120)

minutes: {{ states('input_number.temps_d_arrosage') | int }}

it returns

minutes: 120

but it y write in automation

alias: Arrosage au coucher du soleil
description: ""
trigger:
  - platform: sun
    event: sunset
    offset: "02:00:00"
action:
  - service: switch.turn_on
    data: {}
    target:
      entity_id: switch.arrosage
  - delay:
      hours: 2
      minutes: {{ states('input_number.temps_d_arrosage') | int }}
      seconds: 0
      milliseconds: 0
  - service: switch.turn_off
    data: {}
    target:
      entity_id: switch.arrosage
mode: single

it returns
Message malformed: expected float for dictionary value @ data[‘action’][1][‘delay’][‘minutes’]

Why ?

(I tried with

minutes: {{ states('input_number.temps_d_arrosage') | float}}

it’s the same)

Single line templates must be enclosed in quotes:

      minutes: "{{ states('input_number.temps_d_arrosage') | int }}"