ph_setanalogout PowerHome formula function
Description
Sets the value of an analog output defined in the Analog I/O screen.
Syntax
ph_setanalogout ( id, value )
Argument Description
id String. The ID of the analog output as defined within the Analog I/O screen.
value String. The value to set the analog output to. This value MUST be a string and in the format of a CALCULATED value as defined within the Analog I/O screen. This value will be converted to the appropriate RAW value using the formula defined in the Analog I/O screen. This RAW value will then be sent to the controller. See usage below for valid values for special Analog I/O devices such as Insteon devices that have functionality extended as an analog device.
Return value
Integer. Returns a 0 if successful. Returns - 100 if the ID cannot be found. When this function is executed, the controller, unit, and point is looked up within the Analog I/O table and these values are then passed to the controller. If these values are entered improperly in the Analog I/O screen, then the following errors may be returned: - 1 is returned if the controller is not available, - 2 is returned if the controller does not support analog outputs, - 3 is returned if the unit is out of range, - 4 is returned if the point is out of range. - 5 is returned if the value is out of range.
Usage
This function is similar to the ph_setotheranalogout function except that the output MUST be defined within the Analog I/O screen. Also, this function requires the CALCULATED value while the ph_setotheranalogout function only works with RAW values.

This function also allows you to set special Analog devices. For these parameters, you can either use the Calculated to Raw formula to convert to a raw value or the built in commands that are listed below:
For GarageHawk devices you can specify a value of "close" to trigger the garage door close command.
For EZRain/EZFlora devices you can specify values of "off","v1" ,"v2" ,"v3" ,"v4" ,"v5", "v6", "v7", "v8", "pgm1", "pgm2", "pgm3", "pgm4", "next", and "prev" to control the valves.
For IOLinc devices you can specify a value of either "open" or "closed" to control the relay output.
For Insteon Thermostat Mode valid values are: "off", "heat", "cool", "auto", "fanon", "fanoff", "pgm", "pgm ht", and "pgm cl".
For Elk M1 Thermostat Mode valid values are: "off", "heat", "cool", "auto", "emgheat".
For Elk M1 Thermostat Fan you can specify "auto" or "on".
Examples
The following examples demonstrate typical syntax/usage for this function.
• ph_setanalogout("HOME MOTION","{HOME-MOTION}")