Ok… So I got this script (see below) which has a template condition. I consider it as nothing special as it would also give a proper result in the test-template screen under Developer Tools. The question marks around my head start to pop-up when I have the condition uncommented in the script and try to check my configuration under Settings > Server Controls because it keeps running for minutes. When I put it in a comment block and check the configuration again it’s finished within 2 seconds. Since I’m still rather new to Home Assistant and to templates even more I’m a bit confused if it’s my template giving this strange behaviour or something else is acting up. Would like to add that I also tried a simple template like {{ 1 == 1 }}
and that also caused the long configuration check. In none of the cases where it took long I’ve seen it finish.
Hopefully someone has an idea what could cause this, because I’m not confident about restarting my RPI (default installation) with this condition uncommented
alias: "Zet soundbar aan"
icon: mdi:surround-sound
description: "Zet soundbar aan (alleen als ie uit staat)"
sequence:
- condition:
- condition: template
value_template: "{{ is_state('media_player.sony_soundbar', 'off') }}"
- service: media_player.turn_on
entity_id: media_player.sony_soundbar
SOLUTION:
As mf_social already kindly improved my script it was because of the extra line of - condition
which was simply a remaining line from copying it from an automation. As it turns out you don’t need to start a condition like in an automation, that’s where I went wrong.
After that I wondered how the nested conditions would work, found a nice explanation for those interested: explanation