(16.02.2022, 07:12)admin Wrote: Event script that gets the target level and adjusts the output object in small steps. Adjust as needed:
Code:output = '1/1/4'
step = 5
delay = 0.5
target = event.getvalue()
current = grp.getvalue(output)
if target == current then
return
end
while true do
if current < target then
current = math.min(current + step, target)
else
current = math.max(current - step, target)
end
grp.write(output, current)
-- stop when target is reached
if current == target then
return
end
os.sleep(delay)
-- stop when targed changed, another script is running
if grp.getvalue(event.dst) ~= target then
return
end
end
Thanks! Works perfectly! Would recommend to note this somewhere as a standard script for EC fancontrol (0-10V controlled fans)