« Back to Product

Documentation

IPS_SetEventScheduleGroup

Require: Symcon >= 3.2

 bool 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 function succeeds, it returns TRUE, otherwise FALSE.

Description

The function 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, EVENT_DAY_ALL) or only a single day into one group, e.g., 1 (EVENT_DAY_MONDAY) 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.

Day Value Constant
Monday 1 EVENT_DAY_MONDAY
Tuesday 2 EVENT_DAY_TUESDAY
Wednesday 4 EVENT_DAY_WEDNESDAY
Thursday 8 EVENT_DAY_THURSDAY
Friday 16 EVENT_DAY_FRIDAY
Saturday 32 EVENT_DAY_SATURDAY
Sunday 64 EVENT_DAY_SUNDAY
All days 127 EVENT_DAY_ALL

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(EVENTTYPE_SCHEDULE);

//Create groups
IPS_SetEventScheduleGroup($EventID, 0, EVENT_DAY_MONDAY + EVENT_DAY_TUESDAY + EVENT_DAY_WEDNESDAY + EVENT_DAY_THURSDAY + EVENT_DAY_FRIDAY); //Mo - Fr (31)
IPS_SetEventScheduleGroup($EventID, 1, EVENT_DAY_SATURDAY + EVENT_DAY_SUNDAY); //Sa + Su (96)

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