« Back to Product

Documentation

System Variables

System variables are variables that are available in every PHP script. The user can utilize them to create efficient PHP scripts that can solve generic tasks. The according system variables are set automatically when the PHP script is called, depending on the trigger. The following tables providing an overview over the variables which are available in which PHP scripts.

Warning

Regard upper and lower case when writing these variables (Case Sensitive)!

General System Variables

The following system variables are always available.

System Variable Description
$_IPS['SELF'] ScriptID of the current PHP script
$_IPS['THREAD'] ThreadID of the current PHP script
$_IPS['SENDER'] Trigger of the current PHP script. Further global variables are possible, depending on the value. Possible values are further specified at Additional System Variables

Additional System Variables

The following system variables are available, depending on the value of $_IPS['SENDER'].

Action

When the PHP script was executed by a RequestAction .

system variable description
$_IPS['SENDER'] By default, this "Action" can be set individually with RequestActionEx
$_IPS['VALUE'] Value with which the variable was called
$_IPS['VARIABLE'] ID of the variable that is to be switched

Execute

When the PHP script was run from the administration console.
No additional system variables.

HeatingControl

When the PHP script was called from an event of HeatingControl.

System Variable Description
$_IPS['INSTANCES'] IDs of the sending instances
$_IPS['INVERTS'] States if a device is inverted (true/false)
$_IPS['VALUE'] States if a device should heat (true) or not (false)

RegisterVariable

When the PHP script was called by a RegisterVariable instance.

System Variable Description
$_IPS['INSTANCE'] ID of the triggering RegisterVariable instance
$_IPS['VALUE'] Value of the puffer that was received from the splitter or I/O module
$_IPS['CLIENTIP'] (only for I/O ServerSocket) Received IP adress of the Client
$_IPS['CLIENTPORT'] (only for I/O ServerSocket) Receiving port of the Client
$_IPS['TYPE'] Status of the receiving port (0 = Data; 1 = Connected; 2 = Disconnected)

RunScript

When the PHP script was called by an IPS_RunScript function. In addition, IPS_RunScriptEx can be called to pass additional parameters.
No additional system variables.

Shutdown

During IP-Symcon Shutdown (see EventControl).
No additional variables.

ShutterControl

When the PHP script was called by a ShutterControl Module.

System Variable Description
$_IPS['DIRECTION'] Moving direction:
0 = Stop
1 = Up
2 = Down
$_IPS['DURATION'] Moving duration in milliseconds
$_IPS['INSTANCE'] InstanceID that was set in ShutterControl
$_IPS['INSTANCE2'] InstanceID #2 that was set in ShutterControl

Startup

During IP-Symcon Startup (see EventControl).
No additional system variables.

StatusEvent

When the PHP script is called by a state change of an instance.
Further informations are found at EventControl and IPS_GetInstance.

System Variable Description
$_IPS['INSTANCE'] InstanceID for state change
$_IPS['STATUS'] State of the instance. A list of possible values is found here: IPS_GetInstance
$_IPS['STATUSTEXT'] A short text according to the state

TimerEvent

When the PHP script was called by a cyclic or a schedule event.

System Variable Description
$_IPS['ACTION'] ID of the calling action (only schedule event)
$_IPS['EVENT'] ID of the triggered event
$_IPS['TARGET'] ID of the superior object

Variable

When the PHP script was called be a trigger event.

System Variable Description
$_IPS['EVENT'] ID of the calling event
$_IPS['OLDCHANGED']
(since Version 5.1)
Timestamp of the last change of the old value
$_IPS['OLDVALUE'] Value of the affected variable before switching
$_IPS['OLDUPDATED']
(since Version 5.1)
Timestamp of the last update of the old value
$_IPS['TARGET'] ID of the superior object
$_IPS['TRIGGER'] Type of the calling event
$_IPS['VALUE'] Value of the affected variable when switching
$_IPS['VARIABLE'] ID of the affected variable

VoIP (since Version 5.2)

When the PHP script is executed by an event of the VoIP Module

System Variable Description
$_IPS['CONNECTION'] ChannelID of the connection
$_IPS['DATA'] Contains the pressed button when $_IPS['EVENT'] is DTMF
$_IPS['EVENT'] The variable can contain the following values:
Incoming: Incoming call
Connect: Established connection
Disconnect: Terminating connection
PlayFinish: Audio file has finished playing
DTMF: Received a DTMF sound
$_IPS['INSTANCE']
(ab Version 5.4)
InstanceID of the VoIP Instance

Watchdog

When the PHP script is called by the Watchdog.

System Variable Description
$_IPS['STATUSTEXT'] The passed state text
$_IPS['VALUE'] Value of the variable that is outside of its interval
$_IPS['VARIABLE'] ID of the variable that is outside of its interval

WebFront

When the PHP script was called by the WebFront.

System Variable Description
$_IPS['CONFIGURATOR'] ID of the currently used configurator
$_IPS['VALUE'] (only for action script) New value of the variable
$_IPS['VARIABLE'] (only for action script) ID of the changing variable

WebHook (since Version 4.0)

When the PHP script was called by a WebHook control.

System Variable Description
$_SERVER['HOOK'] Complete URL of the called WebHook

Furthermore, the WebHook type provides the same variables as WebInterface.

WebOAuth (since Version 4.0)

When the PHP script was called by a OAuth Control.

System Variable Description
$_SERVER['OAUTH'] Complete URL of the called WebOAuth

Furthermore, the WebOAuth type provides the same variables as WebInterface.

WebInterface

When the PHP script was called by the Webserver, e.g., in the 'user' folder.

System Variable Description
$_IPS['INSTANCE'] ID of the calling Webserver instance
$_GET Received data via GET
$_POST Received data via POST
$_SERVER['DOCUMENT_ROOT'] Contains the Document Root folder that contains the currently executed PHP script as it is set within the configuration of the server.
$_SERVER['PHP_AUTH_PW'] If HTTP authentication is used, this variable contains the password the user provided
$_SERVER['PHP_AUTH_USER'] If HTTP authentication is used, this variables contains the user name the user provided
$_SERVER['PHP_SELF'] File/Path of the started PHP script
$_SERVER['QUERY_STRING'] If available, the query string that was used to access the website
$_SERVER['REMOTE_ADDR'] The IP adress that the user used to access the website
$_SERVER['REMOTE_PORT'] The port that the user used to access the website
$_SERVER['REQUEST_METHOD'] Contains the request method that was used for the access, e.g., "GET", "HEAD", "POST", or "PUT"
$_SERVER['REQUEST_URI'] The URI that was used to access the current website, e.g., "/index.html"
$_SERVER['SCRIPT_NAME'] Contains the path of the current PHP script. This can be useful for websites that link to themselves

In addition, all request headers are added in capital letters with a HTTP* prefix. Minus symbols (-) are changed to underscore symbols (). For example, the header 'User-Agent is provided as $_SERVER['HTTP_USER_AGENT'].

Any questions?