Hi,
can someone explain to me, why this is working:
condition: template
value_template: 'is_state(''sensor.wasser_weiss_unten'',''ON'')'
and this doesn’t:
condition: state
entity_id: sensor.wasser_weiss_unten
state: 'ON'
Whats the difference?
Regards
Tobi
tom_l
June 18, 2021, 11:11am
2
No, I can’t explain it. They should have the same effect.
tom_l
June 18, 2021, 11:13am
3
Try the automation trace to see what is happening.
What do you mean by automation trace?
tom_l
June 22, 2021, 8:30pm
5
Go to Configuration / Automation and find your automation. Click on the clock icon on the right hand side. You can then see what conditions were true or false and why.
123
(Taras)
June 22, 2021, 8:43pm
6
Actually, that should not work because it’s an invalid template. This would be valid (note the use of double braces to enclose the statement):
condition: template
value_template: '{{ is_state(''sensor.wasser_weiss_unten'',''ON'') }}'
1 Like
Troon
(Troon)
June 22, 2021, 9:02pm
7
Further to @123 ’s observation, is it really a sensor with a state of 'ON'
or a binary sensor with a state of 'on'
?
The original incorrect un-braced “template” probably evaluates true
because it is a string rather than something undefined/null.
Can we see a screenshot of Developer Tools / States showing that sensor please?
Hi,
thank you for the many replies and help.
@123 , You are right with the double braces it works correct.
Now also the state condition works, don’t know what 's been the problem. So the issue is solved for me.