24.06.2017, 16:20
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