Using state in a delay part of a script gives an erorr

What do i wrong, cant i use states in a script, delay?, also use float, left the quotes etc., same error
When i disable the delay part it works

Message malformed: expected float for dictionary value @ data[‘sequence’][0][‘delay’][‘minutes’]

alias: Avond_delay
  - delay:
      hours: 0
      minutes: '{{ states('input_number.zon_onder_bijstelling')|int }}'
      seconds: 0
      milliseconds: 0
    enabled: true
  - service: input_boolean.turn_on
    data: {}
      entity_id: input_boolean.scene_avond
mode: single

Look at what your pairs of quotes enclose.

Do this instead:

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

Thanks tom, works!

1 Like