Old Lutron before Intercative Module
I am looking for any help with a possible module for the old Lutron Homeworks System, before interactive or Illumination. I got a protocol from Lutron, but I am wondering if anyone have a module for it. I have the task to integrate this old Lutron System with Netlinx, but of course our sales team didn't sell enough hours for me to try to create a module for it. Lutron provided the attached protocol. I am just wondering if anybody out there has a module for it or sample code. The button emulation is very straight forward, but the LED feedback is very tricky.
Thanks,
Ricardo
Thanks,
Ricardo
0
Comments
Yes please send it to me. It will save me a lot of time trying to come up with something for a job undersold. I appreciate your help very much.
Ricardo
Thanks true for sending me your module. Now, I am trying to see if I can do the LED Feedback. Do you guys know how to covert a HEX number to bits and store it on an array? Here is a sample of a probable LED feedback string:
'L101A2BD',$0D,$0A
L1 = LED feedback for panel 1
01 = Keypad 1
A = HEX value for LED 13 to 16 - 1010 (LED 13 is On, 14 Off, 15 On and 16 Off)
2 = HEX value for LED 9 to 12 - 0010 (LED 9 is Off, 10 Off, 11 On, 12 Off)
B = HEX value for LED 5 to 8 - 1011 (LED 5 is On, 6 Off, 7 On, 8 On)
D = HEX value for LED 1 to 4 - 1101 (LED 1 is On, 2 On, 3 Off, 4 On)
The ideal would be to be able to store this on a structure or array that we could hold the PANEL, KEYPAD and all LEDS, so we could assign a TP channel # to the LED current status of 1 or 0.
Something like: [Panel][Keypad][0000000000000000]
Any ideas?
Thanks
DEFINE_DEVICE //PORT 3 used for Lutron///////////////////////////////////////////////// dvTP_Lutron1 = 10001:3:0 // Real Panel (dviPad_GreatRoom) dvTP_Lutron2 = 10002:3:0 // Real Panel (dviPad_Master) dvTP_Lutron3 = 10003:3:0 // Real Panel (dviPad_Playroom) dvLutron = 5001:4:0 // Lutron Homeworks - *See Main vdvLutron = 33021:1:0 // Virtual dev DEFINE_CONSTANT INTEGER KP_COUNT = 10 ; //Number of Phantom Keypads to track DEFINE_TYPE //Structure to Hold LEd Fedback STRUCTURE _sLighstLED { CHAR sLED_4_1[1] CHAR sLED_8_5[1] CHAR sLED_12_9[1] CHAR sLED_16_13[1] INTEGER nLED_1_4[4] INTEGER nLED_5_8[4] INTEGER nLED_9_12[4] INTEGER nLED_13_16[4] } DEFINE_VARIABLE //Current room the touch panel has selected volatile integer lightsCurRoom[TP_COUNT] DEV vTP_Lutron[] = {dvTP_Lutron1,dvTP_Lutron2,dvTP_Lutron3} _sLighstLED uLightsKpLED[KP_COUNT] VOLATILE INTEGER nLEDs_G1[4] VOLATILE INTEGER nLEDs_G2[4] VOLATILE INTEGER nLEDs_G3[4] VOLATILE INTEGER nLEDs_G4[4] //This function coverts the HEX values reported from the Lights LED to bit symbols // and then to manageable values. DEFINE_FUNCTION Process_LED_HEX(CHAR sHEX[1], INTEGER nLEDS[4]) { SWITCH(sHEX) { CASE '0': //0000 { nLEDS[4] = 0 nLEDS[3] = 0 nLEDS[2] = 0 nLEDS[1] = 0 } CASE '1': //0001 { nLEDS[4] = 0 nLEDS[3] = 0 nLEDS[2] = 0 nLEDS[1] = 1 } CASE '2': //0010 { nLEDS[4] = 0 nLEDS[3] = 0 nLEDS[2] = 1 nLEDS[1] = 0 } CASE '3': //0011 { nLEDS[4] = 0 nLEDS[3] = 0 nLEDS[2] = 1 nLEDS[1] = 1 } CASE '4': //0100 { nLEDS[4] = 0 nLEDS[3] = 1 nLEDS[2] = 0 nLEDS[1] = 0 } CASE '5': //0101 { nLEDS[4] = 0 nLEDS[3] = 1 nLEDS[2] = 0 nLEDS[1] = 1 } CASE '6': //0110 { nLEDS[4] = 0 nLEDS[3] = 1 nLEDS[2] = 1 nLEDS[1] = 0 } CASE '7': //0111 { nLEDS[4] = 0 nLEDS[3] = 1 nLEDS[2] = 1 nLEDS[1] = 1 } CASE '8': //1000 { nLEDS[4] = 1 nLEDS[3] = 0 nLEDS[2] = 0 nLEDS[1] = 0 } CASE '9': //1001 { nLEDS[4] = 1 nLEDS[3] = 0 nLEDS[2] = 0 nLEDS[1] = 1 } CASE 'A': //1010 { nLEDS[4] = 1 nLEDS[3] = 0 nLEDS[2] = 1 nLEDS[1] = 0 } CASE 'B': //1011 { nLEDS[4] = 1 nLEDS[3] = 0 nLEDS[2] = 1 nLEDS[1] = 1 } CASE 'C': //1100 { nLEDS[4] = 1 nLEDS[3] = 1 nLEDS[2] = 0 nLEDS[1] = 0 } CASE 'D': //1101 { nLEDS[4] = 1 nLEDS[3] = 1 nLEDS[2] = 0 nLEDS[1] = 1 } CASE 'E': //1110 { nLEDS[4] = 1 nLEDS[3] = 1 nLEDS[2] = 1 nLEDS[1] = 0 } CASE 'F': //1111 { nLEDS[4] = 1 nLEDS[3] = 1 nLEDS[2] = 1 nLEDS[1] = 1 } } } DEFINE_EVENT DATA_EVENT[vdvLutron] { STRING: { IF (FIND_STRING(DATA.TEXT, "'L1'",1)) IF(FIND_STRING(DATA.TEXT, "$0D,$0A",1)) { stack_var Integer nKeypad stack_var i // LED feedback //'L1010200',$0D,$0A //Capture Strings and Hex Values for LED positions REMOVE_STRING(DATA.TEXT, 'L1', 1) nKeypad = (ATOI(LEFT_STRING(DATA.TEXT,2))) uLightsKpLED[nKeypad].sLED_16_13 = (MID_STRING(DATA.TEXT,3,1)) uLightsKpLED[nKeypad].sLED_12_9 = (MID_STRING(DATA.TEXT,4,1)) uLightsKpLED[nKeypad].sLED_8_5 = (MID_STRING(DATA.TEXT,5,1)) uLightsKpLED[nKeypad].sLED_4_1 = (MID_STRING(DATA.TEXT,6,1)) Process_LED_HEX((uLightsKpLED[nKeypad].sLED_4_1),nLEDs_G1) Process_LED_HEX((uLightsKpLED[nKeypad].sLED_8_5),nLEDs_G2) Process_LED_HEX((uLightsKpLED[nKeypad].sLED_12_9), nLEDs_G3) Process_LED_HEX((uLightsKpLED[nKeypad].sLED_16_13), nLEDs_G4) //Update Structure with feedback values FOR (i = 1; i <= 4; i++) { uLightsKpLED[nKeypad].nLED_1_4[i] = nLEDs_G1[i] uLightsKpLED[nKeypad].nLED_5_8[i] = nLEDs_G2[i] uLightsKpLED[nKeypad].nLED_9_12[i] = nLEDs_G3[i] uLightsKpLED[nKeypad].nLED_13_16[i] = nLEDs_G4[i] } } } }