Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 106212

Script not working as expected, help!

$
0
0

@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

Read full topic


Viewing all articles
Browse latest Browse all 106212

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>