16.04.2018, 15:11
Hi
You can do it as fallow.
Create 4 bit dim object 3.007 and let all parameters as default.
Create event based script on this object and use this script.
Modify parameters
Add this object on to visu and test.
Should work :
Dalli arc is logarithmic curve so you will have slower dim on low values and fast on bigger.
BR
You can do it as fallow.
Create 4 bit dim object 3.007 and let all parameters as default.
Create event based script on this object and use this script.
Code:
step = 10 --dimming step
stepTime = 0.5 --- dimming interval
ballastAddress = 1
gatewayID='internal'
-----------------------------------------------------------------------------------------------------
valuein = event.getvalue()
require('user.dali')
res, err = dalicmd(gatewayID, 'queryactual', { addrtype = 'short', address = ballastAddress })
-- read ok
if res then
status = res:byte()
end
while( valuein==11 ) do
status = status + step
if (status >254) then
dalicmd(gatewayID, 'arc', { addrtype = 'short', address = ballastAddress, value = 254})
else
dalicmd(gatewayID, 'arc', { addrtype = 'short', address = ballastAddress, value = status})
end
valuein = grp.getvalue(event.dst)
os.sleep(stepTime)
end
while( valuein==3 ) do
status = status - step
if (status <0) then
dalicmd(gatewayID, 'arc', { addrtype = 'short', address = ballastAddress, value = 0})
else
dalicmd(gatewayID, 'arc', { addrtype = 'short', address = ballastAddress, value = status})
end
valuein = grp.getvalue(event.dst)
os.sleep(stepTime)
end
Modify parameters
Add this object on to visu and test.
Should work :
Dalli arc is logarithmic curve so you will have slower dim on low values and fast on bigger.
BR
------------------------------
Ctrl+F5
Ctrl+F5