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 control
#2
Code:
-- setpoint object
obj = '1/1/1'
-- storage key, unique for each object
key = 'lastupdate_' .. obj
-- current timestamp
now = os.time()
-- timestamp of last update
upd = storage.get(key, 0)

-- time is in seconds (30 minutes)
if (now - upd) >= 30 * 60 then
  -- set new last update time
  storage.set(key, now)
  -- increase setpoint by 0.5
  setpoint = grp.getvalue(obj)
  grp.write(obj, setpoint + 0.5)
end
Reply


Messages In This Thread
Thermostat control - by XSPA2474KW - 24.06.2017, 09:51
RE: Thermostat control - by admin - 24.06.2017, 16:20
RE: Thermostat control - by XSPA2474KW - 07.07.2017, 06:06
RE: Thermostat control - by admin - 07.07.2017, 06:11
RE: Thermostat control - by XSPA2474KW - 07.07.2017, 06:19
RE: Thermostat control - by mlaudren - 11.07.2017, 17:24

Forum Jump: