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.

Button dimming (8-bit value)
#14
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.

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 :Smile
Dalli arc is logarithmic curve so you will have slower dim on low values and fast on bigger.

BR
------------------------------
Ctrl+F5
Reply


Messages In This Thread
Button dimming (8-bit value) - by Jayce - 09.04.2018, 12:24
RE: Button dimming (8-bit value) - by Jayce - 10.04.2018, 07:16
RE: Button dimming (8-bit value) - by alexll - 09.11.2021, 09:05
RE: Button dimming (8-bit value) - by Jayce - 10.04.2018, 11:05
RE: Button dimming (8-bit value) - by Jayce - 11.04.2018, 07:22
RE: Button dimming (8-bit value) - by Jayce - 13.04.2018, 09:40
RE: Button dimming (8-bit value) - by Jayce - 16.04.2018, 06:43
RE: Button dimming (8-bit value) - by admin - 16.04.2018, 11:32
RE: Button dimming (8-bit value) - by Bobby - 16.04.2018, 11:47
RE: Button dimming (8-bit value) - by Jayce - 16.04.2018, 11:55
RE: Button dimming (8-bit value) - by Daniel - 16.04.2018, 15:11
RE: Button dimming (8-bit value) - by Jayce - 17.04.2018, 09:06
RE: Button dimming (8-bit value) - by admin - 09.11.2021, 09:09
RE: Button dimming (8-bit value) - by alexll - 09.11.2021, 09:36

Forum Jump: