03.01.2023, 13:04
In 2022 RC1 firmware and later you can use an event script with execution mode set to "Last instance only". Change parameters on first three lines as needed.
Code:
out = '1/1/2' -- output group address (1 byte scale)
stepsize = 5 -- step size in %
sleeptime = 0.5 -- delay in seconds between each step
dimmer = event.getvalue()
step = bit.band(dimmer, 0x07)
if step == 0 then
return
end
if bit.band(dimmer, 0x08) == 0 then
stepsize = -stepsize
end
value = grp.getvalue(out)
while true do
newvalue = math.min(value + stepsize, 100)
newvalue = math.max(newvalue, 0)
if newvalue == value then
break
end
value = newvalue
grp.write(out, value)
os.sleep(sleeptime)
end