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.
So the Chanel_event is not working, can anyone help me with this part?
Thanks for your help.
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.
0
Comments
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''"
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''" ?
String :
{
send_command vdvLutronRadioRA2, "'LIGHTSYSTEMLEVEL-9:D1,100,2'"
}
And nothing is happening
Do you have message in your notification bar regarding the lutron virtual device ?
You should see someting when you click on your lutron keypad
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,
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
Why are you doing the remove string? string manipulation is a pretty spendy process. why bother if you're not doing anything with it?
I was thincking of remooving and just keeping the id for switch/case but not sur if I really need it also.
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