Home Assistant process YAML first then Jinja2 second therefore you cannot use Jinja templating to generate YAML within configuration.yaml
. More information here.
What you can do is use Jinja2 templating in the Template Editor to generate YAML, then copy the generated YAML into configuration.yaml
(see example). It’s up to you to decide if that’s faster than creating a single entity’s configuration and then copy-pasting it to create other entity configurations.