Programming view
Use the Programming view to have the Control4 system control devices by identifying to the system any device behavior or configuration options that you want to occur automatically. The Programming view lets you create a program script using the drag-and-drop method.
Note: Programming is an advanced feature in Composer Pro. Detailed information about programming is explained in the Composer Pro User Guide. This section discusses some basics.
All programming is based on events in the Control4 system. For example, a door that opens is an event. When an event occurs in the system, it can trigger other programmed actions to run.
Example: When the Bathroom door opens (event occurs), program the Bathroom light to turn on (action taken).
Another example is shown in the figure below. Note the text in the Script pane (center pane). The event is “When the Family > Left Dimmer top button is pushed,” and the action is “Open the Garage > Garage Door (Sensor).” The event came from the Events pane, and the action came from the Actions pane.
To access the Programming view:
- Click Programming at the bottom of the System Design pane.
- In the Programming pane, view the list of Device Events (see below) and events for the object selected.
- Programming:
- Device Events (left pane)—Displays all devices that have associated events in the project tree.
- <Device> or <Room> Events (left pane)—Displays the available events for the currently selected device or room in the Device Events project tree. If there are no events for that device or room, none are displayed.
- Script (center pane)—Displays the script associated with the currently-selected event from the Device Events pane. You drag-and-drop an action from the <Project Title> Actions pane to arrange the order of actions and nest them in the Script pane.
- Actions:
The Programming view consists of several panes:
To add an action to the script:
- Select the device in the Device Action project tree (right pane).
- Select the type of action you want in the Actions pane.
- Click the green arrow.
- Drag and drop the action to the Script pane.
- Commands tab—Use this tab to select commands (delete, add, etc.) to use for your script.
- Conditionals tab—Use this tab to select conditionals ('if' statements) to use for your script.
- Loops tab—Use this tab to select loops ('while' statements, etc.) to use for your script.