Gaijin66
(Gerrit de Boer)
1
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.
jocnnor
(Jim O'Connor)
2
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) }}
tom_l
3
Single line templates need to be enclosed in quotes. Put double quotes around yours as you are using single quotes in the template.
Gaijin66
(Gerrit de Boer)
4
@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.
123
(Taras)
5
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
Gaijin66
(Gerrit de Boer)
6
@123 Thanks for the input. I wil try that.