Mabaelst
(Bart Teuwen)
April 10, 2025, 3:57pm
1
I have the following question:
I have the following code:
Excl: |
{% if trigger.payload == 'on' %}
{% if Target == 'bathroom_mb' %}
everything|group|sink
{% else %}
' '
{% endif %}
{% endif %}
This gives the following result:
Excl: everything|group|sink
If I change the code to:
Excl: |
{% if trigger.payload == 'on' %}
everything|group|
{% if Target == 'bathroom_mb' %}
sink
{% else %}
' '
{% endif %}
{% endif %}
I get the following result:
Excl: |-
everything|group|
sink
Can I fix this or is what I want not possible?
thanks for any response.
Hello Bart Teuwen ,
Try this or a variation. The “-” removes newline characters.
Excl: |
{% if trigger.payload == 'on' -%}
everything|group|
{%- if Target == 'bathroom_mb' -%}
sink
{% else %}
' '
{% endif %}
{% endif %}
Mabaelst
(Bart Teuwen)
April 10, 2025, 5:05pm
3
1 Like
Please consider marking my post with the Solution tag. It will automatically place a check-mark next to the topic’s title which signals to other users that this topic has been resolved. This helps users find answers to similar questions.
For more information about the Solution tag, refer to guideline 21 in the FAQ .
tom_l
April 10, 2025, 11:24pm
5
The topic was not categorised so no solution tag was available. Fixed.