Schemas

Hub

A local hub and its bridged accessory inventory.

https://hometruth.ai/schemas/hub · Hub

Instances

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://hometruth.ai/schemas/hub",
  "title": "Hub",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 100
    },
    "actions": {
      "type": "object",
      "additionalProperties": false
    },
    "state": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "availability": {
          "enum": [
            "online",
            "offline",
            "degraded",
            "unknown"
          ]
        },
        "detail": {
          "type": "string",
          "maxLength": 500
        },
        "observedAt": {
          "type": "string",
          "format": "date-time"
        },
        "securityState": {
          "enum": [
            "stay",
            "away",
            "night",
            "disarmed",
            "triggered"
          ]
        },
        "accessories": {
          "type": "array",
          "maxItems": 200,
          "items": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1,
                "maxLength": 100
              },
              "name": {
                "type": "string"
              },
              "model": {
                "type": "string"
              },
              "serialNumber": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name"
            ]
          }
        }
      },
      "required": [
        "availability"
      ],
      "dependentRequired": {
        "accessories": [
          "observedAt"
        ],
        "securityState": [
          "observedAt"
        ]
      }
    }
  },
  "required": [
    "id",
    "state",
    "actions"
  ]
}