16.10.2021, 14:02
(This post was last modified: 16.10.2021, 14:20 by victor.back.)
Hi.
I want to make a set of group adresses to turn On and Off in a sequence loop as long as a switch is turned On, When this switch is turend Off I want this loop to stop.
I made this event script, but it only runs once and I cant stop it.
I tried a resident script as well but havent got it right yet, because that just runs all the time even if my switch is On or Off.
Someone who can help me out here?
I want to make a set of group adresses to turn On and Off in a sequence loop as long as a switch is turned On, When this switch is turend Off I want this loop to stop.
I made this event script, but it only runs once and I cant stop it.
I tried a resident script as well but havent got it right yet, because that just runs all the time even if my switch is On or Off.
Someone who can help me out here?
Code:
-- loop until condition is met
if event.getvalue(true)
then
repeat
grp.write('32/1/127', true)
os.sleep(1.0)
grp.write('32/1/128', true)
grp.write('32/1/127', false)
os.sleep(1.0)
grp.write('32/1/129', true)
grp.write('32/1/128', false)
os.sleep(1.0)
grp.write('32/1/130', true)
grp.write('32/1/129', false)
sleep(1.0)
grp.write('32/1/131', true)
grp.write('32/1/130', false)
sleep(1.0)
grp.write('32/1/131', false)
until grp.read('32/1/126', false)
end