Variables, loops in configuration.yaml


is there anyway to have this in configuration.yaml? if yes, how do I call jinja?

I can run the below code in developer-Template tool but I don’t know how to fit this in yaml


set suffix = "_sub_doods_latest"
set cameras = (

{% for camera in cameras %}
  - platform: generic
    name: {{ camera }}
    still_image_url:{{ camera }}{{suffix}}.jpg
    verify_ssl: false
{% endfor %}

You can’t use Jinja2 templating to generate YAML code (not in scripts, automations, Template Sensors, etc).

The Template Editor is purely for experimenting with Jinja2 templates. You can easily define things there that work in theory (like the YAML generating template you have created) but have no application elsewhere in Home Assistant.