Schemas / Animation / modulators

rig.mod.trigger

v0.31.0 · draft 13 fields 2 required

Fields

FieldTypeMeaning
source entity required Sensor / GPIO / presence / switch entity that fires this trigger
action enumcolor-flash · play-sample required color-flash or play-sample
enabled bool optional Optional. Skip when false; absent = true
cooldownMs int optional Optional. Minimum ms between successful fires; absent = 0
calendar entity optional Optional. Entity carrying calendar hours / span that must be active; absent = always
fadeInMs int optional Optional. Colour-flash fade in; absent = host default
holdMs int optional Optional. Colour-flash hold; absent = host default
fadeOutMs int optional Optional. Colour-flash fade out; absent = host default
palette array<rgba> optional Optional. Colour-flash palette (0-1 floats); absent = host default
mode enumforward · backward · pendulum · random optional Optional. forward, backward, pendulum, random; absent = forward
volume number0 – 1 optional Optional. Play-sample gain 0-1; absent = host default
loop bool optional Optional. Play-sample loop; absent = false
samples array<entity> optional Optional. Play-sample assets (rig.media.asset_ref); absent = none

Discrete gated event. Format when present.

Unlike rig.mod.binding (continuous property drive), a trigger fires an action when its source asserts and gates allow.

Edge / cooldown clocks and LED status flashes are host runtime - do not serialize them.

JSON Schema

Resolves at https://rig.works/schemas/rig.mod.trigger.schema.jsonraw file.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://rig.works/schemas/rig.mod.trigger.schema.json",
  "title": "rig.mod.trigger",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "source": {
      "$ref": "./_defs.schema.json#/$defs/entity"
    },
    "action": {
      "type": "string",
      "enum": [
        "color-flash",
        "play-sample"
      ]
    },
    "enabled": {
      "$ref": "./_defs.schema.json#/$defs/bool"
    },
    "cooldownMs": {
      "$ref": "./_defs.schema.json#/$defs/int"
    },
    "calendar": {
      "$ref": "./_defs.schema.json#/$defs/entity"
    },
    "fadeInMs": {
      "$ref": "./_defs.schema.json#/$defs/int"
    },
    "holdMs": {
      "$ref": "./_defs.schema.json#/$defs/int"
    },
    "fadeOutMs": {
      "$ref": "./_defs.schema.json#/$defs/int"
    },
    "palette": {
      "type": "array",
      "items": {
        "$ref": "./_defs.schema.json#/$defs/rgba"
      }
    },
    "mode": {
      "type": "string",
      "enum": [
        "forward",
        "backward",
        "pendulum",
        "random"
      ]
    },
    "volume": {
      "type": "number",
      "minimum": 0,
      "maximum": 1
    },
    "loop": {
      "$ref": "./_defs.schema.json#/$defs/bool"
    },
    "samples": {
      "type": "array",
      "items": {
        "$ref": "./_defs.schema.json#/$defs/entity"
      }
    }
  },
  "required": [
    "source",
    "action"
  ]
}