This sensor calculates the average temperature of a zone; source sensors are specified in the sensor definition, without the need of a group or an extensive search.
- platform: template
  sensors:
    zg_average_temperature:
      friendly_name: "Living Area Average Temperature"
      unit_of_measurement: "°C"
      value_template: >-
        {%- set sensors = ['sensor.temperatura_soggiorno_temperature', 'sensor.temperatura_cucina_temperature', 'sensor.mi_air_purifier_3_3h_temperature', 'sensor.temperatura_soggiorno_2_temperature'] -%}
        {%- set active_sensors = states|rejectattr('state','in',['unavailable','unknown','none']) | selectattr('entity_id', 'in', sensors) | map(attribute='state') | map('float') | list -%}
        {%- set active_count = active_sensors | count -%}
        {%- if active_count > 0 -%}
          {%- set average = active_sensors | sum / active_count-%}
          {{ average|round(1) }}
        {%- else -%}
          unavailable
        {%- endif -%}
This Home Assistant template sensor, zg_average_temperature, calculates the average temperature for a specified area (in this case, the living area).
The benefit of an average temperature sensor is not only to measure a large area with more sensors, but also to create redundancy: infact, if a sensor is not available, you can use others to ensure the continuity of the automations based on that sensors (my heating system climate entity is based on this).
You can do the same with other numeric sensors, like humidity, pressure, and so on.
Here's how it works:
Data Source:
sensor.temperatura_soggiorno_temperature, sensor.temperatura_cucina_temperature, sensor.mi_air_purifier_3_3h_temperature, and sensor.temperatura_soggiorno_2_temperature.Filtering Valid Sensors:
unavailable, unknown, or none.Average Calculation:
unavailable.Even if I'll try to keep all this pages updated, products change over time, technologies evolve... so some use cases may no longer be necessary, some syntax may change, some technologies or products may no longer be available. Remember to make a backup before modifying configuration files and consult the official documentation if any concept is unclear or unfamiliar. 
Use this guide under your own responsibility.
This work and all the contents of this website are licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License (CC BY-NC-SA 4.0).
You can distribute, remix, adapt, and build upon the material in any medium or format, for noncommercial purposes only by giving credit to the creator. Modified or adapted material must be licensed under identical terms.
You can find the full license terms here