20.01.2018, 12:47
(This post was last modified: 20.01.2018, 12:48 by Erwin van der Zwart.)
Hi,
Try this as event based on your light switching object:
BR,
Erwin
Try this as event based on your light switching object:
Code:
value = event.getvalue()
if value == false then
storagename = 'toilet_pid'
oldpid = storage.get(storagename)
pid = os.getpid()
storage.set(storagename, pid)
if oldpid ~= nil then
os.kill(oldpid, signal.SIGKILL)
end
grp.write('1/1/2', true) -- Ventilator object
os.sleep(120)
grp.write('1/1/2', false) -- Ventilator object
storage.remove(storagename)
end
Erwin