Input_datetime for a delay

Hello,
I would like to use an input_datetime for a delay, but I don’t find the right syntax:

action:

  • delay: {{states(‘input_datetime.coldperiodeduration’)}}

I try it in developpement tool and It show the right value.

in automation it is an error:

Error loading /config/configuration.yaml: invalid key: “OrderedDict([(“states(‘input_datetime.coldperiodeduration’)”, None)])”
in “/config/automations/coldperiod.yaml”, line 36, column 0

Can anybody correct me please ?

Best regards

Thierry

You need to put single line templates in quotes:

delay: "{{states('input_datetime.coldperiodeduration')}}"

You also need to remember to format your pasted config correctly in your forum topics.

It appears we simultaneously replied to a question that was posted in multiple places.

Oh good grief. :roll_eyes:

@vormsty don’t cross post like that either. One topic per issue is sufficient.

Ok, sorry I was very disappointed.
Thanks for your response

Many thanks!