21.09.2021, 11:48
(20.09.2021, 10:52)admin Wrote: Modify as needed, make sure that step value is the same as script sleep time (at least 5 seconds, can be more if the wait time is larger).
Code:temp = grp.getvalue('1/1/1') -- temp limits temp_low = 20 temp_high = 30 -- time in seconds time_low = 20 time_high = 40 step = 5 -- script sleep time in seconds if temp < temp_low then timer_high = nil if timer_low then if timer_low < time_low then timer_low = timer_low + step if timer_low >= time_low then grp.write('1/1/2', true) end end else timer_low = 0 end elseif temp > temp_high then timer_low = nil if timer_high then if timer_high < time_high then timer_high = timer_high + step if timer_high >= time_high then grp.write('1/1/2', false) end end else timer_high = 0 end end
Thank you very much!