Welcome to Smart Home Forum by FIBARO
Dear Guest,
as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.
As a member you can:
- Start new topics and reply to others
- Follow topics and users to get email updates
- Get your own profile page and make new friends
- Send personal messages
- ... and learn a lot about our system!
Regards,
Smart Home Forum by FIBARO Team
Question
Lauri 6
Hello, can you help me to find a problem here.
What is should do: It shold calculate
target2 - outTemp > hysteresis and then decide wether it needs to rise temperature or lower it. If rise, then it has to add to valve (roller shutter module) position 1% and wait for 10sec, if needed then open more 1% and so on.
What it actually does:
Everything is OK, but opening and closing the valve is not 1% and 10sec interval instead it opens valve 10-20% in one sec and this is not good.
What is wrong with LUA here?
--[[
%% autostart
%% properties
163 value
203 value
23 value
%% globals
targetTemp1
--]]
local extTemp=tonumber(fibaro:getValue(23, "value"))
local outTemp=tonumber(fibaro:getValue(163, "value"))
local ventiil=tonumber(fibaro:getValue(203, "value"))
local target2=tonumber(fibaro:getGlobalValue("targetTemp2"))
local hysteresis=tonumber(fibaro:getGlobalValue("hysterees"))
--local outtemp=tonumber(fibaro:getValue(36, "value"))
fibaro:debug(tonumber(target2))
fibaro:debug(tonumber(outTemp))
fibaro:call(202, "setProperty", "ui.lblTempout.value", outTemp)
fibaro:call(202, "setProperty", "ui.lblTarget.value", target2)
fibaro:call(202, "setProperty", "ui.lblTempExt.value", extTemp)
fibaro:call(202, "setProperty", "ui.lblVentiil.value", ventiil)
fibaro:call(202, "setProperty", "ui.lblHyst.value", hysteresis)
if target2 - outTemp > hysteresis then
--peab kütma
if ventiil<=99 then
fibaro:debug("kütame,erinevus: "..target2 - outTemp)
fibaro:debug("must HEAT")
fibaro:call(203, "setValue", ventiil+1)
fibaro:sleep(1000*10)
else
--fibaro:call(203, "open")
fibaro:debug("ventiil avatud :"..ventiil)
end
else
if ventiil>=1 then
fibaro:debug("jahutame,erinevus: "..target2 - outTemp)
fibaro:debug("must COOL")
fibaro:call(203, "setValue", ventiil-1)
fibaro:sleep(1000*10)
else
--fibaro:call(203, "close")
fibaro:debug("ventiil suletud: "..ventiil)
end
--fibaro:sleep(1000)
end
Lauri
Link to comment
Share on other sites
3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.