DeviceValuesAdd

Purpose

This function will associate a list of status/value pairs with a device.  Normally, device status follows the X10 status nomenclature of On, Off, Dim, etc.  When you have a device that is not an X10 device or you wish to have a different set of status strings displayed, you can control that with this command.

The status value string is constructed of status strings and values separated by the unprintable ASCII character codes 1 and 2.  Here is a short example:

"My Status" & chr(2) & "29" & chr(1) & "My other status" & chr(2) & "55"

Chr(1) separates each pair, and chr(2) separates the status string from the value.

Parameters

Parameters: device
Type: string
Description: This is the house code and unit code or device code of the device, such as "A1" or "q17".

Parameters: values
Type: string
Description: This is the string of device and value pairs to be associated with the device.

Parameters: show
Type: boolean
Description: This determines whether the device control drop-down list appears on the Status page showing these values.

Returns

None.

Example

Here is a longer example:

hs.DeviceValuesAdd "A1","Disarmed" & chr(2) & "0" & chr(1) & _
                            
"Armed Day" & chr(2) & "1" & chr(1) & _
                            
"Armed Night" & chr(2) & "2" & chr(1) & _
                            
"Armed Away" & chr(2) & "3" & chr(1) & _
                            
"Armed Vacation" & chr(2) & "4" & chr(1) & _
                            
"Armed Day Instant" & chr(2) & "5" & chr(1) & _
                            
"Armed Night Delayed" & chr(2) & "6" & chr(1) & _
                            
"Armed Day (Delay)" & chr(2) & "101" & chr(1) & _
                            
"Armed Night (Delay)" & chr(2) & "102" & chr(1) & _
                            
"Armed Away (Delay)" & chr(2) & "103" & chr(1) & _
                            
"Armed Vacation (Delay)" & chr(2) & "104" & chr(1) & _
                            
"Armed Day Instant (Delay)" & chr(2) & "105" & chr(1) & _
                            
"Armed Night Delayed (Delay)" & chr(2) & "106" & chr(1) & _
                            
"Any Value" & chr(2) & "999", False

The above example has these characteristics:  

Another special character is the tilde (~) character.  When it precedes the text string, that text string will NOT appear in the drop-down list of control values, but it can still be displayed as a device status.  For example, "~Playing" can be used to denote the status of a music device, but it is not a control option so the tilde prevents it from appearing in the drop-down or control menu choices in HomeSeer.