Table of Contents

Set Value Of

Set the value of a unit as a counter.

Usage:

set value of (name of pseudo unit)

Optional Parameters:

Examples:

--increment a counter
set value of "Inside Motion Count" by 1
 
set value of “overhead light” to 50 in 10 * minutes for 30 * minutes
 
-- and an example preserving the timestamp 
 
set value of “yesterdays low temp” to (value of “todays low temp”) timestamp (timestamp of “todays low temp”)

Some units do not have values that are easily converted to numbers, the Mode setting of a Thermostat for example. If it would make more sense to use a string to describe the value you can do that using an enumerated string. The enumerations come from the “comma separated list for popup” field on the Display tab of the Edit Unit Dialog The control type does not need to be set to popup but the values must be in that field. For this example the field would contain the string “Off,Heat,Cool,EM Heat” Previous to the ability to pass strings to the set value verb you would have had to remember that to set the mode to cool you would set the value of the unit to 2. You can now pass the string “cool” to the set value verb like this:

--examples using enumerated strings
 
set value of “Thermostat Mode” to “cool”
 
-- or
 
set value of “Thermostate Mode” to “off”

The comparisons are not case sensitive. If the string is not found in the list then the value of the unit will not be set and an error will be returned.

Notes:

Setting the value to 0 will execute the OFF script, if any. Setting the value to a non-zero value will run the ON script if any.

You can use this verb instead of the dim/bright commands. This verb does not limit the value to a maximum of 100% as the dim/bright commands do.

History: