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.

VAV logic
#4
Add a common tag to all cooling cmd input group addresses and summer/winter group address. Attach an event script to this tag. Modify group addresses, value presets and setpoints as needed.
Code:
value = grp.getvalue('0/0/1')
mode = value and 'summer' or 'winter'

items = {
  {
    input = '0/0/21', -- command value
    output = '0/0/22', -- damper control
    summer = {
      on_value = 100,
      off_value = 35,
      on_setpoint = 650,
      off_setpoint = 390,
    },
    winter = {
      on_value = 70,
      off_value = 0,
      on_setpoint = 450,
      off_setpoint = 250,
    },
  },
  {
    input = '0/0/23', -- command value
    output = '0/0/24', -- damper control
    summer = {
      on_value = 100,
      off_value = 35,
      on_setpoint = 650,
      off_setpoint = 390,
    },
    winter = {
      on_value = 70,
      off_value = 0,
      on_setpoint = 450,
      off_setpoint = 250,
    },
  },
  {
    input = '0/0/25', -- command value
    output = '0/0/26', -- damper control
    summer = {
      on_value = 100,
      off_value = 35,
      on_setpoint = 650,
      off_setpoint = 390,
    },
    winter = {
      on_value = 70,
      off_value = 0,
      on_setpoint = 450,
      off_setpoint = 250,
    },
  },
  {
    input = '0/0/27', -- command value
    output = '0/0/28', -- damper control
    summer = {
      on_value = 100,
      off_value = 35,
      on_setpoint = 650,
      off_setpoint = 390,
    },
    winter = {
      on_value = 70,
      off_value = 0,
      on_setpoint = 450,
      off_setpoint = 250,
    },
  },
}

setpoint = 0

for _, item in ipairs(items) do
  conf = item[ mode ]
  value = grp.getvalue(item.input)
  key = toboolean(value) and 'on' or 'off'

  grp.checkwrite(item.output, conf[key .. '_value'])
  setpoint = setpoint + conf[key .. '_setpoint']
end

grp.checkupdate('0/0/3', setpoint)
Reply


Messages In This Thread
VAV logic - by Haug1 - 20.06.2025, 13:50
RE: VAV logic - by admin - 20.06.2025, 14:03
RE: VAV logic - by Haug1 - 21.06.2025, 06:28
RE: VAV logic - by admin - 7 hours ago

Forum Jump: