Home AMXForums Archive Threads Residential Forum

Old Lutron before Intercative Module

RicardoSiqueiraRicardoSiqueira Junior MemberPosts: 373
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

Comments

  • DHawthorneDHawthorne Junior Member Posts: 4,584
    I haven't controlled an original Homeworks with anything more recent than an Axcent, and then I just sent the strings hard-coded to the processor. My usual method was to make a few virtual keypads in the Lutron for the Axcent to emulate. I didn't do feedback since I rarely used two-way panels in those days, but if you limit your functions, it shouldn't be too hard to open up a terminal to the Lutron and see exactly what comes back, then base your feedback on that. If they aren't willing to pay for a full-blown module, that may be the best way in any case.
  • truetrue Junior Member Posts: 307
    I just wrote one for an ancient system I worked on 3 weeks ago that does loads with feedback and normal button pushes I can send to you, if that's all you need.
  • RicardoSiqueiraRicardoSiqueira Junior Member Posts: 373
    true,

    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
  • RicardoSiqueiraRicardoSiqueira Junior Member Posts: 373
    How to convert HEX to bite

    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
  • RicardoSiqueiraRicardoSiqueira Junior Member Posts: 373
    For what it is worth, I spent last night playing with the protocol and I was able to design a structure and response parsing to handle the LED feedback. It is not very pretty, and I am sure there is better ways to handle this. But it is working with the testing strings so far. I haven't tried it in the field yet. The old Lutron LED feedback comes in in an ASCII HEX values in a reverted format, so to make it easier to reference in code and assign to a TP channel for feedback, I changed the orientation on the structure. Instead of storing LEDS 16-13, 12-9, 8-5, 4-1 as Lutron sends them. I am storing them in the 1-4, 5-8, 9-12, 13-16 order. I am also using true's module to process the sending strings. In the structure I am also holding the original ASCII HEX values so it is easier to see them converting to 0101 format. See attached the complete include file.
    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] 
    	    }
    	}
        }
    }
    
Sign In or Register to comment.