Logic Machine Forum
Thermostat - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: Thermostat (/showthread.php?tid=4004)



Thermostat - benanderson_475 - 19.04.2022

Hi, 

I have several zones of heating/cooling/ducted ac

Obj per zone are 

Room on/off (binary obj)
Room temp 
Room setpoint 
Room output (binary obj)

Global obj,
System mode, heat|cooling (binary obj)

I’m not sure what the best way to do, event script, resident script 
I need to achieve 

If room is off output is off 
If room is on, 

if global mode is heating and temp > setpoint output is on 
else if not then output is off

if global mode is cooling and temp < setpoint then output is on 
else if not then output is off

If temp changes while room is on re eval setpoint and adjust output if required 

Should I do an event script, triggered by tag? 
I looked into the pid script, but that achieves proportional control of the output?


RE: Thermostat - admin - 19.04.2022

You can use a resident script for this because you don't need instant reaction to the temperature/mode changes. 2-point thermostat is ok for this task but you should add hysteresis so the output does not bounce between on/off when room temp is near the setpoint. For example, in heating mode the output turns on when room temp < setpoint but turns off when room temp > (setpoint + 1).