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

Calling a script conditionally

$
0
0

@Juggler wrote:

I am attempting to call a script conditionally.

goodnight_test1:
  sequence:
    - service: tts.google_say
      data:
        entity_id: media_player.office_speaker_3
        message: "step one dot one"      
    - service_template: >
       {% if is_state('group.security_main_zone', 'on') %}
         script.security_zone_script
       {% endif %}
    - service: tts.google_say
      data:
        entity_id: media_player.office_speaker_3
        message: "step one dot two" 

When the condition of the service_template is false, I want to continue on to the next service call. This is not happening right now. It does flow through if the condition is true.

I tried putting an {% else %} script.dummy statement, but that did not work. Can anyone help?

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 95544

Trending Articles



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