NewIRKey

Purpose

This function adds a new infrared key to the ItemStatus collection of a device.  Each device has a property called CustomStatus.  This property is a CustomStatus class with two properties:

    1. Status: This is the last status the device was set to.  This is normally set to the value of the last infrared key that was pressed.  Each key is assigned a unique value.  If a user presses the Power key, and this key is assigned a value of 1, then this status will be set to 1.  HomeSeer will then use this status to display the current status for the device.  In this case, the device status will be set to "Power".

    2. ItemStatus: This is a collection of ItemStatus classes (objects). The ItemStatus object has the following properties:

Parameters

Parameter: dv
Type: deviceclass
Description: This is the DeviceClass object that the new key will be added to.  Use hs.GetDeviceEX to get a reference to a device object.

Parameter: label
Type: string
Description: This is the label that should appear on the key.

Parameter: ircommand
Type: string
Description: This is the actual infrared command to send to the device, such as tv,on.

Parameter: image
Type: string
Description: This is a path to an image file that will displayed instead of a standard button.

Parameter: row
Type: long
Description: This is the row where the key should appear when displaying the key on the control web page (1= the first row).

Parameter: column
Type: long
Description: This is the column where the key should appear when displaying the key on the control web page (1 = the first column).

Returns

None.

Example

To add a new key to the device "Den stereo":

 

 NewIRKey Script Example 1

 

 To get all the IR keys associated with a device:

 

 NewIRKey Script Example 2