x10event - X10 event handler and device description file
~x10/x10event
x10event is a shell script which contains the event handlers for the x10iod(1) X10 I/O daemon. It also describes the devices assigned to various house/unit codes. These descriptions take the form of shell commands, so the entire file can be validated with bash -n or ksh -n. The script uses the function keyword to locate event descriptions, so Bourne Shell (sh(1)) can not be used.
Event
handlers
Event handlers take the form of a shell function. The
function declaration must read function
module_Xnn, where X is the house code and
nn is the unit code. The open-curly brace must be on
the next line.
When properly formatted, during daemon startup x10iod.init will recognize this as an event description and configure the me property for the device, causing the daemon to invoke the x10event shell script, which in turn will invoke the function.
When invoked, an event handler is given 3 parameters: 1, house code; 2, unit code; and 3, event type. The event type will be one of the following: AllOff, LightsOn, On, Off, Dim, Bright, LightsOff, HailRequest, HailAcknowledge, PresetDim0, PresetDim1, StatusOn, StatusOff, or StatusRequest.
Device
descriptions
The format for device descriptions is:
<light|light_group|appliance> Xnn description
The description should be free of any characters that might interfere with shell processing as the file is also an executable shell script. The device code Xnn must be house and unit code, and must not be separated by whitespace.
light |
Indicates that device Xnn is a light, and adds a light group for the house code. When run as a script, x10event collects all light devices into a list in the variable lights. | ||
light_group |
Creates a light group. When run as a script, lightgroups is created with a list of all house codes which possess lights. light_group can be used to force a house code to be added to this list, but is not usually necessary as the list is automatically formed from light entries. | ||
appliance |
Registers a device as an appliance. When run as a list, appliances is constructed with a list of all appliances. |
None.
~x10/x10event
x10cli(1), x10iod(1), printf(3).