Documentation
IPS_SetEventScheduleActionEx
Require: Symcon >= 6.0
bool IPS_SetEventScheduleActionEx (int $EventID, int $ScheduleActionID, string $Name, int $Color, string $ActionID, array $ActionParameters)
Parameters
| EventID | ID of the event to be changed |
| ScheduleActionID | Unique ID for this schedule action. The ID is used for sorting. IDs only need to be unique for this event. Must be greater than 0. |
| Name | Name of the given schedule action |
| Color | Color value as HTML color code, e.g., 0x0000FF for blue |
| ActionID | ID of the executed action |
| ActionParameters | List of Parameters for the executed action |
Returns
If the function succeeds, it returns TRUE, otherwise FALSE.
Description
The function sets the Name, the Color, and the executed Action with the ID ActionID with the parameters ActionParameters for the schedule action with the ID ScheduleActionID of a schedule event with the ID EventID. If the action executes a PHP Script, the system variable $_IPS['ACTION'] is defined. System Variables can be used during the execution of the script.
If the argument Name is empty, the schedule action with the given ScheduleActionID is deleted. This is only possible if no switch point references that ScheduleActionID.
The special parameters TARGET, ENVIRONMENT, and PARENT are not required here and are handled by the event
The ScheduleActionID must be greater than 0, otherwise an error is raised. In IPS_GetEvent, the ID 0 in LastActionID/NextActionID means "no action". Existing schedule actions with an ID less than or equal to 0 from older installations can still be deleted in order to recreate them with an ID of 1 or higher.
Example
//Creating schedule actions
IPS_SetEventScheduleActionEx($EventID, 1, "Warm", 0xFF0000, "{3644F802-C152-464A-868A-242C2A3DEC5C}", ["VALUE" => 22.5]);
IPS_SetEventScheduleActionEx($EventID, 2, "Cold", 0x0000FF, "{3644F802-C152-464A-868A-242C2A3DEC5C}", ["VALUE" => 17]);
IPS_SetEventScheduleActionEx($EventID, 3, "Eco", 0x00FF00, "{3644F802-C152-464A-868A-242C2A3DEC5C}", ["VALUE" => 20]);
//Delete schedule action with the ID 3
IPS_SetEventScheduleActionEx($EventID, 3, "", 0, "", []);