« Back to Product

Documentation

IPS_SetEventCyclic

 boolean IPS_SetEventCyclic (int $EventID, int $DateType, int $DateInterval, int $DateDay, int $DateDayInterval, int $TimeType, int $TimeInterval) 

Parameters

EventID

ID of the event to be changed

DateType
Value Description
0 No date type. Daily execution.
1 Once. IPS_SetEventCyclicDateBounds for target date
2 Daily
3 Weekly
4 Monthly
5 Annually
DateInterval
Value Description
0 0 (No Evaluation)
1 0 (No Evaluation)
2 Every X days
3 Every X weeks
4 Every X months
5 1 = January ... 12 = December
DateDay
Value Description
0 0 (No Evaluation)
1 0 (No Evaluation)
2 0 (No Evaluation)
3 see table: Daily values ​​(desired daily values ​​must be added)
4 see table: Daily values, 0 for every Xth day of the month
5 0 (No Evaluation)

Table: Daily values

Day Value
Monday 1
Tuesday 2
Wednesday 4
Thursday 8
Friday 16
Saturday 32
Sunday 64
DateDayInterval
Value Description
0 0 (No Evaluation)
1 0 (No Evaluation)
2 0 (No Evaluation)
3 0 (No Evaluation)
4 Every Xth DateDay of the month or every Xth day of the month if DateDay = 0
5 Every Xth day of the specified month
TimeType
Value Description
0 Once. IPS_SetEventCyclicTimeBounds for target time
1 every second
2 every minute
3 hourly
TimeInterval
Value Description
0 0 (No Evaluation)
1 Every X seconds
2 Every X minutes
3 Every X hours

Returns

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

Description

The configuration of a cyclic event determines in which intervals the event should run. This includes a DateInterval that specifies the interval in a day, week, month, or year rhythm and a time interval that defines second, minute, or hour-based intervals for each day.

If the DateInterval "week" is selected, it is possible to determine the days of the week on which the event should be started. For an annual or monthly DateInterval, the day of the month / year can be specified with the parameter DateValue. For all other types the parameter is not used and can simply be set to the placeholder 0.

Warning

Remarks:

  • (Monthly) In the variant "On the Xth day every Y months", choosing X > 31 signals that the event is run on the last day of every month. When choosing X = 31, the event only triggers in months with 31 days.
  • (Monthly) In the variant "On the Xth weekday every Y months", choosing X > 5 signals that the event is run on the last defined weekday of every month. Choosing X = 5 can lead to an event not being run, as, e.g., not every month includes a 5th Friday.
  • (Annually) In the variant "The Xth day of a specific month", a timer is executed only if X is a valid day in the month, otherwise the timer is not running. The special case of the 29th February is not supported.

Example

IPS_SetEventCyclic($eid, 2, 1, 0, 0, 3, 6);   //Every day all 6 hours

IPS_SetEventCyclic($eid, 0, 0, 0, 2, 2 ,2);   //Every 2 minutes

IPS_SetEventCyclic($eid, 3, 2, 1+4, 0, 0, 0); //Every 2 weeks at Monday+Wednesday

IPS_SetEventCyclicTimeBounds($eid, mktime(15, 0, 0), 0); //always at 3 pm
Any questions?