In a template sensor I want to write to a element of array in a for loop:
{% set arrayname = [] %}
{% for i in range ( 0 , 3) %}
{% arrayname[i] = i %}
{% endfor %}
{{arrayname}}
What is wrong?