@moostmartijn wrote:
I would like to trigger a script or shell command in a script when the state of an input_select and a sensor matches. The script looks like this:
print_file: alias: print selected file sequence: - service_template: >- {% if is_state('input_select.file_to_print', '{{ states("sensor.octoprint_file_1") }}') %} script.print_file_1 {% elif is_state('input_select.file_to_print', '{{ states("sensor.octoprint_file_2") }}') %} script.print_file_2 {% endif %}
I’m not sure if I used the service_template correctly, when I trigger the script it returns the following:
Template renered invalid service:
I’m on the end of my project and I could use some helpt to trigger this script correctly. Thanks in advance!
Posts: 1
Participants: 1