Developer
Log in

Actions

Automations

3 actions in the Automations group. Each is its own JSON-RPC method, and also runs through action.run.

automation.runRun an automation

Runs an automation now, whatever its trigger (its Run button).

Keyscope: control

Parameters

Result

  • automationstring (uuid)always

    The automation's id.

  • startedbooleanalways

Live state

automations.items[automation].enabled bool

On while the automation is enabled. From the automations topic. How to read it.

Request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "automation.run",
  "params": {
    "automation": "<automation id or name>"
  }
}

In the SDKs

C#
Task<AutomationRunResult> AutomationRunAsync(AutomationRunParams parameters, CancellationToken cancellationToken = default)
TypeScript
automationRun(params: AutomationRunParams): Promise<AutomationRunResult>
Python
async def automation_run(self, *, automation: str) -> AutomationRunResult
JSON Schema
JSON
{
  "params_schema": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "additionalProperties": false,
    "properties": {
      "automation": {
        "description": "The automation. Give its id or name.",
        "minLength": 1,
        "type": "string"
      }
    },
    "required": [
      "automation"
    ],
    "type": "object"
  },
  "result_schema": {
    "additionalProperties": false,
    "properties": {
      "automation": {
        "description": "The automation's id.",
        "format": "uuid",
        "type": "string"
      },
      "started": {
        "type": "boolean"
      }
    },
    "required": [
      "automation",
      "started"
    ],
    "type": "object"
  }
}

automation.enableTurn an automation on or off

Turns an automation on (it runs when its trigger fires), off, or the other way.

Keyscope: manage

Parameters

  • automationautomationrequired

    The automation. Give its id or name.

    Choices in automations

  • modechoiceoptional

    On, off, or toggle.

    One of on off toggle · Default "toggle"

Result

  • automationstring (uuid)always

    The automation's id.

  • enabledbooleanalways

Live state

automations.items[automation].enabled bool

On while the automation is enabled. From the automations topic. How to read it.

Request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "automation.enable",
  "params": {
    "automation": "<automation id or name>"
  }
}

In the SDKs

C#
Task<AutomationEnableResult> AutomationEnableAsync(AutomationEnableParams parameters, CancellationToken cancellationToken = default)
TypeScript
automationEnable(params: AutomationEnableParams): Promise<AutomationEnableResult>
Python
async def automation_enable(self, *, automation: str, mode: AutomationEnableMode | None = None) -> AutomationEnableResult
JSON Schema
JSON
{
  "params_schema": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "additionalProperties": false,
    "properties": {
      "automation": {
        "description": "The automation. Give its id or name.",
        "minLength": 1,
        "type": "string"
      },
      "mode": {
        "default": "toggle",
        "description": "On, off, or toggle.",
        "enum": [
          "on",
          "off",
          "toggle"
        ],
        "type": "string"
      }
    },
    "required": [
      "automation"
    ],
    "type": "object"
  },
  "result_schema": {
    "additionalProperties": false,
    "properties": {
      "automation": {
        "description": "The automation's id.",
        "format": "uuid",
        "type": "string"
      },
      "enabled": {
        "type": "boolean"
      }
    },
    "required": [
      "automation",
      "enabled"
    ],
    "type": "object"
  }
}

variable.setSet a variable

Sets an automation variable: what {var:name} shows in a text layer and an automation's If can check. Empty forgets it. Kept by Studio across restarts.

Keyscope: control

Parameters

  • nametextrequired

    Its name: letters, digits, spaces and _ - . :

    Up to 64 characters

  • valuetextoptional

    Its value; empty or left out forgets it.

    Up to 4096 characters

Result

  • namestringalways
  • valuestringalwayscan be null

    Its value now; null when forgotten.

Live state

variables.items[name].value string

The variable's value. From the variables topic. How to read it.

Request
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "variable.set",
  "params": {
    "name": "<text>"
  }
}

In the SDKs

C#
Task<VariableSetResult> VariableSetAsync(VariableSetParams parameters, CancellationToken cancellationToken = default)
TypeScript
variableSet(params: VariableSetParams): Promise<VariableSetResult>
Python
async def variable_set(self, *, name: str, value: str | None = None) -> VariableSetResult
JSON Schema
JSON
{
  "params_schema": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "additionalProperties": false,
    "properties": {
      "name": {
        "description": "Its name: letters, digits, spaces and _ - . :",
        "maxLength": 64,
        "type": "string"
      },
      "value": {
        "description": "Its value; empty or left out forgets it.",
        "maxLength": 4096,
        "type": "string"
      }
    },
    "required": [
      "name"
    ],
    "type": "object"
  },
  "result_schema": {
    "additionalProperties": false,
    "properties": {
      "name": {
        "type": "string"
      },
      "value": {
        "description": "Its value now; null when forgotten.",
        "type": [
          "string",
          "null"
        ]
      }
    },
    "required": [
      "name",
      "value"
    ],
    "type": "object"
  }
}

to open · ↑ ↓ to move · Esc to close