06.08.2021, 11:39
Try modifying the event scripts like this:
Code:
stop_1 = event.getvalue()
stop_2 = grp.getvalue('5/0/20')
on_1 = grp.getvalue('5/0/1') and not stop_1
on_2 = grp.getvalue('5/0/2') and not stop_2
-- switch to the second pump
if stop_1 then
if not stop_2 and not on_2 then
grp.write('5/0/1', false)
grp.write('5/0/2', true)
storage.set('pump_time', 0)
end
-- fault is removed and no pump is running
elseif not on_1 and not on_2 then
grp.write('5/0/1', true)
storage.set('pump_time', 0)
end
Code:
stop_1 = grp.getvalue('5/0/10')
stop_2 = event.getvalue()
on_1 = grp.getvalue('5/0/1') and not stop_1
on_2 = grp.getvalue('5/0/2') and not stop_2
-- switch to the first pump if it's not in a fault state
if stop_2 then
if not stop_1 and not on_1 then
grp.write('5/0/2', false)
grp.write('5/0/1', true)
storage.set('pump_time', 0)
end
-- fault is removed and no pump is running
elseif not on_1 and not on_2 then
grp.write('5/0/2', true)
storage.set('pump_time', 0)
end