Configuration Schemas

Every device connected to Xyte's cloud has a respective twin configuration file. This file, in JSON format, is essentially a virtual representation of the device in the cloud, and the versions on the physical device and the cloud server are automatically synced.

To make it easier for customers to update these configuration files and ensure that the cloud versions align with the format expected by the devices, Xyte leverages JSON Schema. A JSON schema specifies a set of format constraints that determine the structure of the JSON configuration file.

📘

Schema Structure

Xyte supports JSON Schema up to version 6.

While the configuration files themselves are unique for each instance of a device, the JSON schemas are set per device model and hence affect all instances of that model.

Resources

📘

Schema Structure

Note that due to Xyte's UI, all JSON properties must be encapsulated within an object; they cannot reside in the root object of the schema.

Examples

{
        "definitions": {},
        "properties": {
            "occupancyProperties": {
                "$id": "#/properties/occupancyProperties",
                "type": "object",
                "title": "Occupancy Sensor Settings",
                "required": [
                    "timeout",
                    "whenVacatedMode"
                ],
                "properties": {
                    "timeout": {
                        "$id": "#/properties/occupancyProperties/properties/timeout",
                        "type": "integer",
                        "title": "Sensor's timeout in seconds",
                        "readOnly": false,
                        "minimum": 5,
                        "maximum": 1800
                    },
                    "whenVacatedMode": {
                        "$id": "#/properties/occupancyProperties/properties/whenVacatedMode",
                        "type": "string",
                        "title": "Sensor's on vacation mode",
                        "decription": "<add desc>",
                        "readOnly": false,
                        "enum":[
                            "Or",
                            "And"
                        ]
                    }
                }
            }
        }
    }
{
    "properties": {
        "deviceInfo": {
            "$id": "#/properties/deviceInfo",
            "type": "object",
            "title": "Device Information",
            "properties": {
                "model": {
                    "$id": "#/properties/generalProperties/properties/model",
                    "type": [
                        "string",
                        "null"
                    ],
                    "title": "Model",
                    "readOnly": true
                }
            }
        },
        "generalProperties": {
            "$id": "#/properties/generalProperties",
            "type": "object",
            "title": "General Properties",
            "description": "General properties",
            "required": [],
            "properties": {
                "fwVersion": {
                    "$id": "#/properties/generalProperties/properties/fwVersion",
                    "type": ["string","null"],
                    "title": "Firmware Version",
                    "readOnly": true
                },
                "programIDTag": {
                    "$id": "#/properties/generalProperties/properties/programIDTag",
                    "type": ["string","null"],
                    "title": "Program ID Tag",
                    "readOnly": true
                }
            }
        },
        "networkProperties": {
            "$id": "#/properties/networkProperties",
            "type": "object",
            "title": "Network Properties",
            "description": "Network properties",
            "required": [],
            "properties": {
                "macAddress": {
                    "$id": "#/properties/networkProperties/properties/macAddress",
                    "type": ["string","null"],
                    "title": "MAC Address",
                    "readOnly": true
                },
                "dhcp": {
                    "$id": "#/properties/networkProperties/properties/dhcp",
                    "type": "boolean",
                    "title": "DHCP",
                    "default": true
                },
                "staticIpAddress": {
                    "$id": "#/properties/networkProperties/properties/staticIpAddress",
                    "type": ["string","null"],
                    "format": "ipv4",
                    "title": "IP Address",
                    "description": "IP address"
                },
                "staticNetMask": {
                    "$id": "#/properties/networkProperties/properties/staticNetMask",
                    "type": ["string","null"],
                    "format": "ipv4",
                    "title": "Mask Address",
                    "description": "Mask address"
                },
                "staticDefRouter": {
                    "$id": "#/properties/networkProperties/properties/staticDefRouter",
                    "type": ["string","null"],
                    "format": "ipv4",
                    "title": "Default Gateway",
                    "description": "Default gateway"
                },
                "hostname": {
                    "$id": "#/properties/networkProperties/properties/hostname",
                    "type": ["string","null"],
                    "format": "hostname",
                    "title": "Hostname",
                    "description": "Hostname"
                },
                "domainName": {
                    "$id": "#/properties/networkProperties/properties/domainName",
                    "type": ["string","null"],
                    "title": "Domain Name",
                    "description": "Domain name"
                },
                "dnsServers": {
                    "$id": "#/properties/networkProperties/properties/dnsServers",
                    "type": "array",
                    "title": "DNS Servers",
                    "minItems": 0,
                    "maxItems": 3,
                    "description": "DNS servers",
                    "items": {
                        "type": ["string","null"]
                    }
                }
            },
            "dependencies": {
                "dhcp": {
                    "oneOf": [
                        {
                            "properties": {
                                "dhcp": {
                                    "enum": [
                                        true
                                    ]
                                },
                                "staticIpAddress": {
                                    "readOnly": true
                                },
                                "staticNetMask": {
                                    "readOnly": true
                                },
                                "staticDefRouter": {
                                    "readOnly": true
                                },
                                "dnsServers": {
                                    "maxItems":0,
                                    "readOnly": true
                                }
                            }
                        },
                        {
                            "properties": {
                                "dhcp": {
                                    "enum": [
                                        false
                                    ]
                                },
                                "staticIpAddress": {
                                    "readOnly": false
                                },
                                "staticNetMask": {
                                    "readOnly": false
                                },
                                "staticDefRouter": {
                                    "readOnly": false
                                },
                                "dnsServers": {
                                    "maxItems":3,
                                    "readOnly": false
                                }
                            }
                        }
                    ]
                }
            }
        },
        "edgeProperties":{
            "$id": "#/properties/edgeProperties",
            "type": "object",
            "title": "Edge Properties",
            "properties": {
                "globalScan": {
                    "$id": "#/properties/edgeProperties/properties/globalScan",
                    "type": "boolean",
                    "title": "Discover All",
                    "description":"Check \"Discover All\" to auto-discover all Crestron Ethernet devices on the same LAN",
                    "default": false,
                    "readOnly": false
                }
            }
        }
    },
    "definitions": {}
}

VS Code is a great tool that you can use to easily edit a JSON schema and test it in real time. See this short tutorial for tips on how to do so: