{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/chirpwireless-io/json-schema/chirpwireless-io-command-schema.json",
  "title": "Command",
  "description": "A command definition stored under a digital device.",
  "x-generated": "2026-11-03",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/chirpwireless-io-openapi.yml#/components/schemas/Command",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "mode": {
      "type": "string",
      "enum": [
        "direct",
        "encoded"
      ]
    },
    "paramsSchema": {
      "type": "object",
      "description": "Per-parameter JSON Schema subset, keyed by parameter name.",
      "additionalProperties": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "string",
              "integer",
              "number",
              "boolean"
            ]
          },
          "default": {},
          "description": {
            "type": "string"
          },
          "min": {
            "type": "number"
          },
          "max": {
            "type": "number"
          },
          "enum": {
            "type": "array",
            "items": {}
          },
          "pattern": {
            "type": "string"
          }
        }
      }
    },
    "encodedParamsTemplate": {
      "type": "object"
    },
    "directPayload": {
      "type": "string"
    },
    "customEncoder": {
      "type": "string"
    },
    "fPort": {
      "type": "integer"
    },
    "mqttTopic": {
      "type": "string"
    },
    "confirmed": {
      "type": "boolean"
    },
    "verificationStrategy": {
      "type": "string",
      "enum": [
        "no_verification",
        "wait_next_uplink",
        "query_after_ack"
      ]
    },
    "queryCommandId": {
      "type": "string"
    },
    "expectedSensorStates": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "sensorId": {
            "type": "string"
          },
          "valueTemplate": {
            "type": "string"
          }
        }
      }
    },
    "convergenceTimeout": {
      "type": "integer"
    },
    "suitableAsQuery": {
      "type": "boolean"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    }
  }
}