Preset() - Classic Preset Function

This function will send a classic preset message onto the network.
You can specify parameters like area and preset number but you cannot specify channel number. It will always effect the entire area. To send a preset to a single channel you will need to use the DyNet command to send a 0x6b/OneTouch message.

Syntax

Preset(A=x,P=x,F=x,B=x,J=x)

Parameters
  • "A" is the area number (0-255) - Default of 1

  • "P" is the preset number (0-2048) - Default of 1

  • "F" is the fade time in seconds (0-1310)- Default is 0.2 seconds

  • "J" is the join level (0x00-0xFF) - Default is 0xFF

  • "B" is the preset bank (1-256) - Default is 1 (presets 1-8)

Any parameter that is omitted will be replaced with the default value.
You can only use fixed values, decimal or hex, in functions. You may not reference memory locations or ports. However, you can use constants as they are just place holders for fixed values.

You can use the commands Preset= Command, Area= Command, Fade= Command, Bank= Command, and Join= Command to modify the default value for parameters in this function when you do not specify them.

Examples

Example 1

Simple standard use of the Preset() function. Join and Bank are omitted so the default values are used.

{
Preset(A=4,P=2,F=2) //Recall preset 2 for area 4 with a fade of 2s.
}

Example 2

Turns off the lights in a house. Note how it uses commands to modify the default fade time and preset number.

{
Fade=2         //Set default fade time to 2 seconds for dimmable zones
Preset=4       //Set default preset to 4 (Off)
Delay=.1       //Set a default delay of 100ms
Preset(A=4)    //Turn off the living room lights
Delay()
Preset(A=9)    //Turn off the dining room lights
Delay()
Preset(A=5)    //Turn off the kitchen lights
Delay()
Preset(A=11)   //Turn off the bedroom lights
Delay()
Fade=0         //Set default fade time to 0 seconds for switched zones
Preset(A=22)   //Turn off the Garage
Delay()
Preset(A=3)    //Turn off the Exterior lights
Delay()
Preset(A=14)   //Turn off the Fountain pump
Delay()
Preset(A=8)    //Turn off the Closet light
Delay()
Preset(A=100,P=1)    //Power security light, doesn't use default preset
}

Example 3

Using a constant to define the area parameter.

#const LightingArea 13
{
Preset(A=LightingArea,P=1,F=5) //Recall preset 1 with a fade of 5s for the lighting area.
}