> For the complete documentation index, see [llms.txt](https://help.qtech.co.nz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.qtech.co.nz/qtech/cellular-remote-control/sms-controller/control-programs.md).

# Control programs

Make the SMS Controller act on its own with up to 4 programs of conditions and timed actions.

SMS Workbench allows the user to create up to 4 control programs. Each program can implement different conditions depending on user preference. Setting up logical conditions to have a desired action is achievable in program creation.

## Create a program

1. Control Programs can be accessed from the **Live Status** or **I/O Overview** (if offline) Screen.
2. To start creating a control program, click one from the four available control programs (in this instance **Unused**).
3. Enter a **Name**. The Name of the Control Program is not used for any Text Messages and it is recommended to utilise this to clarify exactly what the program is supposed to do, i.e. Switch Pump on at 30%.
4. Set **Enabled** to On. Selecting OFF will prevent the Control Program from running.
5. Choose the **Condition Type**: Event or Alarm.
   * **Event:** A Text will be sent to notify the designated recipient (s) that a condition was met.
   * **Alarm:** A Text is sent to notify the recipient and an Acknowledge is required. If no acknowledge is received, the same text will be escalated to the next recipient.
6. Add the conditions. See below.
7. Click **Alter Remote I/O** and set the actions. See below.

## Conditions

Click the shaded object labelled with **Click to add a new condition** and follow the condition configuration flow. You may add up to 8 conditions for each control program and apply logical conditions (and/or) to meet a complicated controlled program’s needs.

![Roadmap for creating conditions](https://3621580088-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fa5hMAUl7E1cWeN5Rghg0%2Fuploads%2Fm2NM5Ln6Ip1mVoGliF59%2Fcontrol-program-roadmap.png?alt=media)

![A control program with several conditions combined with AND and OR](https://3621580088-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fa5hMAUl7E1cWeN5Rghg0%2Fuploads%2FS0aeNET5NsdU1MdQBNrl%2Fcontrol-program-example.png?alt=media)

You can remove all the conditions by clicking **Clear All Conditions** button and confirming the deletion action.

## Actions

After all the conditions have been added, click the rounded rectangle labelled as **Alter Remote I/O** to setup the device. It can be programmed to do up to 4 tasks in sequence with different number of delay times.

| Setting       | What it does                                                                                                                                                                                                                                                                                                   |
| ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Sequence      | In which order does the control program need to attend to the criteria defined.                                                                                                                                                                                                                                |
| When          | Select applicable action from the dropdown list as to when the action must be applied. Response times are: Immediate, In 10 seconds, In 30 seconds, In 1 minute, In 5 minutes, In 10 minutes, In 15 minutes, In 30 minutes, In 1 hour, In 2 hours, In 3 hours, In 4 hours, In 5 hours, In 6 hours, In 7 hours. |
| User / Device | Selecting **This Device** will prompt for additional actions. Selecting User will send an SMS to the selected recipient.                                                                                                                                                                                       |
| Device Action | This Device only: Switch On, Switch Off, Toggle or Pulse                                                                                                                                                                                                                                                       |

To achieve "Returned to Normal" functionality, configure the SMS Controller to send SMS message once the conditions are no longer met.

## Scaling

Control programs use the raw value only – they don't use scaled values.

For example: to achieve the equivalent of greater than 90PSI on a 0-200 PSI transducer you would need to use value of 460 (equal to (90/200)\*1023).

An alternative approach is to use greater / less than % conditions, which of course are independent of any scaling.

e.g. 90PSI would be 45% (0-200PSI scale) – so both the control program and the input alert could use 45% as the trigger condition.

For input alerts, if Selecting (value) then the actual Displayed Value is utilised.
