05.01.2023, 08:05
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)