You have to overwrite it in the message, not the service. But tbh, that defeats the purpose of variables as they are always resolved after the trigger. You should just put the syntax in the variable.
action:
service: system_log.write
data_template:
message: >
{% set text = "echo" %}
{{ text }}
To clarify more… each template field is independent from each other. Changes you make in 1 template will not transfer to another. Only variable templates transfer to the other templates, hence the name variables.
It’s implied. Triggers and Conditions are for automations. The action section & accompanying fields are scripts. All information about scripts are in the script documentation. By definition, actions occur after conditions and triggers, so do variables.
Thanks a lot @petro . I didn’t make the connection between an action in an automation and a normal script. For me variables were just one part of an automation. I’ll try it tomorrow. This could solve my problem i started with.
The first trigger works fine, the second returns format error and do nothing. I need to pass a variable because input time needs to be changed by a template before trigger.