A PHP script is a concatenation of more or less complex commands. IP-Symcon uses and supports every functionality of the programming language PHP. Numerous examples and further documentation are found in our community forum and throughout the internet.
A new PHP script can be added to a project via "+" -> "Automation" -> "PHP Script". It is recommended to give the PHP script a unique and meaningful name. The name can be changed at any time and the PHP script can be moved within the tree view via Drag & Drop. Alternatively, the PHP script can be directly created at the wanted position via "Right Click" -> "Add object" -> "Automation" -> "PHP Script.
A PHP script is required to begin with a PHP Tag (<?php). Every command needs to end with a semicolon.
The PHP script can be executed manually via "Execute". In that case, the execution is saved automatically. The time stamp of the last execution as well as the runtime are updated. The view can be changed between [Text] and [HTML].
Faulty inputs in the PHP script can be corrected via "Undo" or "Redo."
"Export to HTML" shows the complete PHP script in a browser.
When an existing PHP script (e.g., from the forum) was downloaded, it can be inserted quickly and uncomplicated with the button "Import". After pressing the button "Import" the launched menu can be used to select the wanted file. By default, all PHP scripts within IP-Symcon are stored as files with names according to their ID. For better readability, the file name can be changed at any time with the button "Rename".
The button "Add Command" creates a new command at the position of the cursor.
To handle the multitude of commands, it is recommended to select the affected device.
Here is an example for the sound output "Media Player":
A selection shows all device specific functions:
The result is the command with the according ID of the selected device.
The documentation for all selectable commands is shown in the Command Reference and Module Reference. Another possibility is the search function in the upper right area of the IP‑Symcon website. This function offers a quick way to find the documentation and examples for a command.
Autocompletion can be used when entering commands by pressing "Ctrl + Space" within a PHP script. The shown list contains all IP-Symcon functions. The selection can be narrowed by entering the first letters of a command. For example, typing "'f' + 's' + '2' + '0'" shows all FS20 commands. The wanted command can be chosen by double click or via arrows + Enter.
A complete list is found at System Variables.
A list of all keyboard-shortcuts.