-- name and index of virtual temperature + humidity sensor DName = 'Temp' DIDX = 35 commandArray = {} if (devicechanged[DName]) then -- read the values of the temperature + humidity sensor -- tonumber(string.format("%.1f", exact)) is used to avoid displaying nearest -- floating point such as 21.200000877596 for 21.2 tp = tonumber(otherdevices_temperature[DName].format("%.1f", exact)) hd = otherdevices_humidity[DName] -- Domoticz truncates value to floor integer dp = otherdevices_dewpoint[DName] -- not used to display --hum_stat can be one of 0=Normal (not used), 1=Comfortable, 2=Dry, 3=Wet if dp > 20 then hum_stat = 3 -- wet elseif dp > 10 then hum_stat = 1 -- confortable else hum_stat = 2 -- dry end commandArray[DIDX] = { ['UpdateDevice'] = DIDX..'|0|'.. tp ..';'.. hd ..';'.. hum_stat } end return commandArray