Variables, loops in configuration.yaml

Hello,

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

thanks

{%
set suffix = "_sub_doods_latest"
%}
{% 
set cameras = (
  "1_front_door",
  "2_living_room",
  "3_guest",
  "4_utility",
  "5_hallway",
  "6_driveway"
)
%}

{% for camera in cameras %}
  - platform: generic
    name: {{ camera }}
    still_image_url: http://127.0.0.1:8123/local/cctv/{{ 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.