This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Humidity hysteresis
#1
Hi all,
what is wrong with this script below? It is a hysteresis for umidity value. Hence hysteresis value is 3 %.

Code:
value1 = grp.getvalue('2/4/4')
value2 = grp.getvalue('2/4/55')
isteresi = 3
    if value1 >= value2 then
     grp.write('0/0/6', true)
    else if value2 >= value1 - isteresi
   then
     grp.write('0/0/6', false)
 end
    end


Claudio
Reply
#2
It should be value1 + isteresi
If value1 is smaller than value2 (first if does not pass) then value1 - 3 will allways be smaller than value2 (second if).
Reply


Forum Jump: