Home NetLinx Modules & Duet Modules

LUTRON RadioRa2 Keypad event

Hi,

I'm working on a new project with a RadioRa2 and a Keypad.
But I can't find how to receive the event from the Keypad.

I can set the light level, so the com between the master and RadioRa2 is working.
DEFINE_DEVICE
vdvLutronRadioRA2 		= 	41001:1:0  	
dvLutronRadioRA2 		= 	0:3:0  	

DEFINE_CONSTANT
VOLATILE CHAR sKeypadAddress[20][20] = 
{
    '6:B1', 	//Keypad1 Button 1
    '6:B2',	//Keypad1 Button 2
    '6:B3',	//Keypad1 Button 3
    '6:B4',	//Keypad1 Button 4
    '6:B5',	//Keypad1 Button 5
    '6:B6'	//Keypad1 Button 6
} 
VOLATILE CHAR sLightAddress[20][20] = 
{
    '7:D1',    	// Dimmer 1
    '8:D1',   	// Dimmer 2
    '9:D1'   	// Light Test
}

DEFINE_VARIABLE
DEV vdvDev[] = {vdvLutronRadioRA2}
INTEGER nLutronRadioRA2 = 1
INTEGER nLutronRadioRA2Pages[] = { 1 }
INTEGER nKeypadSystemPages[] = { 2 }
INTEGER nModulePages[] = { 3 }

DEFINE_START
DEFINE_MODULE 'Lutron_RadioRA2_Comm_dr1_0_0' comm(vdvLutronRadioRA2, dvLutronRadioRA2)

DEFINE_EVENT

DATA_EVENT[vdvLutronRadioRA2]
{
    ONLINE:
    {
	WAIT 50
	{
	SEND_COMMAND vdvLutronRadioRA2,"'PROPERTY-IP_Address,192.168.33.101'"	
	SEND_COMMAND vdvLutronRadioRA2,"'PROPERTY-Login,lutron'"				// lutron
	SEND_COMMAND vdvLutronRadioRA2,"'PROPERTY-Password,integration'"			//integration
	SEND_COMMAND vdvLutronRadioRA2,"'REINIT'"
        }
    }
}

CHANNEL_EVENT[vdvLutronRadioRA2,0]
{
   ON:
	{
	 send_command vdvLutronRadioRA2, "'LIGHTSYSTEMLEVEL-9:D1,100,2'"
	}
}


So the Chanel_event is not working, can anyone help me with this part?

Thanks for your help.

Comments

  • if you read at the word document LurtonRadioRA2 interface you can see that the only channel used on the virtual device are for the setting of a third part HVAC.
    You have to use the event string in your data_event of your virtual device to have the feedback of your keypad.
    You can use the command ?KEYPADSYSTEMBUTTONSTATUS-<address> to get the status of the specified button.
    example:
    send_command vdvLutronRadioRA2,"'?KEYPADSYSTEMBUTTONSTATUS-7:B1''"
  • CedricCedric Junior Member Posts: 32
    Thanks for your reply

    So I have to add:
    String :
    {
        FIND_STRING(DATA.TEXT,'KEYPADSYSTEMBUTTONSTATE-7:B1,CLICK',1)
            {
                //execute the action
            }
    }
    

    But where should I put the send_command vdvLutronRadioRA2,"'?KEYPADSYSTEMBUTTONSTATUS-7:B1''" ?
  • You can use a timeline to request the status of each button but maybe the module will send you the feedback without the need to trigger the status of each button.
  • CedricCedric Junior Member Posts: 32
    It's not working and I had try also directly

    String :
    {
    send_command vdvLutronRadioRA2, "'LIGHTSYSTEMLEVEL-9:D1,100,2'"
    }

    And nothing is happening
  • Notifications ?

    Do you have message in your notification bar regarding the lutron virtual device ?
    You should see someting when you click on your lutron keypad
  • CedricCedric Junior Member Posts: 32
    have try the first and second button and receive this message :
    Line 1 (17:53:36):: Command From [41001:1:1]-[KEYPADSYSTEMBUTTONSTATE-6:B1,PUSH]
    Line 2 (17:53:36):: Command From [41001:1:1]-[KEYPADSYSTEMBUTTONSTATE-6:B1,RELEASE]
    Line 3 (17:53:43):: Command From [41001:1:1]-[KEYPADSYSTEMBUTTONSTATE-6:B2,PUSH]
    Line 4 (17:53:43):: Command From [41001:1:1]-[KEYPADSYSTEMBUTTONSTATE-6:B2,RELEASE]


    So I might use the ''COMMAND :''
    Withe FIND_STRING(DATA.TEXT,
  • ericmedleyericmedley Senior Member - 4000+ posts Posts: 4,177
    Yes, Duet modules return a Commands unless otherwise instructed to do so.
  • CedricCedric Junior Member Posts: 32
    Yes Had learn this today first time using feedback part of a module.

    If someone had the same problem
    here is the code :
      command:
       {
        if(FIND_STRING(DATA.TEXT,"'KEYPADSYSTEMBUTTONSTATE-6:B1,PUSH'",1))
          {
    	 REMOVE_STRING(DATA.TEXT,"'KEYPADSYSTEMBUTTONSTATE-6:B1,PUSH'",1)
    	send_command vdvLutronRadioRA2, "'LIGHTSYSTEMLEVEL-9:D1,100,2'"
    	}
       }   
    


    Thanks for your help
  • ericmedleyericmedley Senior Member - 4000+ posts Posts: 4,177
    Cedric wrote: »
    Yes Had learn this today first time using feedback part of a module.

    If someone had the same problem
    here is the code :
      command:
       {
        if(FIND_STRING(DATA.TEXT,"'KEYPADSYSTEMBUTTONSTATE-6:B1,PUSH'",1))
          {
    	[b][I] REMOVE_STRING(DATA.TEXT,"'KEYPADSYSTEMBUTTONSTATE-6:B1,PUSH'",1)[/b][/I]
    	send_command vdvLutronRadioRA2, "'LIGHTSYSTEMLEVEL-9:D1,100,2'"
    	}
       }   
    


    Thanks for your help

    Why are you doing the remove string? string manipulation is a pretty spendy process. why bother if you're not doing anything with it?
  • CedricCedric Junior Member Posts: 32
    you are right it's useless
    I was thincking of remooving and just keeping the id for switch/case but not sur if I really need it also.
  • a_riot42a_riot42 AMX Wizard Posts: 1,619
    Cedric wrote: »
    Yes Had learn this today first time using feedback part of a module.

    If someone had the same problem
    here is the code :
      command:
       {
        if(FIND_STRING(DATA.TEXT,"'KEYPADSYSTEMBUTTONSTATE-6:B1,PUSH'",1))
          {
    	 REMOVE_STRING(DATA.TEXT,"'KEYPADSYSTEMBUTTONSTATE-6:B1,PUSH'",1)
    	send_command vdvLutronRadioRA2, "'LIGHTSYSTEMLEVEL-9:D1,100,2'"
    	}
       }   
    


    Thanks for your help

    You might want to make your code more generic. I split the feedback into multiple parts so I have a variable for the command (KEYPADSYSTEMBUTTONSTATE), for the ID (6), for the type(B) and the button number (1), and the event (PUSH). I don't always need this level of granularity, but when you have a large house with a mixture of keypads, dimmers, shades, sensors, etc, you can more easily identify what's going on.
    Paul
Sign In or Register to comment.