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.

RGB relative dimming from KNX
#3
(02.11.2020, 14:57)Daniel. Wrote: Pure conversion of this script in to dimming of 3 objects is this but I'm not sure if this is what you need. Most likely you would have to calculate saturation.
Code:
addressbyteoutput1 = '32/1/1'
addressbyteoutput2 = '32/1/2'
addressbyteoutput3 = '32/1/3'

stepsize = 10

value = event.getvalue()

current1 = grp.getvalue(addressbyteoutput1)
current2 = grp.getvalue(addressbyteoutput2)
current3 = grp.getvalue(addressbyteoutput3)
if value < 8 and value ~= 0 then
  log('down',value)
  if current1 <= stepsize then
    output = 0
    if current1 ~= output then
      grp.write(addressbyteoutput1, output)
       end
  else
    output = current1 - stepsize
    if current1 ~= output then
      grp.write(addressbyteoutput1, output)
    end
  end
if current2 <= stepsize then
    output = 0
    if current2 ~= output then
      grp.write(addressbyteoutput2, output)
       end
  else
    output = current2 - stepsize
    if current2 ~= output then
      grp.write(addressbyteoutput2, output)
    end
  end 

if current3 <= stepsize then
    output = 0
    if current3 ~= output then
      grp.write(addressbyteoutput3, output)
       end
  else
    output = current3 - stepsize
    if current3 ~= output then
      grp.write(addressbyteoutput3, output)
    end
  end 
 
 
elseif value > 8 then
  log('up',value)
  if current1 >= (100 - stepsize) then
    output = 100
    if current1 ~= output then
      grp.write(addressbyteoutput1, output)
    end
  else
    output = current1 + stepsize
    if current1 ~= output then
      grp.write(addressbyteoutput1, output)
    end
  end
 


  if current2 >= (100 - stepsize) then
    output = 100
    if current2 ~= output then
      grp.write(addressbyteoutput2, output)
    end
  else
    output = current2 + stepsize
    if current2 ~= output then
      grp.write(addressbyteoutput2, output)
    end
  end
 

  if current3 >= (100 - stepsize) then
    output = 100
    if current3 ~= output then
      grp.write(addressbyteoutput3, output)
    end
  else
    output = current3 + stepsize
    if current3 ~= output then
      grp.write(addressbyteoutput3, output)
    end
  end
end
Thanks for the quick answer. That would work, but like dimming 3 independent lights.

I think the theorical way should be, first, to convert those 3 1byte objects in a 3byte RGB value (232.600). After that, to "dim" that value and, finally, go the other way round.
The problem is I can't achieve that  Undecided .
Reply


Messages In This Thread
RGB relative dimming from KNX - by alexll - 01.11.2020, 23:52
RE: RGB relative dimming from KNX - by Daniel - 02.11.2020, 14:57
RE: RGB relative dimming from KNX - by alexll - 02.11.2020, 15:30
RE: RGB relative dimming from KNX - by alexll - 03.11.2020, 19:20
RE: RGB relative dimming from KNX - by admin - 04.11.2020, 07:48
RE: RGB relative dimming from KNX - by alexll - 04.11.2020, 10:55
RE: RGB relative dimming from KNX - by alexll - 07.11.2020, 19:37
RE: RGB relative dimming from KNX - by admin - 09.11.2020, 08:56
RE: RGB relative dimming from KNX - by alexll - 09.11.2020, 21:31

Forum Jump: