Averaging values from multiple temperature sensors

When multiple temperature sensors are present in a room, you can easily calculate their average temperature.

To achieve this, follow these steps:

  1. In the CLU, create a user feature (avg_value) of type number. This variable will store the calculated average temperature:



  2. Create a script (SCR_avg_value) that sums the values from all temperature sensors and then divides the sum by the number of sensors. The result will be stored in the previously created variable:
    CLU->avg_value = (CLU->xONEW_SENSOR_01->Value + CLU->xONEW_SENSOR_02->Value + CLU->xONEW_SENSOR_03->Value + CLU->ONEW_SENSOR_04->Value) / 4
     
  3. Assign the script execution to the OnValueChange event of all temperature sensors used for the average calculation:









  4.  Upload the configuration to the CLU. 


    Note: The user feature avg_value can be used as a Source in a virtual Thermostat object. To access it, enable the “Show all objects” option.