24.01.2017, 13:00
missed the post. It does work fine.
i used for loop as i have 36 devices
i used for loop as i have 36 devices
Code:
offline_time = 600 --offline detection time in seconds
-- for i = START, STOP, STEP
for i = 1, 36, 1 do
address = ('13/1/'..i)
obj = grp.find(address)
delta = os.time() - obj.updatetime
address = ('13/0/'..i)
if (delta > offline_time) then
grp.update(address, false)
else
grp.update(address, true)
end
end