ph_modifytimedevent PowerHome formula function
Description
Modifies an existing Timed Event.
Syntax
ph_modifytimedevent ( ai_active, adt_reftime, ai_flags )
ph_modifytimedevent ( as_id, ai_active, adt_reftime, ai_flags )
Argument |
Description |
as_id
|
String (Optional). The ID of the Timed Event
you wish to modify. If this parameter is omitted, then the system variable TIMEDEVENT will be used for ID
|
ai_active
|
Integer. Use 0 to set the Timed Event inactive. Use 1 to set the Timed Event active. Controlled by the flags parameter.
|
adt_reftime
|
DateTime. The new reference time for
the specified Timed Event. Using the reference time, a new start time will be calculated. Controlled by the flags parameter.
|
ai_flags
|
Integer. Determines which parameters are used to update the Timed Event. Add values together. 1 - Recalculate a new StartTime, 2 - Update the Active parameter, 4 - Set a new RefTime and recalculate StartTime, 8 - Delete the Timed event (other flag options will be ignored).
|
Return value
Integer. Returns 0 if successful. 1 if the Timed Event specified does not exist.
Usage
Use this function to update an existing
timed event to set a new start/reference time, set a timed event inactive,
or delete the specified timedevent.
Examples
The following examples demonstrate typical syntax/usage for this function.
• ph_modifytimedevent("SPRINKLERMON",0,datetime(date("2020-05-25","yyyy-mm-dd"),time("04:00:00","hh:mm:ss")),4)
- Updates the SPRINKLERMON timed event and sets the reference time to 05/25/2020
04:00:00