Making a delay in an automation = the value of an input_number

Can anyone give me any pointers???

I have an input number that has a value of 0-300 in steps of 10.

How can I create an automation that sets a delay value in increments of 4.5seconds for every step of 10 in the input number???
Ive tried this but to no avail :frowning:

delay: minutes: '{{ (states('input_number.volume_to_add') | int + 4.5 /60 }}'
- delay:
    minutes: "{{ (states('input_number.volume_to_add') | int * 0.0075) | round(0) | int }}"

Or:

- delay: "{{ (states('input_number.volume_to_add') | int * 0.45) | round(0) | int }}"

Hey thanks Tom

Works a treat!

Do you see what you did wrong though?

Aside from the formatting and calculation you also used single quotes everywhere. This led to the opening and closing quotes only enclosing:

minutes: '{{ (states('

You need to use double quotes outside your single line templates if using single quotes inside.

TBH - I didnt see the single quotes. Ive been playing with this for hours. Thx for pointing it out.

โ€œIm such a moronโ€ :slight_smile: