Reusable template sensor

Hey homies,
My first post here!

I’m trying to calculate the heatloss for my windows.
You can imagine that every window has a different size (and insulation value), so I need to make a template sensor for every window…

Is there a way in which I can make some sort of an reusable template sensor? Where I can put in the size, insulation values etc. And the template sensor returns the calculated value to the correct sensor?

I tried it with anchors but you can’t use them (as far as i know) in a string.
I guess it’s simply not possible but if anyone knows how you can make it work, let me know!

The template sensor currently looks like this:

platform: template
sensors:
  livingroom_window_heatloss:
    friendly_name: Livingroom window heatloss
    unit_of_measurement: W
    value_template: "{{ (state_attr('weather.outside', 'temperature') - states('sensor.inside_temperature') | float * **glass insulation value** * **surface of window**)}}"

No, you have to create a template sensor for each window.

Copy, paste then edit.