LogicMachine Forum
fade time function - Printable Version

+- LogicMachine 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: fade time function (/showthread.php?tid=6300)



fade time function - Danny - 12.02.2026

Dear reader,

Is there a fade time function?

I want to use a timer to start the fade time (adjustable from 30 to 60 minutes using a KNX group address). The lights then take the set time to dim from 100% to 0%.
and vice versa from 0 to 100% with a different time clock
 

Thank you in advance.


RE: fade time function - Daniel - 12.02.2026

This should be defined in your dimmer.


RE: fade time function - Danny - 12.02.2026

(12.02.2026, 11:07)Daniel Wrote: This should be defined in your dimmer.

That's not possible because the switch needs to switch on and off directly. And because of the script, I need a fade time, and I can only set one function on the dimmer


RE: fade time function - Daniel - 12.02.2026

You can make a script which will do it but you will simply have to send several commands over time. It can also be done via scene with delay option in.


RE: fade time function - admin - 13.02.2026

Here's a basic solution - map event script to a binary object, set execution mode to "Last instance only". Sending TRUE will dim from 0% to 100%, sending FALSE will dim from 100% to 0%. Change group addresses as needed. 0/0/21 is the light output group address, 0/0/24 is the fade time in minutes.

Code:
value = event.getvalue()

out = '0/0/21'
time = grp.getvalue('0/0/24')
sleeptime = time * 60 / 100

for i = 0, 100 do
  grp.write(out, value and i or (100 - i))
  os.sleep(sleeptime)
end