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.

Thermostat Script
#1
Hi folks, can anyone suggest (or kindly give a snippet) how to create a simple thermostat script?

The idea is to have 3 GA - current temperature, setpoint temperature and control valve (1 bit output).

And turn on/off the output control valve depending on the current temperature and setpoint values with a given hysteresis (e.g. 1 degree).
Reply
#2
(28.12.2022, 22:52)mishoboss Wrote: Hi folks, can anyone suggest (or kindly give a snippet) how to create a simple thermostat script?

The idea is to have 3 GA - current temperature, setpoint temperature and control valve (1 bit output).

And turn on/off the output control valve depending on the current temperature and setpoint values with a given hysteresis (e.g. 1 degree).

create event based script, map it on tag "thermostat1", map the same tag to current and setpoint objects. paste code to script (change GA addresses to what you need)

cur = grp.getvalue('current temp address or name')
set= grp.getvalue('setpoint temp address or name')

if set > cur then
  grp.write('valve  address or name', true)
else
  grp.write( 'valve  address or name', false)
end
Reply


Forum Jump: