16.11.2022, 07:54
Event script:
Resident script with sleep time set to 1 second:
Code:
if event.getvalue() then
storage.set('presence_time', os.time())
end
Resident script with sleep time set to 1 second:
Code:
curr_trig_time = storage.get('presence_time', 0)
if not prev_trig_time then
prev_trig_time = curr_trig_time
end
if curr_trig_time > prev_trig_time then
prev_trig_time = curr_trig_time
grp.write('0/0/2', true)
os.sleep(5 * 60)
grp.write('0/0/2', false)
os.sleep(15 * 60)
end