Table of Contents
This feature is implemented only for X10 controllers.
The 'Extended Code' commands have long been in the X-10 suite, however they have not been implemented by manufacturers until recently.
The X-10 dimmers (LM14a and LM15a) as well as the new AM14a appliance modules are capable of transmitting as well as receiving commands.
The extended code commands are used for setting certain 'modes' within the modules as well as for reporting their current 'status'.
The XPRESS command is used in order to set the internal 'preset' level of these new 'smart' dimmers.
For example: If you set the internal preset of a LM14 to 50%, from them on it will respond to a normal ON command by brightening gently to that level. And it will respond to a normal OFF command by dimming to zero.
The greatest advantage of this is that we avoid the necessity of sending multiple DIM/BRI commands. This reduces the number of commands on the powerlines and the response of the module is somewhat faster.
The 'xpress' command can be used with the Leviton wall-mount dimmer switch (6381) to set it's internal preset level. However it cannot transmit X-10 signals. Therefore it cannot send it's current status. This means that it will not react to the ENABLE EXTENDED ACK commands.
Verbs for working with Xtended Codes
Uses for the Extended Data
It is a very interesting feature of the X-10 LM14 and AM14 that they will return some special status bits in the upper two bits of the extended data.
The Upper but (7=128), is set to a ONE if the load is connected, ie: if the light bulb is OK, or if there is some real resistive load. If the light bulb is burned out or there is no resistive load the bit will be zero.
So if you wish to know whether there is a load connected, (or if the light bulb is burned out) just use the exdata command:
if exdata of "LM14" > 127 then write log "The light bulb is OK" else write log "The light bulb is burned out!" end if
Bit 6 of the exdata is always Zero if the module is a LM14 and always a One if the module is an AM14.
ONLY the lower 6 bits of the exdata represent the dimmer value.
What Units Support Extended Data?
There is a great deal of confusion about just which module or manufacturer uses the 'extended codes' or the 'preset dim' commands.
Some manufacturers employ the 'Preset Dim' commands to set the internal preset dim of their dimmers. Others use this command to handle such things as thermostat setpoints.
X-10 corp chooses to employ the 'Extended Code' commands to set the internal preset level of the new dimmers (LM14/LM15), and to report their status.
What does XTension do when it receives an X-10 Extended Message?
The 'Extended message format' includes in it's 'payload'
|House Code||4 bits|
|Unit Code||4 bits|
|Extended command||8 bits|
|Extended data||8 bits|
Whenever XTension receives an extended message from a unit address that is in your database:
- The unit record fields “ExCommand” and ExData“ are conditioned with the raw “command” and “data” bytes from the message.
- The variable 'future value' is set equal to the 'raw' 8 bits of the 'extended data' byte (same as above).
- If the lower 6 bits of the 'extended data' are non-zero, then the Unit ON script is called if it exists. If the low 6 bits are all zero then the Unit OFF script is called if it exists.
- At entry to your Unit Script you have the following variables:
- thisUnit name of this database unit (hall light)
- command an integer, the X-10 command tht caused this trigger.
- wireless T/F flag whether this command came in via a wireless interface or not.
- future value the 'raw' extended message 'data'
- ExCommand of “Hall Light” 8 bit extended message 'command' byte.
- ExData of “Hall Light” 8 bit extended message 'data' byte.
- last timestamp of “Hall Light” the last time this unit changed.
- value of “Hall Light” the “current value” of the unit, BEFORE this message occurred.
- The user may change future value before exiting the script.
- On return from the Unit script, XTension tests future value. If future value was not changed and the 'extended command' was either a 49 or 56 then the message is assumed to be one of the known dimmer products that announce their current level via the extended code. In this case, the lower 6 bits of the extended data are 'scaled' from the 0-63 value to 0-100, representing the current brightness percentage. The unit record int he database is updated to this new 'current value':
percent = integer value of ((raw * 1.5873) + 0.5)
If the user script changed 'future value', then that value is stored in the unit record as 'current value'.