Hi
what am i doing wrong in this scene i am trying to:
if the outside temp is below 3 then set danfoss to 28 for one hour and then danfoss to 4 in one hour
i did make to scene for this:
--[[
%% properties
164 targetLevel
3 Temperature
%% globals
--]]
setTimeout(function()
local delayedCheck0 = false;
local tempDeviceState0, deviceLastModification0 = fibaro:get(164, "value");
if (( tonumber(fibaro:getValue(164, "targetLevel")) == 4 ) and (os.time() - deviceLastModification0) >= 3600) then
delayedCheck0 = true;
end
local startSource = fibaro:getSourceTrigger();
if (
( tonumber(fibaro:getValue(3, "Temperature")) < tonumber(3) )
and
( delayedCheck0 == true )
or
startSource["type"] == "other"
)
then
fibaro:call(164, "setTargetLevel", "28");
end
end, 3600000)
and
--[[
%% properties
164 targetLevel
%% globals
--]]
setTimeout(function()
local delayedCheck0 = false;
local tempDeviceState0, deviceLastModification0 = fibaro:get(164, "value");
if (( tonumber(fibaro:getValue(164, "targetLevel")) == 28 ) and (os.time() - deviceLastModification0) >= 3600) then
delayedCheck0 = true;
end
local startSource = fibaro:getSourceTrigger();
if (
( delayedCheck0 == true )
or
startSource["type"] == "other"
)
then
fibaro:call(164, "setTargetLevel", "4");
end
end, 3600000)
regards
Elvar Páll
www.webcam-iceland.com