Turn all DMX LED lights on/off using the Logic Machine reactor

We have quite a few DMX based LED lighting sources. I use the eldoled lineardrive 720D to do the controling part. The following script enables me to turn the LEDs on/off, all at once.



-- This software may be used and distributed according to the terms of the
-- GNU General Public License version 3, incorporated herein by reference.

-- define group address
dmxchan = 12
dmxon = 255
dmxoff = 0
-- address of all on/off group
groupvalue = '1/2/0'

-- addresses of groups that should be switched including the all on/off group
lights = {'1/2/0', '1/1/0', '1/1/2', '1/1/3', '1/1/4', '1/1/5', '1/1/6', '1/1/7', '1/1/8'}

-- get value of object with group address
value = grp.getvalue(groupvalue)

if (value == false) then
  -- channel value set to 255
  for i = 1, dmxchan, 1 do
    DMX.set(i, dmxon)
  end
  -- change groups to true
  for index, value in ipairs(lights) do
    grp.write(value, true)
  end

  log('Light on')
else
  -- channel 1 value set to 0
  for i = 1, dmxchan, 1 do
    DMX.set(i, dmxoff)
  end
  
  -- change groups to false
  for index, value in ipairs(lights) do
    grp.write(value, false)
  end
     
  log('Light off')
end

I created an “event based script” in the Logic Machine to add this code. The address I monitor is 1/1/1 which is the group that turns all lights on/off in the KNX push buttons.

Logic Machine - group address for DMX

Leave a Reply

Your email address will not be published.

Time limit is exhausted. Please reload CAPTCHA.