[Solved] 15 minutes after now

Hello everyone,

I want to activate a scene that calls a script with google assistant. The script is as follows:

'1584831441467':
  alias: Setup time 15 minutes after now
  sequence:
  input_datetime.set_datetime
  entity_id: input_datetime.test
  - data_template:
      time: {{ (now().strftime('%S') | int + (15*60)) | timestamp_custom('%H:%M:%S', true) }}

This will be saved. But when I look back at the script the data_template disappeard. What have I done wrong? Thanks in advance for all the input.

The formatting on that is all sorts of wrong. It’s technically valid yaml, so it will save…but wont do anything.

Also, why have the script name be a bunch of random numbers?

'1584831441467':
  alias: Setup time 15 minutes after now
  sequence:
    service: input_datetime.set_datetime
    data_template:
      entity_id: input_datetime.test
      time: {{ (now().strftime('%S') | int + (15*60)) | timestamp_custom('%H:%M:%S', true) }}

Single line templates need to be enclosed in quotes. Put double quotes around yours as you are using single quotes in the template.

@jocnnor you are right. The formatting is wrong. I copied it here wrong.
The script name was random generated.

@tom_l: The double quotes did the trick. Thank you.

Thanks to both for replying.

You can replace this:

{{ (now().strftime('%S') | int + (15*60)) | timestamp_custom('%H:%M:%S', true) }}

with this:

{{ (now().second + (15*60)) | timestamp_custom('%H:%M:%S', true) }}

EDIT
Apologies, I replied to the wrong person. It was intended for Gaijin66

@123 Thanks for the input. I wil try that.