Actions, navigation, and overlays
Actions connect an event to a result: send a signal, navigate, set a variable, run a function, or open an overlay. Configure them on the selected element, page, variable, or parameter.
Create an action in VS Code
The sample Button is named StartPresentation; its displayed label is Start presentation. The navigation example opens a local sample page and does not send a presentation-system command.
- Open the host
.pagein the visual editor and select the control on the canvas. - Open Element Properties, expand Actions, and click Create Action.
- The AVS Actions editor opens. Check the heading, such as CREATE action for element StartPresentation, to confirm the owner.
- Enter a descriptive Name, choose Behaviour, and set Execution Delay if needed.
- Choose an action tab, then complete its target and value fields.
- Click Save action & close to apply the action and return to the visual editor. Save the page with ⌘S / Ctrl+S if its tab still shows unsaved changes.
- Expand the action in the sidebar to check its event. Use its pencil button to reopen the form for editing.
Cancel closes the creation form without adding the draft. Clicking a control on the design canvas selects it for editing; use Live Preview to exercise its runtime action.
Understand the form
| Control | What to configure |
|---|---|
| Name | A recognizable description such as Open room card or Set volume to 25. It identifies the action, not the button's visible label. |
| Behaviour | The event that starts this action. Choose an event supported by the owning control. |
| Execution Delay | Time in milliseconds before execution. Start with 0 for an immediate action. This is separate from a digital pulse's duration. |
| Behaviour Event model | Expand the editor's event explanation when choosing interaction timing. |
| Action tabs | Select the kind of result: Crestron, Web, Overlay, Routing, Variable, Parameter, Function, Audio, WebSocket, MQTT, or KNX. |
| Target and value fields | These change with the tab and selected type. Check required fields and the selected target before saving. |
| Save action & close | Apply the form and return to the page. Save the page document as well. |
Where a field offers a binding button, use the in-editor modal to pick a variable, parameter, or datasource path. In 27.0.4 this replaced the separate picker tab for action fields and feedback joins. Check the host scope before attaching a value.
Choose an event
| Owner | Typical events |
|---|---|
| Button or other touch element | onPress, onRelease, onClick, onHold |
| Input or value control | onChange, beforeChange, afterChange, onFocus, onBlur |
| Page | onLoad, onExit |
| Variable or page parameter | onChange |
Available events depend on the control. manual actions are invoked programmatically. Timing fields such as delay and pulseDelay use milliseconds.
Choose an action type
| Stored type | Action | Main target fields |
|---|---|---|
joinMap | Dpad digital button joins / RGB analog channel joins | buttonJoins / channelJoins |
d, a, s | Digital, analog, serial signal | signalName_signal; digital behavior or value |
r | Page flip | pageFlipTarget |
v | Set global variable | attachedVariableName, value |
p | Set page parameter | attachedParameterName, value |
o, co | Open or close overlay | Overlay settings and target page |
f | Run function | attachedFunctionToRun |
get, post, put, patch, delete | HTTP request | Connector, URL, body, response actions |
ws | WebSocket message | connectorUid, value |
mqtt | MQTT publish | Connector, topic, value, retain |
knx | KNX write | Connector, datapoint ID, format, value |
audio | Audio control | Source, play state, volume, loop |
Combine a command and navigation
A source-selection Button can own both an equipment command and a Routing action. For example, send the service's source-selection command and open the corresponding media-control page from the same On Press interaction.
Create and save each action on the same intended Button, give each a distinct name, and verify the event and target after saving. Test both effects in Live Preview. Navigation by itself does not confirm that the command succeeded; bind the selected appearance to reported feedback. If the command must complete successfully before continuing, use the action's supported response behavior or a feedback-driven workflow rather than treating two attached actions as a success dependency.
Navigate between pages
Use Routing when pressing a control should switch the main page. Prepare the destination page first so it appears in Target page.
- Select the Button and create an action.
- Name it
Open room card, choose On Press, and leave Execution Delay at0. - Select the Routing tab.
- Open Target page and search for the destination. The example selects
catalog/room-card.page. - Click Save action & close, save the host page, and open it in Live Preview.
- Press the Button and check that the intended page opens. Provide a route back in the destination interface.
The picker also offers Home page and Back. Home uses the project's configured start page; Back returns through navigation history, so test it after visiting another page. These destinations are stored as / and -1 respectively.
The picker displays a page key without the leading pages/. Keep the reference valid when moving or renaming pages and run Run Project Health Check afterward.
Set a variable or page parameter
Use Variable to write a project-wide value. Use Parameter for a value belonging to the current page instance. Create the target first; see Variables and page parameters.
Button example: set a numeric value
- Create a number variable named
volume. - On a Button, create an action named
Set volume to 25with On Press. - Choose Variable, optionally filter by Number, and select
volume. - Enter
25in Value. - Save the action and page. In Live Preview, press the Button and inspect a Text element bound to
$volume$to verify the new value.
This sets application state. It sends a hardware command only if you separately configure the integration or an appropriate variable side-effect action. For boolean targets, the form provides choices such as True, False, and Toggle. Choose a value compatible with the target type.
Slider example: forward the changed value
For a Slider's On Change action, select the destination variable or signal and use the changed value rather than a fixed custom value. In project data, onChangeActionUseCustomValue: false selects that event-value behavior. Move the Slider in Live Preview and check several different values; repeatedly receiving the same number usually means a custom literal was configured.
For a range control, check both destinations when the action exposes fields for a second value. Keep the destination's range and units compatible with the control.
Parameters inside reusable pages
Open the reusable page itself before attaching a Parameter action to one of its controls. Select a parameter defined on that page and test it through a host Subpage instance. A page parameter and a global variable with the same name are different targets. Use the appropriate tab rather than relying on the name alone.
Open an overlay
An overlay displays page content over the current interface. Use Overlay → Open Overlay for opening and Overlay → Close Overlay for dismissal. A routing action changes the main page instead.
Configure the overlay
Attach Page lists project pages and accepts a dynamic target. Choose the page or binding that the overlay should open.
- Create an action on the trigger element and select Overlay → Open Overlay.
- Choose an existing destination in Attach Page, or use its dynamic-value button to select a variable, parameter, or datasource value containing a page reference.
- Choose Placement: Fullscreen or an anchored popover position. Configure Offset (px) for anchored placement.
- Set Show mask, Show close button, and the outside/any-click close options as needed. The close button is used only for fullscreen overlays.
- If enabling Autoclose timer, set its value in seconds; the default is 60.
- Save the action and page, then test opening, dismissal, repeat activation, and navigation in Live Preview.
The saved target is overlayAttachedSubpage, for example pages/overlays/confirm.page. Element actions can resolve $variable$, %parameter%, and datasource tokens; page onLoad/onExit actions have variable/parameter scope, without an attached datasource.
Migration: 27.0.1 removed overlayAttachedSubpageName and Call Subpage By Name. Re-select the intended target in Attach Page and save. The field was named Attach SubPage in 27.0.1.
Runtime behavior and appearance
Anchored overlays flip to the opposite side when needed and stay clamped within the container. Repeating the same trigger toggles the overlay closed. Navigation and removal of the trigger close it. Outside-click dismissal excludes the trigger; any-click dismissal also excludes the trigger. The inactivity timer pauses while the pointer is held on overlay content and restarts on release.
Appearance is shared through the theme's Overlay section, rather than action-level background/mask styling. Overlay size comes from the attached page's custom dimensions, or theme page dimensions. See Overlay theme settings.
Stored options include overlayPlacement, overlayOffset, showMask, showCloseButton, outsideClose, anyClickClose, useOverlayTimer, and overlayTimer. Test content size, edge placement, and an accessible close path on the target device.
Send values
Digital actions support true, false, pulse, momentary, and toggle behavior. Analog and serial actions send values to their selected signals. For a value control's onChange, configure whether to use the changed value or a custom literal.
Since 27.0.3, action fields such as value, signal names, and requestUrl resolve dynamic tokens. Element actions resolve variables, page parameters, and datasource paths; page actions resolve variables/parameters; variable/parameter side-effect actions resolve variables/parameters at execution time. Element/page action fields also support Crestron feedback tokens. Datasource item scope exists only within the corresponding repeated list item. Test the resolved outgoing payload with preview logging.
HTTP actions store response references in onResponseOk and onResponseError, but the 27.0.29 runtime does not execute these response chains; requests execute and log status. Do not rely on these arrays to trigger success/error actions.
JSON action bodies and context tokens
Since 27.0.6, Web, WebSocket, and MQTT actions support custom JSON message bodies. Select JSON rather than Text, click Click to edit JSON (or the edit control for an existing body), then use the JSON editor toolbar to insert a global variable, page parameter, datasource value, or Context token. Dynamic tokens appear as labeled chips.
The screenshot shows an unsaved WebSocket action draft on the demo Home button; it was cancelled after inspection. The picker also provides shortcuts to open Global Variables and Page Parameters.
Context tokens resolve at action execution using the owning element's runtime event. They apply inside JSON action bodies, not ordinary serial values or URL postfixes.
| Element | Context marker | JSON value type |
|---|---|---|
| Every element | @context:elementName@ | String |
| Dpad | @context:pressedButton@ | String: top/right/bottom/left/center |
| Color Picker, RGB variant | @context:red@, @context:green@, @context:blue@ | Number, 0–255 |
| Color Picker, Hex variant | @context:hex@ | String, #rrggbb |
| State Control | @context:value@ | Boolean |
| Slider | @context:value@, @context:value2@ for upper range thumb | Number |
| Round Slider / Shades Compact | @context:value@ | Number |
| Input | @context:text@ | String |
For a Slider's JSON message:
{"control":"@context:elementName@","level":@context:value@}
Keep string tokens within JSON quotes; numbers/booleans can occupy a bare value position. Token-placement errors provide actionable messages and auto-quoting assistance, but still inspect the resulting message. Do not paste unquoted markers into a strict JSON project file: the example is the message-editor content, saved as the action's string value. Save the body, action, and owning page, then verify the actual payload at the receiver.
The editor modal is larger and the JSON editor fills its container. Empty fields expose an edit icon. The current change value is available to beforeChange, onChange, and debounced afterChange; choose the timing expected by the service.
Migration: replace Dpad @buttonId@ with @context:pressedButton@; use the current RGB red/green/blue keys. Host-scope $variable$, %parameter%, and datasource token rules still apply to inserted dynamic values.
Signals, integrations, and response actions
Digital, analog, and serial commands
In Crestron, select Push Digital, Push Analog, or Push Serial, then choose the signal and its value behavior. Match the signal name and type to the control-system program.
| Digital value | Intended behavior |
|---|---|
| True / False | Send a definite on/off value. |
| Pulse | Send true followed by false; configure Pulse Delay in milliseconds. |
| Momentarily | Use the press/release interaction for a held command; verify both edges in the runtime. |
| Toggle | Invert the state; verify synchronization with feedback. |
An outgoing action and incoming feedback have different jobs. For example, the action requests a light change while feedback controls the button's displayed mode. See Modes and feedback styling.
Choose the integration tab
| Tab | Preparation and checks |
|---|---|
| Web | Select a Web connector, method, optional URL postfix, and Request body for POST/PUT/PATCH. See HTTP actions. |
| WebSocket | Select a WebSocket connector and Message. See WebSocket. |
| MQTT | Select the connector, Topic, Value, and Retain behavior. Verify the actual subscriber receives the expected payload. |
| KNX | Select the connector, Datapoint ID, and Format. Match the value to the datapoint type. |
| Function | Select a function available in the project. Verify its identifier remains valid after changing functions. |
| Audio | Configure source, playback state, volume, and loop behavior as applicable, then test in the intended runtime. |
Creating an action does not create or connect the required integration. Connector references in project files use paths such as connectors/controller.mqtt, not a bare filename.
For HTTP chaining, onResponseOk and onResponseError reference other actions by UUID. Keep those references valid. The 27.0.29 runtime logs response status but does not execute these response chains. Inspect logs and implement any required response workflow separately.
Play or stop audio
In 27.0.29, create an action on the intended element, choose its event, and open Audio. Choose Play audio or Stop audio. For playback, select Audio file from project assets or the built-in alert, notification, and success sounds, then set volume and loop. Save the action and owning document.
The saved source field is audioSrcPath; playback state is the boolean value, with audioVolumePercent on a 0–100 scale and audioLoop for repetition. Use the picker to obtain a valid built-in sound reference rather than guessing its path.
Test playback from a user gesture in Live Preview, then test stopping and looping. Audio does not play on the VS Code design canvas. Browser autoplay restrictions and device volume can affect playback; check the exported target too. The runtime uses a shared audio player, so a later Play action replaces its current source and Stop stops that player.
Custom Element events
For a Custom Element with a valid manifest, select Before Change, On Change, or After Change and choose its declared Event. The action's attachedEventName must match that manifest event. Link state-change events to their prop so the component and host value stay synchronized. See Custom Element.
Verify and troubleshoot
- Save the action, then save its owning page or data document.
- Run Run Project Health Check to catch invalid references.
- Open the correct host page in Open Live Preview (Browser).
- Exercise the chosen event: press, release, hold, or change a value as appropriate.
- Verify the destination or state change. For external commands, also verify receipt by the actual integration.
- Test again with feedback, page navigation, and relevant modes active.
| Symptom | What to check |
|---|---|
| Clicking on the design canvas only selects the control | Run the interaction in Live Preview. |
| The action is absent after returning to the page | Confirm Save action & close was used and the action was created for the intended owner. |
| The action fires at the wrong time | Check Behaviour, Execution Delay, and the control's event model. Avoid configuring multiple events for the same command unintentionally. |
| A Slider always sends the same value | Check whether a custom value overrides the changed value. |
| A command works but the button appearance does not update | Configure incoming feedback and mode selection separately. |
| Navigation opens the wrong page | Inspect Target page, the configured Home page, and relative/project-root references. |
| An action behaves differently in a mode | Check whether that mode has its own actions; see Actions in modes. |
| An integration action has no effect | Verify the connector, target, value type, connection, and runtime support. A healthy local preview alone does not prove hardware operation. |
| Overlay page picker is empty | Check the current project, clear search text, and choose an existing page in Attach Page; migrate removed name-based targets. |




