{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "description": "Fibaro Home Center RGB Controller JSON Schema",
    "name": "rgb_driver",
    "type": "object",
    "properties": {
        "id": {
            "description": "Fibaro Home Center device ID",
            "type": "integer",
            "minimum": 2
        },
        "name": {
            "description": "Device name",
            "type": "string",
            "maxLength": 20
        },
        "roomID": {
            "description": "Room ID defined in Home Center GUI",
            "type": "integer",
            "minimum": 0
        },
        "type": {
            "description": "Zwave device type",
            "enum": [
                "rgb_driver"
            ]
        },
        "remoteGatewayId": {
            "description": "Remote Gateway ID",
            "type": "integer",
            "minimum": 0
        },
        "remoteDeviceID": {
            "description": "Remote Device ID",
            "type": "integer",
            "minimum": 0
        },
        "properties": {
            "type": "object",
            "properties": {
                "UIMessageSendTime": {
                    "type": "string"
                },
                "associationMode": {
                    "type": "string"
                },
                "bScaler": {
                    "type": "string"
                },
                "buttonType": {
                    "type": "string"
                },
                "classConfigure": {
                    "type": "string"
                },
                "classGeneric": {
                    "type": "string"
                },
                "classSupport": {
                    "type": "string"
                },
                "classVersion": {
                    "type": "string"
                },
                "color": {
                    "type": "string"
                },
                "currentProgram": {
                    "type": "string"
                },
                "currentProgramID": {
                    "type": "string"
                },
                "dead": {
                    "type": "string"
                },
                "deviceControlType": {
                    "type": "string"
                },
                "deviceIcon": {
                    "type": "string"
                },
                "disabled": {
                    "type": "string"
                },
                "emailNotificationID": {
                    "type": "string"
                },
                "emailNotificationType": {
                    "type": "string"
                },
                "endPoint": {
                    "type": "string"
                },
                "favoriteProgram": {
                    "type": "string"
                },
                "gScaler": {
                    "type": "string"
                },
                "isBatteryOperated": {
                    "enum": [
                        "0",
                        "1"
                    ]
                },
                "isLight": {
                    "enum": [
                        "0",
                        "1"
                    ]
                },
                "lastColorSet": {
                    "type": "string"
                },
                "lastUsedPrograms": {
                    "type": "string"
                },
                "liliOffCommand": {
                    "type": "string"
                },
                "liliOnCommand": {
                    "type": "string"
                },
                "log": {
                    "type": "string"
                },
                "logTemp": {
                    "type": "string"
                },
                "meterSupport": {
                    "type": "string"
                },
                "mode": {
                    "type": "string"
                },
                "needConfigure": {
                    "type": "string"
                },
                "nodeID": {
                    "type": "string"
                },
                "parametersTemplate": {
                    "type": "string"
                },
                "parentID": {
                    "type": "string"
                },
                "pollingRetryError": {
                    "type": "string"
                },
                "pollingTime": {
                    "type": "string"
                },
                "pollingTimeNext": {
                    "type": "string"
                },
                "pollingTimeSec": {
                    "type": "string"
                },
                "productInfo": {
                    "type": "string"
                },
                "programsSortOrder": {
                    "type": "string"
                },
                "pushNotificationID": {
                    "type": "string"
                },
                "pushNotificationType": {
                    "type": "string"
                },
                "rScaler": {
                    "type": "string"
                },
                "rememberColor": {
                    "type": "string"
                },
                "requestNodeNeighborState": {
                    "type": "string"
                },
                "requestNodeNeighborStateTimeStemp": {
                    "type": "string"
                },
                "saveLogs": {
                    "enum": [
                        "0",
                        "1"
                    ]
                },
                "sensorSupport": {
                    "type": "string"
                },
                "showChildren": {
                    "enum": [
                        "0",
                        "1"
                    ]
                },
                "showEnergy": {
                    "enum": [
                        "0",
                        "1"
                    ]
                },
                "smsNotificationID": {
                    "type": "string"
                },
                "smsNotificationType": {
                    "type": "string"
                },
                "sortOrder": {
                    "type": "string"
                },
                "unit": {
                    "type": "string"
                },
                "unitMeter": {
                    "type": "string"
                },
                "unitSensor": {
                    "type": "string"
                },
                "useTemplate": {
                    "enum": [
                        "0",
                        "1"
                    ]
                },
                "userDescription": {
                    "type": "string"
                },
                "value": {
                    "type": "string"
                },
                "valueMeter": {
                    "type": "string"
                },
                "valueSensor": {
                    "type": "string"
                },
                "zwaveCompany": {
                    "type": "string"
                },
                "zwaveInfo": {
                    "type": "string"
                },
                "zwaveVersion": {
                    "type": "string"
                },
                "parameters": {
                    "type": "array",
                    "minItems": 0,
                    "items": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "number"
                            },
                            "size": {
                                "type": "number"
                            },
                            "value": {
                                "type": "number"
                            },
                            "lastSetValue": {
                                "type": "number"
                            }
                        }
                    },
                    "_uniqueItems": false
                },
                "associationView": {
                    "type": "array",
                    "minItems": 0,
                    "maxItems": 5,
                    "items": {
                        "$ref": "#/definitions/associationItem"
                    }
                },
                "associationSet": {
                    "type": "array",
                    "minItems": 0,
                    "maxItems": 5,
                    "items": {
                        "$ref": "#/definitions/associationItem"
                    }
                }
            },
            "required": [
                "UIMessageSendTime",
                "associationMode",
                "bScaler",
                "buttonType",
                "classConfigure",
                "classGeneric",
                "classSupport",
                "classVersion",
                "color",
                "currentProgram",
                "currentProgramID",
                "dead",
                "deviceControlType",
                "deviceIcon",
                "disabled",
                "emailNotificationID",
                "emailNotificationType",
                "endPoint",
                "favoriteProgram",
                "gScaler",
                "isBatteryOperated",
                "log",
                "logTemp",
                "meterSupport",
                "mode",
                "needConfigure",
                "parametersTemplate",
                "parentID",
                "pollingRetryError",
                "pollingTime",
                "pollingTimeNext",
                "pollingTimeSec",
                "productInfo",
                "programsSortOrder",
                "pushNotificationID",
                "pushNotificationType",
                "rScaler",
                "rememberColor",
                "requestNodeNeighborState",
                "requestNodeNeighborStateTimeStemp",
                "saveLogs",
                "sensorSupport",
                "showChildren",
                "showEnergy",
                "smsNotificationID",
                "smsNotificationType",
                "sortOrder",
                "unit",
                "unitMeter",
                "unitSensor",
                "useTemplate",
                "userDescription",
                "value",
                "valueMeter",
                "valueSensor",
                "zwaveCompany",
                "zwaveInfo",
                "zwaveVersion"
            ],
            "additionalProperties": false
        },
        "actions": {
            "type": "object",
            "properties": {
                "firmwareUpdate": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1
                },
                "pollingTimeSec": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1
                },
                "requestNodeNeighborUpdate": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 0
                },
                "resetMeter": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 0
                },
                "setB": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1
                },
                "setColor": {
                    "type": "integer",
                    "minimum": 4,
                    "maximum": 4
                },
                "setG": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1
                },
                "setR": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1
                },
                "setValue": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1
                },
                "setW": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1
                },
                "silentSetColor": {
                    "type": "integer",
                    "minimum": 4,
                    "maximum": 4
                },
                "startProgram": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 1
                },
                "turnOff": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 0
                },
                "turnOn": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 0
                }
            },
            "required": [
                "firmwareUpdate",
                "pollingTimeSec",
                "requestNodeNeighborUpdate",
                "resetMeter",
                "setB",
                "setColor",
                "setG",
                "setR",
                "setValue",
                "setW",
                "startProgram",
                "turnOff",
                "turnOn"
            ],
            "additionalProperties": false
        },
        "created": {
            "type": "number"
        },
        "modified": {
            "type": "number"
        },
        "sortOrder": {
            "type": "number"
        }
    },
    "definitions": {
        "associationItem": {
            "properties": {
                "groupID": {
                    "type": "number"
                },
                "devices": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 254,
                    "items": {
                        "type": "number",
                        "minimum": 1,
                        "maximum": 254
                    }
                }
            }
        }
    },
    "additionalProperties": false
}