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.

DALI DT-6
#1
Hello, 
I currently have a DALI DT-6 lighting with warm white LED and cold white (2700 to 6500 K) do not have a DT-8 so I have two different ballasts I could create a script that achieves the following command:
- ON / OFF GENERAL
- GENERAL ON / OFF STATUS
- WHITE VARIATION
- STATE VARIATION WHITE

I currently have the following group addresses:
On / off cold dali (0/0/1)
state on / off cold dali (0/1/1)
cold dali value (0/4/1)
state dali value cold (0/3/1)
On / off hot dali (0/0/2)
state on / off hot dali (0/1/2)
hot dali value (0/3/2)
state dali value hot (0/4/2)

I create a script that takes all the following states but I think it can be optimized and I do not recover the white dimming state when I change only cold dali value (0/3/1) ...

Script:

value = grp.getvalue ('32/1/1 ') --white color


if value == 6500 then
  grp.write ('0/3/1', 100)
  grp.write ('0/3/2', 0)
elseif value == 6481 then
  grp.write ('0/3/1', 100)
  grp.write ('0/3/2', 1) 

etc .... Sad  up to 2700 K ... Sad

I put my table excel with the set of values ...
Reply
#2
Why not use a formula to calculate warm/cold white values based on color temp instead of copy-pasting hundreds lines of code? Smile

For control you probably need just two objects: dimming and color temperature. If binary control is also needed you just create a script that sets dimming and color temperature to preset values.
Reply
#3
(20.02.2019, 07:39)admin Wrote: Why not use a formula to calculate warm/cold white values based on color temp instead of copy-pasting hundreds lines of code? Smile

For control you probably need just two objects: dimming and color temperature. If binary control is also needed you just create a script that sets dimming and color temperature to preset values.

Yes,
The script with formula : 

valtemp = grp.getvalue('34/1/7')

val1= (valtemp - 2700)/19
val2= (6500 - valtemp)/19

if valtemp <=4600 then
  grp.write('34/1/3', 100)
  grp.write('34/1/4', val1)
elseif valtemp >4600 then
  grp.write('34/1/3', val2)
  grp.write('34/1/4', 100)
end

Just for my table excel if you put values such as 10% cold and 10% hot there will be no match.

B.R.
Reply


Forum Jump: