{% for section in sections %} {% if "type" in section: %} {% if weather["system_on"] and section['type'] == "weather": %} {% endif %} {% else %} {% endif %} {% endfor %}