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 whether you accept or reject these cookies being set.

Scene trigger diffrent values
#1
Hello I am new to scripting.
Knx
I need a script to send a couple of different 1byte values when a scene is trigged.

Need another script to do the same when a bit is trigged
Reply
#2
Hi,

You don't need a script to do that, just use the scene module that is default in the controller.

With script you can use this: (add as event based script to the scene object)
Code:
scenevalue = event.getvalue()
if scenevalue == 1 then
  grp.write('1/1/1', 10)
  grp.write('1/1/2', true) -- binary
  grp.write('1/1/3', 30)
  os.sleep(2) -- delay if needed
  grp.write('1/1/3', 40)
elseif scenevalue == 2 then
  grp.write('1/1/1', 50)
  grp.write('1/1/2', false) -- binary
  grp.write('1/1/3', 70)
  os.sleep(1) -- delay if needed
  grp.write('1/1/3', 80)
end
For binary object:  (add as event based script to the binary object)
Code:
bitvalue = event.getvalue()
if bitvalue == true then
  grp.write('1/1/1', 10)
  grp.write('1/1/2', true) -- binary
  grp.write('1/1/3', 30)
  os.sleep(2) -- delay if needed
  grp.write('1/1/3', 40)
else
  grp.write('1/1/1', 50)
  grp.write('1/1/2', false) -- binary
  grp.write('1/1/3', 70)
  os.sleep(1) -- delay if needed
  grp.write('1/1/3', 80)
end
BR,

Erwin
Reply
#3
Thank you.
Reply
#4
Hi
You can do the same with scene tab. No scripting needed.
BR
Reply
#5
Hi Daniel,

That's what i wrote already, but i added the scripting for the option to add a delay, that's not possible (yet) with the scene tab (:

BR,

Erwin
Reply


Forum Jump: