« Back to Product

Documentation

IPS_GetEvent

Require: Symcon >= 3.1

 array IPS_GetEvent (int $EventID) 

Parameters

EventID

ID of the event

Returns

The following information is available as key => value pairs:

Index   Type Description
CyclicDateType integer Date type. See IPS_SetEventCyclic
CyclicDateValue integer Date interval. See IPS_SetEventCyclic
CyclicDateDay integer Day of date. See IPS_SetEventCyclic
CyclicDateDayValue integer Day of date, interval. See IPS_SetEventCyclic
CyclicDateFrom array Start date as array of day, month, year; 0/0/0 = Always. See IPS_SetEventCyclicDateFrom
CyclicDateTo array End date as array of day, month, year; 0/0/0 = No end date. See IPS_SetEventCyclicDateTo
CyclicTimeType integer Time type. See IPS_SetEventCyclic
CyclicTimeValue integer Time interval. See IPS_SetEventCyclic
CyclicTimeFrom array Start time as array of hour, minute, second; 0/0/0 = Midnight. See IPS_SetEventCyclicTimeFrom
CyclicTimeTo array End time as array of hour, minute, second; 0/0/0 = No end time (until 23:59:59). See IPS_SetEventCyclicTimeTo
EventActionID string ID of the executed Action
EventActionParameters array Parameters of the executed Action
EventConditions array Array of conditions. See IPS_SetEventCondition, IPS_SetEventConditionDateRule, IPS_SetEventConditionDayOfTheWeekRule, IPS_SetEventConditionTimeRule and IPS_SetEventConditionVariableRule
EventID integer ID of the event
EventLimit integer Remaining number of executions. 0 = No Limit
EventScript string Only present for compatibility reasons. Contains the PHP code if the action was set via IPS_SetEventScript, otherwise an empty string. The execution is always controlled via the action, which is configured via IPS_SetEventAction.
EventActive boolean TRUE if the event is active
EventType integer Event type: (0 (EVENTTYPE_TRIGGER): trigger, 1 (EVENTTYPE_CYCLIC): cyclic, 2 (EVENTTYPE_SCHEDULE): schedule)
LastRun integer Unix timestamp of the last run, 0 = Never
NextRun integer Unix timestamp of the next run, 0 = Never
LastActionID integer ID of the schedule action of the last execution, 0 = No action was executed (also for other event types)
NextActionID integer ID of the schedule action of the next execution, 0 = No action will be executed next time (also for other event types)
ScheduleActions array Array of actions of the schedule. See IPS_SetEventScheduleActionEx
ScheduleGroups array Array of groups with switch points of the schedule. See IPS_SetEventScheduleGroup and IPS_SetEventScheduleGroupPoint
TriggerSubsequentExecution boolean Allow repeated execution when triggered without a value change
TriggerType integer Value for the trigger type: See IPS_SetEventTrigger
TriggerValue variant Value that is used for the trigger check, depending on the used trigger type
TriggerVariableID integer VariableID to be used as a trigger

Description

The function returns an array containing information about the event with the ID EventID.

Warning

Since IP-Symcon 3.1, the fields CyclicDateFrom, CyclicDateTo, CyclicTimeFrom, and CyclicTimeTo are arrays. If you need compatibility with version 3.0 and older, you can use the IPS_GetEventCompatibility function available since IP-Symcon 3.1, which restores the old functionality.

Warning

LastActionID/NextActionID have been available since version 8.1

Example

$EventID = 46413;
$EventInfo = IPS_GetEvent($EventID);
print_r($EventInfo); 

/* returns e.g.:
Array
(
    [EventID] => 41227
    [EventType] => 2
    [EventActive] => 1
    [EventLimit] => 0
    [EventConditions] => Array
        (
            [0] => Array
                (
                    [ID] => 0
                    [ParentID] => 0
                    [VariableRules] => Array
                        (
                            [0] => Array
                                (
                                    [ID] => 1
                                    [VariableID] => 29025
                                    [Comparison] => 4
                                    [Type] => 0
                                    [Value] => 500
                                )
                        
                        )
                    
                    [DateRules] => Array
                        (
                            [0] => Array
                                (
                                    [ID] => 0
                                    [Comparison] => 0
                                    [Value] => Array
                                        (
                                            [Day] => 8
                                            [Month] => 8
                                            [Year] => 2001
                                        )
                                )

                            [1] => Array
                                (
                                    [ID] => 1
                                    [Comparison] => 4
                                    [Value] => Array
                                        (
                                            [Day] => 1
                                            [Month] => 1
                                            [Year] => 2021
                                        )
                                )
                        )
                    
                    [TimeRules] => Array
                        (
                            [0] => Array
                                (
                                    [ID] => 1
                                    [Comparison] => 3
                                    [Value] => Array
                                        (
                                            [Hour] => 9
                                            [Minute] => 0
                                            [Second] => 0
                                        )
                                
                                )
                            
                            [1] => Array
                                (
                                    [ID] => 2
                                    [Comparison] => 5
                                    [Value] => Array
                                        (
                                            [Hour] => 17
                                            [Minute] => 0
                                            [Second] => 0
                                        )
                                
                                )
                        
                        )
                    [DayOfTheWeekRules] => Array
                        (
                            [0] => Array
                                (
                                    [ID] => 0
                                    [Comparison] => 0
                                    [Value] => 3
                                )

                        )

                    [Operation] => 1
                )
        )

    [TriggerType] => 0
    [TriggerVariableID] => 0
    [TriggerValue] => 
    [TriggerSubsequentExecution] => 
    [CyclicDateType] => 0
    [CyclicDateValue] => 0
    [CyclicDateDay] => 0
    [CyclicDateDayValue] => 0
    [CyclicDateFrom] => Array
        (
            [Day] => 0
            [Month] => 0
            [Year] => 0
        )

    [CyclicDateTo] => Array
        (
            [Day] => 0
            [Month] => 0
            [Year] => 0
        )

    [CyclicTimeType] => 0
    [CyclicTimeValue] => 0
    [CyclicTimeFrom] => Array
        (
            [Hour] => 0
            [Minute] => 0
            [Second] => 0
        )

    [CyclicTimeTo] => Array
        (
            [Hour] => 0
            [Minute] => 0
            [Second] => 0
        )

    [ScheduleActions] => Array
        (
            [0] => Array
                (
                    [ID] => 1
                    [Name] => Kalt
                    [Color] => 255
                    [ScriptText] => 
                    [ActionID] => {3644F802-C152-464A-868A-242C2A3DEC5C}
                    [ActionParameters] => Array
                    (
                        [VALUE] => 2
                    )
                )

            [1] => Array
                (
                    [ID] => 2
                    [Name] => Warm
                    [Color] => 16711680
                    [ScriptText] => 
                    [ActionID] => {3644F802-C152-464A-868A-242C2A3DEC5C}
                    [ActionParameters] => Array
                    (
                        [VALUE] => 0
                    )
                )

        )

    [ScheduleGroups] => Array
        (
            [0] => Array
                (
                    [ID] => 0
                    [Days] => 127
                    [Points] => Array
                        (
                            [0] => Array
                                (
                                    [ID] => 13
                                    [Start] => Array
                                        (
                                            [Hour] => 0
                                            [Minute] => 0
                                            [Second] => 0
                                        )

                                    [ActionID] => 2
                                )

                            [1] => Array
                                (
                                    [ID] => 14
                                    [Start] => Array
                                        (
                                            [Hour] => 12
                                            [Minute] => 0
                                            [Second] => 0
                                        )

                                    [ActionID] => 1
                                )

                        )

                )

        )

    [EventScript] => 
    [EventActionID] => 
    [EventActionParameters] => Array
        (
        )

    [LastRun] => 0
    [NextRun] => 0
    [LastActionID] => 0
    [NextActionID] => 0
)
*/
Any questions?