The incoming value from AC outdoor sensor in offline state is 102 degC - hence I want to remove it from sending in to domoticz database.
So far i have the script, which checks the incoming value, and make adjustments accordingly - change the value to fixed. Script Attached.
Instead i would like to remove, delete the incoming wrong value complately, so have a gap not a fixed value. Any hints here?
Thanks.
Code: Select all
debug = false
temp_sensor='qlimaAC - Temp Outside'
temp_limit=100
temp_default=0.0
commandArray = {}
-- Update virtual sensor ---------------------------------------------------
local function updateNum(dev, value1)
local cmd = string.format("%d|0|%d", otherdevices_idx[dev], value1)
table.insert (commandArray, { ['UpdateDevice'] = cmd } )
end
-- MAIN ---------------------------------------------------------------------
if (devicechanged[temp_sensor]) then
current_temp = tonumber(devicechanged[temp_sensor])
if (debug) then print(' #current_temp: '..current_temp) end
if (current_temp > temp_limit) then
if (debug) then print('ERROR: Sensor ( '..temp_sensor..') = '..current_temp..' !!!') end
updateNum(temp_sensor, temp_default)
return commandArray
end
end
return commandArray