Announcement

Collapse
No announcement yet.

Leviton Extended Codes

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Leviton Extended Codes

    I'm new to Homeseer (5 days into the 30 day trial), so I'll apologize in advance if this question has been asked and answered (and for the lenght of it, now that I am done) - if it has please point me to the post - but I searched this board, the Worthington boards, the UseNet boards and all to no avail. I'm trying to set up lighting scenes in my kitchen using Leviton DHC switches (HCM06) and PCS SmartTransmitter controllers (SMST6) - I know this would have been easier using receivers and controllers from the same manufacturer, but I was balancing cost and WAF. I'm also going on the assumption that PCS controllers won't communicate scenes for Leviton switches. If this is not correct and someone can tell me how to accomplish this then the rest of my post is moot.

    As a workaround, I used HS scripts to define scenes for the Leviton switches, set the PCS controllers to an unused x10 code, and let HS trigger a script event when the PCS controllers transmits the code.

    For example, I executed the following script manually in HS once to set up the "Cooking" scene:

    sub main()

    ah.execx10 "K1", "extended" , 100 , 49
    ah.execx10 "K2", "extended" , 100 , 49
    ah.execx10 "K3", "extended" , 100 , 49
    ah.execx10 "K4", "extended" , 100 , 49
    ah.execx10 "K5", "on" , 0 , 0
    ah.execx10 "K6", "off"
    ah.execx10 "K7", "0ff"

    ah.execx10 "K1", "extended" , 96, 48
    ah.execx10 "K2", "extended" , 96, 48
    ah.execx10 "K3", "extended" , 96, 48
    ah.execx10 "K4", "extended" , 96, 48
    ah.execx10 "K5", "extended" , 96, 48
    ah.execx10 "K6", "extended" , 96, 48
    ah.execx10 "K7", "extended" , 96, 48

    end sub

    I then assigned the code M1 on to the "A" button of the PCS controller and created a HS event, triggered by the M1 On command that issues the following script: hs.execx10 "K1","extended",96,54

    So the good news is that the scene functionality works - I press the button on the PCS controller, which issues the x10 command, which is seen by HS, which issues the extended x10 command, which sets the scene.

    The bad news is I don't know how or why it works, since I copied the scripts from an old post I found on this board (which I believe had an incorrect or misleading explanation) and tweaked them for my specific light addresses and dim levels.

    I'm guessing that 1.) the 96 in the last seven lines of the first script and the trigger script is the scene number, 2.) the 48 in the last seven lines of the first script is the extended code to add that address to the scene, and 3.) the 54 in trigger script is the extended code to invoke that scene, since I can copy those scripts, change the 96 to 97, change the lighting levels, and get a whole new scene. (I've set up 4 so far.)

    Without having the codes, I'm guessing as to the above and clueless as to 1.) what is the largest scene number I can use, 2.) what does the 49 represent in the first 7 lines of the first script, 3.) is the "extended" command necessary in those lines, etc., etc.

    I called Leviton, but they indicated this was proprietary infomation they could not distribute. I also had the thought of buying the cheapest Leviton scene controller I could find, just to "issue" a lot of extended commands and let HS log them, but figured I'd post here first and ask for some help.

    So - does anyone have a list of the Leviton extended x10 codes?

    TIA for your help

    Joe

  • #2
    Bob, Your assumptions about the 96, 97, 48 and 54 are correct. Here is an attempt at an explanation:

    As you already know, The first seven lines of your run-once subroutine set seven devices to the desired output-setting with the PRESET RECEIVER O/P function, and the second seven lines of your subroutine adds those seven devices to a group (group 1, in this case) at their current output-setting with the INCLUDE IN GROUP, RELATIVE function. So this subroutine programs your scene as group 1.

    When you execute <span class="ev_code_BLUE">hs.execx10 "K1","extended",96,54</span> you invoke the EXECUTE GROUP, RELATIVE function on group 1.

    Those first seven lines do not need to be extended commands, but DO need to set the output to a predefined value before the second seven lines add the house-code/unit-code/brightness combination to the group.

    The documentation is not clear on the number of scenes available, but you should have at least 16.

    I am confused as to the 100 in the first four lines of the subroutine, as dim values are 0 through 63. Maybe the high bit (64) is being ignored, and setting the dim value to 36 (100 minus 64).

    Here is a link to the "Rosetta Stone" of extended codes. I refer to it as such because 1) it is as informative as the Rosetta stone, and 2) it is just as difficult to deciper.

    StandardandExtendedX10Codes.doc

    Comment


    • #3
      The last number in each of the commands represents an 8 bit value. The top four bits refer to the type of extended command ( in this case 0011 - type 3) and the second four bits represent the command (0001 - command 1).


      So write down all 8 bits together 0011 0001 which is
      0x128 0x64 1x32 1x16 0x8 0x4 0x2 1x1
      0 0 1 1 0 0 0 1

      Add 'em up and you get 49.

      Comment

      Working...
      X