> ## Documentation Index
> Fetch the complete documentation index at: https://docs.visualradioassist.live/llms.txt
> Use this file to discover all available pages before exploring further.

# Stream Deck

> Control the studio, the Core, signals, macros, outputs, cameras and variables from an Elgato Stream Deck with the built-in Website action.

The Stream Deck software can call the Core API without any plugin. The built-in **Website** action can send a GET request in the background instead of opening a browser. Every Core API action is a plain GET, so one key is one URL.

For keys that show the current state, use [Bitfocus Companion](/develop-with-vra/core-control-api/bitfocus-companion-control-over-visual-radio) instead.

## Before you start

* Stream Deck 6.9 or later.
* The address and port of the Core, for example `192.168.1.50:3002`.
* A device token, or LAN access for the computer the Stream Deck is connected to. See [Authentication and LAN access](/develop-with-vra/core-control-api/authentication-and-lan-access).

<Tip>
  Is the Stream Deck connected to the Core machine itself? Then use `http://localhost:3002/...`. Calls from the Core machine need no token.
</Tip>

## Set up a key

<Steps>
  <Step title="Add a device in VRA Cloud">
    Open **Studio settings → Core API**, click **Add device** and give it a
    name like `Stream Deck studio desk`. Copy the **Stream Deck URL**. It
    holds the Core address and the token and points at the studio toggle;
    change the path for other keys.
  </Step>

  <Step title="Drag a Website action onto a key">
    In the Stream Deck app, find **Website** under **System** and drag it onto
    a key.
  </Step>

  <Step title="Paste the URL">
    Paste a URL from the table below into the URL field. Add the token with
    `?token=`, or leave it out when the computer has LAN access.
  </Step>

  <Step title="Switch to a background request">
    Open the browser dropdown of the Website action and pick the option that
    sends a GET request in the background. Without it, every press opens a
    browser tab.
  </Step>
</Steps>

Do not count on the Website action sending headers. Put the token in the URL with `?token=`.

## URLs

Replace `vra_examp1etoken…` with your device token.

| Key | URL |
| - | - |
| Studio on air | `http://192.168.1.50:3002/api/v2/studio/onair?token=vra_examp1etoken…` |
| Studio off air | `http://192.168.1.50:3002/api/v2/studio/offair?token=vra_examp1etoken…` |
| Studio recording | `http://192.168.1.50:3002/api/v2/studio/recording?token=vra_examp1etoken…` |
| Studio toggle | `http://192.168.1.50:3002/api/v2/studio/toggle?token=vra_examp1etoken…` |
| Core activate | `http://192.168.1.50:3002/api/v2/core/activate?token=vra_examp1etoken…` |
| Core deactivate | `http://192.168.1.50:3002/api/v2/core/deactivate?token=vra_examp1etoken…` |
| Audio Director on | `http://192.168.1.50:3002/api/v2/audio-director/on?token=vra_examp1etoken…` |
| Audio Director off | `http://192.168.1.50:3002/api/v2/audio-director/off?token=vra_examp1etoken…` |
| Camera Assist on | `http://192.168.1.50:3002/api/v2/camera-assist/on?token=vra_examp1etoken…` |
| Signal on | `http://192.168.1.50:3002/api/v2/signals/break-lamp/on?token=vra_examp1etoken…` |
| Signal off | `http://192.168.1.50:3002/api/v2/signals/break-lamp/off?token=vra_examp1etoken…` |
| Trigger a macro | `http://192.168.1.50:3002/api/v2/macros/Jingle%20in/trigger?token=vra_examp1etoken…` |
| Take a scene on an output | `http://192.168.1.50:3002/api/v2/outputs/main/scenes/weather/take?token=vra_examp1etoken…` |
| Rundown next on an output | `http://192.168.1.50:3002/api/v2/outputs/main/rundown/next?token=vra_examp1etoken…` |
| Cut to camera 2 | `http://192.168.1.50:3002/api/v2/cameras/2/cut?token=vra_examp1etoken…` |
| Trigger an angle | `http://192.168.1.50:3002/api/v2/cameras/2/angles/Guest%20close/trigger?token=vra_examp1etoken…` |
| Variable on | `http://192.168.1.50:3002/api/v2/variables/live/on?token=vra_examp1etoken…` |
| Variable off | `http://192.168.1.50:3002/api/v2/variables/live/off?token=vra_examp1etoken…` |

* `break-lamp` stands for the identifier of one of your signals. The signal id works too.
* Macros are addressed by id or by name. Encode spaces in the name as `%20`.
* `main` stands for the slot key of an output and `weather` for the key of one of its scenes. When the output has more than one playout scene, add `&scene=<playout scene key>` to the rundown URL.
* `2` is the camera's number in the camera list; its name or id works too. `Guest close` stands for one of that camera's angles.
* `live` stands for the name of a BOOLEAN user input variable of the station. Variables are written through VRA Cloud, so these keys need the Core's internet connection.
* On a studio shared by several stations, add `&station=<station name>` to output and variable URLs, or pin the device to a station. Macro keys need neither: macros are studio-scoped. See [Station safety](/develop-with-vra/core-control-api/station-safety).

See [Routes](/develop-with-vra/core-control-api/routes) for every route.

## Prefer explicit actions

The Website action does not show whether a call worked or what the state is now. Use one key per state, like **Studio on air** and **Studio off air**, rather than one toggle key. The explicit routes are idempotent: pressing **Studio on air** twice keeps the studio on air. A toggle key flips the state on every press, including the press you were not sure about.

A Stream Deck **Multi Action** can combine several URLs on one key, for example Audio Director on and Camera Assist on.

## Showing state on a key

The built-in Website action cannot show a value on its key. Community plugins such as API Ninja or API Monkey can poll a URL and change the key image. Plugins vary in what they support: use a [plain-text route](/develop-with-vra/core-control-api/plain-text-routes), such as `/api/v2/plain/studio/status`, when a plugin can only compare the whole response. For a camera tally key, poll `/api/v2/plain/cameras/2/on-air` and light the key when the answer is `1`. We have not tested these plugins with the Core API.

For reliable state on the keys, use [Bitfocus Companion](/develop-with-vra/core-control-api/bitfocus-companion-control-over-visual-radio).

## Troubleshooting

Call the URL from a browser on the same computer. The JSON answer tells you what went wrong, for example `"error":"unauthorized"` for a missing or wrong token. On the Core machine, `http://localhost:3002/api/v2/requests` shows the last calls with their status and error code. See [Errors and status codes](/develop-with-vra/core-control-api/errors-and-status-codes).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.