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 with LogicMachine
#11
Use this script (resident, sleep time = 5 seconds) to convert 0..100% value to slow PWM (proportional on/off). Change input/output objects and period time as needed.

Code:
input = '1/1/1' -- proportional value input (0..100%) object
output = '1/1/2' -- on/off output object
period = 10 * 60 -- 10 minutes in seconds

date = os.date('*t')
seconds = date.hour * 3600 + date.min * 60 + date.sec

curr = seconds % period
perc = math.floor(curr / period * 100)

state = grp.getvalue(input) > perc
grp.checkwrite(output, state)
Reply


Messages In This Thread
RE: PID thermostat with LogicMachine - by admin - 08.10.2018, 07:01

Forum Jump: