Logic Machine Forum
DALI DT-6 - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: DALI DT-6 (/showthread.php?tid=1924)



DALI DT-6 - Gadjoken - 19.02.2019

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 ...


RE: DALI DT-6 - admin - 20.02.2019

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.


RE: DALI DT-6 - Gadjoken - 20.02.2019

(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.