Enable or Disable entities used in a template

Hi,
I have this template to calculate Average temperature in my house:

  - sensor:
      - name: "Temperatura Media"
        unit_of_measurement: "°C"
        unique_id: temperatura_media
        state: >
          {% set camera = states('sensor.netatmo_camera_da_letto_temperature') | float %}
          {% set cucina = states('sensor.xiaomi_temp_cucina_temperature') | float %}
          {% set ingresso = states('sensor.netatmo_ingresso_temperature') | float %}
          {% set salone = states('sensor.xiaomi_temp_salotto_temperature') | float %}
          {% set mansarda = states('sensor.xiaomi_temp_mansarda_temperature') | float %}

          {{ ((camera + cucina + ingresso + salone + mansarda) / 5) | round(1, default=0) }}

It works fine.
Because on winter I do not use and heat some room, based on day of the week, I would like to make this calculation configurable without editing any time the configuration file.
My idea is to add 5 switch helpler, one for each sensor, to enable or disable sensor from the dashboard, but I have no idea how to integrate in this template.

Any help would be appreciated

Marco

Hi,
here is how I did using a Helper Template:

  {% set device = 1 | int %}
  {% set ttot = states('sensor.corridoio1_temperatura_ingresso') | float %}

  {% if states('input_boolean.media_temperatura_cucina') == 'on' %}
    {% set ttot = states('sensor.xiaomi_temp_cucina_temperature') | float + ttot %}
    {% set device = device + 1 | int %}
  {% endif %}

  {% if states('input_boolean.media_temperatura_salotto') == 'on' %}
    {% set ttot = states('sensor.xiaomi_temp_salotto_temperature') | float + ttot %}
    {% set device = device + 1 | int %}
  {% endif %}

  {% if states('input_boolean.media_temperatura_camera') == 'on' %}
    {% set ttot = states('sensor.netatmo_camera_da_letto_temperature') | float + ttot %}
    {% set device = device + 1 | int %}
  {% endif %}

  {% if states('input_boolean.media_temperatura_mansarda') == 'on' %}
    {% set ttot = states('sensor.xiaomi_temp_mansarda_temperature') | float + ttot %}
    {% set device = device + 1 | int %}
  {% endif %}
 

  {{ (ttot / device) | round(1) }}