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.

PID-thermostat: help
#4
You need to restart the script when heating/cooling mode changes because PID instance (p variable) is only created once the script starts.

Attach an event script to 1/6/4:
Code:
name = 'pid' -- resident script name
script.disable(name)
script.enable(name)

Resident script can be simplified:
Code:
-- init pid algorithm
if not p then
  inverted = not grp.getvalue('1/6/4')
  p = PID:init({
    current = '5/2/8', -- actual temperature
    setpoint = '1/4/11', -- desired temperature
    output = '1/4/4',  -- valve
    inverted = inverted,
  })
end

-- run algorithm
p:run()
Reply


Messages In This Thread
PID-thermostat: help - by Amelie - 18.05.2024, 16:07
RE: PID-thermostat: help - by CristianAgata - 18.05.2024, 18:21
RE: PID-thermostat: help - by Amelie - 19.05.2024, 12:32
RE: PID-thermostat: help - by admin - 20.05.2024, 07:20
RE: PID-thermostat: help - by Amelie - 20.05.2024, 17:48

Forum Jump: