Dear all,
Can somebody help me, please. I’m trying to query a variable in a script. No error is reported. But it never jumps into the branch. What am I doing wrong, or can’t this stuff work?
Example Code:
#**Automation** (Only the call of the service):
action:
- service: script.script_rollo_open_all
data:
title: 'Sommerautomatisierung'
message: 'Rollo am Morgen zum Lüften geöffnet!'
orientation: 'all'
#**Script** (I switch a Boolean as an example):
script_rollo_open_all:
fields:
title:
description: 'The title of the notification'
example: 'State change'
message:
description: 'The message content'
example: 'The light is on!'
orientation:
description: 'geographic direction'
example: 'all'
sequence:
# send a message
- service: notify.telegram
data_template:
title: "{{ title }}"
message: "{{ message }}"
# Test
- service: input_boolean.turn_on
data_template:
entity_id: >
{% if ( "{{ orientation }}" == 'all' ) %}
input_boolean.automatisierung_schlafzimmer
{% endif %}
this example does not work: ( “{{ orientation }}” == ‘all’ )
this example works: is_state(‘input_boolean.automatisierung_gaestezimmer’, ‘on’)
Is it even possible to query a string variable in a script with an “If”?
I hope someone can help me.
BR Markus