ph_setdeviceval PowerHome formula function
Description
Allows
the user to set certain device value
parameters within the PowerHome database without having to resort to using
SQL
Syntax
ph_setdeviceval ( type, id, parm, value
)
Argument |
Description |
type |
Integer. The type of data you'd like to update. Current
valid values are 5 for Insteon devices and 20 for UPB devices. Any other
type will cause the function to return either a 1 or 4. |
id |
String. The ID of the device whose value you'd like to
update. |
parm |
String. The specific value for the device that you'd like to
update. See usage below. |
value
|
Double. The actual value to be written
into the column identified by the
parm parameter.
|
Return value
Integer. Returns the result of the
operation. Success will return a 0. An invalid type will be either 1 or 4. If an
error occurs in SQL during the update, 2 will be returned. If an invalid parm is
specified, 3 will
be returned.
Usage
Use this function to update specific device
parameter values within the PowerHome database without having to know or write
SQL.
For type = 5 (Insteon),
the following values are valid for the parm parameter. Each value will match an
appropriate column in the Insteon device table.
commcnt
ackcnt
nakcnt
timeoutcnt
ttacnt
xcommcnt
xackcnt
xnakcnt
xtimeoutcnt
xttacnt
failedmatch
iengine
firmware
activeflag
For
type = 20 (UPB), the following values are valid for the parm parameter. Each
value will match an appropriate column in the UPB device
table.
commcnt
ackcnt
nakcnt
avgss
firmware
Examples
The following examples demonstrate typical syntax/usage for this function.
ph_setdeviceval(5,"KITCHEN","commcnt",0)
The above
example will set the commcnt for the Insteon KITCHEN device to
0.