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.

scripitng
#1
Hello guys need your help with a event based script 
I have made a event based on group address of the movement of a motion sensor 
My client want to when  movement is trigger to turn on the lights of the corridor 1 by 1 with 1 sec delay deference 
here is the script that i made but doesnt work and i dont get  any error logs 

--event base  off the movement the motion detecor
if event.getvalue(1)
  then
--light 1 without time delay when its on
value = 1
grp.write(0/3/6, value)

  --light 2 with time delay 1 sec when its on
value = 1
os.sleep(1)
grp.write(0/3/7, value)
    --light 3 with time delay 2 sec when its on
value = 1
os.sleep(2)
grp.write(0/3/8, value)
  --light 4 with time delay 3 sec when its on
value = 1
os.sleep(3)
grp.write(0/3/9, value)
 
  --light 5 with time delay 4 sec when its on
value = 1
os.sleep(4)
grp.write(0/3/6, value)
 
 
  else

  --light 1 with time delay 4 when its off
value = 0
os.sleep(4)
grp.write(0/3/6, value)
 
    --light 2 with time delay 3 sec when its off
value = 0
os.sleep(3)
grp.write(0/3/7, value)
 
    --light 3 with time delay 2 sec when its on
value = 0
os.sleep(2)
grp.write(0/3/8, value)
 
    --light 4 with time delay 1 sec when its off
value = 0
os.sleep(1)
grp.write(0/3/9, value)
 
  --light 2 without time delay  when its off
value = 0
grp.write(0/3/10, value)

end
Reply


Messages In This Thread
scripitng - by VoltTech - 11 hours ago
RE: scripitng - by admin - 11 hours ago
RE: scripitng - by VoltTech - 9 hours ago
RE: scripitng - by Danny - 8 hours ago
RE: scripitng - by admin - 8 hours ago

Forum Jump: