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.

3 state heating systems
#1
Hello guys, 
I need some help to prepare the code for the following function.
I have 3 heat pumps and 13 thermostats.
I want the first heat pump to start when 1 to 4 thermostats are requested,
 the second pump to start after 5 to 8 thermostats, 
and then the third pump to start when 9 to 13 thermostats are requested.

Thanks in advance .
Reply
#2
You can use OR gate from this script: https://forum.logicmachine.net/showthrea...7#pid28367
Reply
#3
Thank you for the answer,
but I didn't explain it exactly.
I want to randomly add the commands of the thermostats and depending on the demand to start the pumps in stages.
Reply
#4
Attach a common tag to all thermostat on/off objects then attach an event script to this tag. 1/1/1..3 are your heat pump control objects, modify as needed.
Code:
objs = grp.tag('thermostat')
count = 0

for _, obj in ipairs(objs) do
  if obj.value then
    count = count + 1
  end
end

grp.write('1/1/1', count >= 1)
grp.write('1/1/2', count >= 5)
grp.write('1/1/3', count >= 9)
Reply
#5
Hi admin thank you very match ...
Reply


Forum Jump: