{
  "type": "object",
  "properties": {
    "alias": {
      "type": "string"
    },
    "enabled": {
      "type": "boolean",
      "default": true
    },
    "expose_state": {
      "type": "boolean",
      "default": true
    },
    "conditions": {
      "type": "array",
      "items": {
        "nullable": true,
        "type": "string"
      }
    },
    "media": {
      "type": "object",
      "properties": {
        "camera_entity_id": {
          "type": "string"
        },
        "camera_delay": {
          "type": "integer"
        },
        "camera_ptz_preset": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0
            },
            {
              "type": "string"
            }
          ]
        },
        "clip_url": {
          "type": "string"
        },
        "snapshot_url": {
          "type": "string"
        },
        "snapshot_image_path": {
          "type": "string"
        },
        "jpeg_opts": {
          "type": "object",
          "additionalProperties": true
        },
        "png_opts": {
          "type": "object",
          "additionalProperties": true
        }
      },
      "additionalProperties": false
    },
    "action_groups": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "default": []
    },
    "delivery_selection": {
      "type": "string"
    },
    "delivery": {
      "type": "object",
      "additionalProperties": {
        "type": "object",
        "properties": {
          "target": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "entity_id": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "device_id": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "area_id": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "floor_id": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "label_id": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "email": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "phone": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "mobile_app_id": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "person_id": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "additionalProperties": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              },
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ]
          },
          "enabled": {
            "type": "boolean",
            "nullable": true
          },
          "data": {
            "type": "object",
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                },
                {
                  "type": "boolean"
                },
                {
                  "type": "number"
                },
                {
                  "type": "object",
                  "additionalProperties": true
                },
                {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                {
                  "type": "object",
                  "nullable": true,
                  "description": "Must be null"
                }
              ]
            }
          }
        },
        "additionalProperties": false,
        "nullable": true
      },
      "default": {}
    }
  },
  "additionalProperties": false,
  "title": "Scenario Definition",
  "$id": "https://supernotify.rhizomatics.org.uk/developer/schemas/json/Scenario_Definition.schema.json",
  "description": "Voluptuous validation schema for Scenario_Definition",
  "$schema": "https://json-schema.org/draft/2020-12/schema"
}