{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/airthings/json-schema/airthings-sensors-threshold-response-schema.json",
  "title": "SensorsThresholdResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/airthings-thresholds-api-openapi.yml#/components/schemas/SensorsThresholdResponse",
  "type": "object",
  "properties": {
    "thresholds": {
      "additionalProperties": {
        "$ref": "#/$defs/SensorThreshold"
      },
      "type": "object"
    }
  },
  "required": [
    "thresholds"
  ],
  "$defs": {
    "SensorRangeRating": {
      "type": "string",
      "enum": [
        "POOR",
        "FAIR",
        "GOOD"
      ]
    },
    "SensorThreshold": {
      "type": "object",
      "properties": {
        "ranges": {
          "items": {
            "$ref": "#/$defs/ThresholdRange"
          },
          "type": "array"
        },
        "type": {
          "$ref": "#/$defs/SensorType"
        },
        "unit": {
          "$ref": "#/$defs/SensorUnit"
        }
      },
      "required": [
        "ranges",
        "type",
        "unit"
      ]
    },
    "SensorType": {
      "type": "string",
      "enum": [
        "radonShortTermAvg",
        "radonLongTermAvg",
        "hctsbk",
        "hctsrn222l",
        "hctsrn222h",
        "hctssa",
        "hctspo21xl",
        "hctspo21xh",
        "hctscomparator",
        "hctsprocessed",
        "temp",
        "outdoorTemp",
        "humidity",
        "outdoorHumidity",
        "co2",
        "voc",
        "pressure",
        "outdoorPressure",
        "pressureDifference",
        "light",
        "lux",
        "batteryPercentage",
        "batteryVoltage",
        "orientation",
        "pm1",
        "pm25",
        "pm10",
        "mold",
        "staleAir",
        "transmissionEfficiency",
        "virusSurvivalRate",
        "virusRisk",
        "windSpeed",
        "windDirection",
        "windGust",
        "dewPoint",
        "cloudCover",
        "visibility",
        "precipitation_probability",
        "total_precipitation",
        "outdoorWeather",
        "hourlyRadonStandardDeviation",
        "hourlyRadon",
        "historicVentilationConfidence",
        "daytimeBaseline",
        "daytimePeak",
        "nightBaseline",
        "historicVentilation",
        "ventilationRunningConfidence",
        "occupantsUpper",
        "occupantsLower",
        "presence",
        "occupants",
        "relativeOccupants",
        "ventilationAmount",
        "historicVentilationRunning",
        "ventilationRunning",
        "ventilationAmountRelative",
        "airExchangeRateUpper",
        "airExchangeRateLower",
        "airExchangeRate",
        "sla",
        "bacnet"
      ]
    },
    "SensorUnit": {
      "type": "string",
      "enum": [
        "COUNT",
        "CELSIUS",
        "FAHRENHEIT",
        "MILLIBAR",
        "PASCAL",
        "HECTOPASCAL",
        "INCHES_OF_MERCURY",
        "BECQUEREL",
        "PICOCURIE",
        "PERCENT",
        "VOLT",
        "MILLIVOLT",
        "PARTS_PER_MILLION",
        "PARTS_PER_BILLION",
        "ANGLE",
        "MICRO_GRAM_PER_CUBIC",
        "METERS",
        "KILOMETERS",
        "KILOMETERS_PER_HOUR",
        "KILOWATTS",
        "MILES_PER_HOUR",
        "RISK_INDEX",
        "SOUND_PRESSURE",
        "WEATHER_CODE",
        "CUBIC_METER_PER_HOUR",
        "CONFIDENCE",
        "VENTILATION_STATE",
        "SECONDS",
        "MINUTES",
        "INFO",
        "MILLIMETERS",
        "DECIBEL_MILLIWATTS",
        "OCCUPANTS",
        "AIR_CHANGES_PER_HOUR",
        "LUX",
        "CUBIC_FEET_PER_MINUTE",
        "FEET"
      ]
    },
    "ThresholdRange": {
      "type": "object",
      "properties": {
        "from": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "type": "number",
              "format": "int32"
            }
          ]
        },
        "rating": {
          "$ref": "#/$defs/SensorRangeRating"
        },
        "to": {
          "oneOf": [
            {
              "type": "null"
            },
            {
              "type": "number",
              "format": "int32"
            }
          ]
        }
      },
      "required": [
        "rating"
      ]
    }
  }
}