DeviceValuesAdd

 

Parameter

Type

Description

device

string

The X10 housecode unitcode of the device like "A1"

values

string

The string of device and value pairs to be associated with the device.

show

boolean

This determines whether the device control drop-down list appears on the device status page showing these values.

 

Return value

Type

Description

(none)

 

 

 

This will associate a list of status/value pairs with a device.  Normally, device status follows the X-10 status nomenclature of On, Off, Dim, etc.  When you have a device that is not an X-10 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.

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: There are a total of 13 status/value pairs assigned.  There is no chr(1) after the last status/value pair.  The "False" at the end indicates that on the device status page, the status corresponding to the device's current value will display on the far left status column, but there will NOT be a drop down control list where you can choose the new value you would like the device set to.  Setting the device to a new value does not guarantee that it will cause a change in the device or for something to happen - a plug-in, event trigger, or script needs to be configured to run to handle changes in the device.  

A special reserved value of "999" and associated status of "Any Value" was specified.  If you wish to have the "Any Value" option be displayed in the device value trigger screen for this device, this special status/value pair must be present.

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.

Here are examples of the Windows and HTML interfaces for devices when the show parameter is set to FALSE:

 

Notice that in the Windows UI, the control options are grayed out, and in the HTML UI there are no options on the far right under the "Control" column.

Now let's look at the same interfaces with the show option set to TRUE:

 

 

Note: To clear the status/value pairs for a device, set the value string to a null ("") value.

 

See Also

DeviceValuesGraphicsAdd