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.

Best way to handle lutron switch dimming command
#1
Hi!
I have phase dimming actuator in KNX panel and I need to control them with Lutron switch.
The Lutron switch has 4 buttons; on/off and dim up/down.
I have handled the on/off part but I want to seek the best way in LM to imprement the dimming part.

From the TCP message coming from Lutron, I know when the button is pressed and released.
What I want to do is to dim up/down for 1 step(6%) with short press, and keep dimming up/down with long press until the release, like KNX wall switches.
As LM needs to be the one to distinguish between long press and short press, this is what I have done.

I created two types of resident script. 
・Script to check the Lutron message...when I get the button press message I set storage ('Button1', 'up'), ('Button1', 'down'), and when I get the button release message I set storage ('Button1', 'stop'). Script interval = 0
・Script to check the Button1 storage variable....if the value is 'up' or 'down', do the relative dimming for 1 step and if the value is 'stop', do nothing. Script interval = 1 sec
Code:
local array = {'2/4/3', '2/4/2'}
-- Loop through the array
for i = 1, #array do
   if storage.get(array[i]) == 'up' then
     grp.write(array[i], 14) --dim 1 step up 6 %
   elseif storage.get(array[i]) == 'down' then
     grp.write(array[i], 6)  --dim 1 step down 6 %
   end
end

Is there any better, effifient way to handle this ? I don't want to pressure LM to get high load.
Reply


Messages In This Thread
Best way to handle lutron switch dimming command - by Hadeel - 18.09.2024, 09:26

Forum Jump: