I would like to combine the state of several window sensors to a string (or a set or a list, does not really matter). I tried my best, but with the following code, I get an error: “invalid template (TemplateSyntaxError: Unexpected end of template. Jinja was looking for the following tags: ‘endset’. The innermost block that needs to be closed is ‘set’.)”
Any hint is highly appreciated! My goal is to send a notification “The following windows are open {{openWindows}}” AND to blink an LED if any window is open "openWindows != ‘’ ".
Best regards,
Jonas
{% set open | string %}
{% if states('sensor.fenstersensor_room1') == 'open' %}
{% set open = open~'Room 1' %}
{% endif %}
//more rooms would follow
{{open}}
One follow-up Question: The friendly names look like this “Fenstersensor-Schlafzimmer”. Is there any easy way to extend your solution to remote “Fenstersensor-” from every entry?