Variable Injection

Dealers can create dynamic messages by injecting variables found in the project (both device variables and global variables).

These are similar to the Control4 Add Variable option under Push and Email Agents and serve the same purpose. There are three types of variables you can inject. Local, Project and Driver Variables.

Local Driver Variable Injection

To inject a local driver variable from this driver, use the square brackets. Dealers can use any STRING, INTEGER or FLOAT variable attached to this driver.

The most common example of a locally injected variable is: [NAME] which converts into the name of the driver.

Example.

    [NAME] has been turned on

    converted to (NAME = HDMI SWITCH)

    HDMI Switch has been turned on

Some drivers contain additional local variables which are included in the drivers' documentation under Composer Variables.

Global Variable injection

To use a variable from another driver, Dealers will use the format:

{DriverId:VariableName}

The DriverId is the device id of the driver and VariableName is the variable name (case-sensitive)

Example.

    {1090:USER_NAME} has unlocked the front door

    converted to (1090:USER_NAME = Jill Smith)

    Jill Smith has unlocked the front door

The DriverID value which can be found by hovering over the driver under Programming.

Note: some variables are registered to the proxy id instead of the driver id... in this case you would use the proxy ID which is normally +1 from the device id.

Control4 Variables Agent Variable

To access Variables created under the Variable Agent just enter the name of the variable between { and }

{ComposerVariableName}

Example.

    Home is now in {Home Mode} mode

    converted to (Home Mode = Vacation)

    Home is now in Vacation mode

Date/Time Formatting

Include DATE, DAY and TIME values and have them convert to the proper format.

{DAY} Gets converted to the current Day (Monday, Tuesday etc...)

    The current day is {DAY}

    converted to (DAY = Monday)

    The current day is Monday

{TIME} Gets converted to the current Time (HH:MMam/pm)

    The current time is {TIME}

    converted to (TIME = 14:52 pm)

    The current time is 14:52pm

{DATE} Gets converted to Month, day (ex. March, 15)

    The current day is {DATE}

    converted to (DATE = March, 15)

    The current day is March, 15

{DATE:FORMATTER} can be used for advanced date control.
Change FORMATTER to a lua date format string.

    {DATE:%A %B, %d} would be converted to Wednesday March, 15

    {DATE:%A at %I:%M%p} would be converted to Wednesday at 12:15pm

Click here for a complete list of Lua date formatters