In the Grenton system, in addition to the sensors in our modules (Smart Panel, Touch Panel, Multisensor) and 1-Wire sensors (DS18B20), 0-10V sensors (e.g. RHT-2) can be used to measure temperature. The mentioned sensors should be connected to the appropriate inputs (IN1-4) in the Analog In/Out DIN module.
To convert the voltage returned by the 0-10V sensor into temperature, proceed as follows:
- create a user feature of type number to which the temperature value will be saved:
- create a script that will calculate the temperature value based on the range of measured values and voltage:
temp_min = -20
temp_max = 80
vol_min = 0
vol_max = 10
CLU->temp_val = temp_min + ((temp_max - temp_min) / (vol_max - vol_min)) * CLU->temp_sens_0_10V->Value - assign the previously created script to the OnValueChange event of the AnalogIN object to which the 0-10V sensor is connected:
After sending the configuration to the CLU module, changing the value returned by the sensor will cause the value of the user feature to be updated: