« Back to Product

Documentation

IPS_SetEventScheduleGroup

Require: IP-Symcon >= 3.2

 boolean IPS_SetEventScheduleGroup (int $EventID, int $GroupID, int $Days) 

Parameters

EventID

ID of the event to be changed

GroupID

Unique ID for this group. The ID is used for sorting. IDs only need to be unique for this event.

Days

Sum of the day values that belong to the group. The day values are found in the table in IPS_SetEventCyclic.

Returns

If the command succeeds, it returns TRUE, otherwise FALSE.

Description

The command sets the bit mask Days for the GroupID of a schedule event with the ID EventID. Any week days can be combined in a group. However, a specific day can only be contained in one group. It is possible to put all days (Days = 127) or only a single day into one group, e.g., 1 for monday. If not all days are separated into groups, it is not possible to create switch points for the missing days. In this case, the last executed switch point remains in place.

If the value of Days is 0, the group with the given GroupID is deleted. This also removes all switch points of that group.

Example

//Create schedule event
$EventID = IPS_CreateEvent(2);

//Create groups
IPS_SetEventScheduleGroup($EventID, 0, 31); //Mo - Fr (1 + 2 + 4 + 8 + 16)
IPS_SetEventScheduleGroup($EventID, 1, 96); //Sa + Su (32 + 64)

//Delete group with ID 1
IPS_SetEventScheduleGroup($EventID, 1, 0);
Any questions?