{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "description": "Fibaro Home Center Scene JSON Schema",
    "name": "scene",
    "type": "object",
    "properties": {
        "id": {
            "description": "Identifier for the scene",
            "type": "integer",
            "minimum": 0
        },
        "name": {
            "description": "Name for the scene",
            "type": "string",
            "maxLength": 20
        },
        "roomID": {
            "description": "Identifier for room belongs to",
            "type": "integer",
            "minimum": 0
        },
        "iconID": {
            "description": "Icon name defined",
            "type": "integer",
            "minimum": 0
        },
        "enabled": {
            "description": "Scene enabled flag",
            "type": "boolean"
        },
        "autostart": {
            "description": "Autostart flag",
            "type": "boolean"
        },
        "protectedByPIN": {
            "description": "Scene protected by PIN flag",
            "type": "boolean"
        },
        "killable": {
            "description": "Is scene killable flag",
            "type": "boolean"
        },
        "runningInstances": {
            "description": "Number of running instances of the scene",
            "type": "integer",
            "minimum": 0
        },
        "visible": {
            "description": "Is scene visible flag",
            "type": "boolean"
        },
        "isLua": {
            "description": "Is scene written in LUA",
            "type": "boolean"
        },
        "lua": {
            "description": "LUA code",
            "type": "string"
        },
        "html": {
            "description": "Html code",
            "type": "string"
        },
        "liliStartCommand": {
            "description": "Lili start command",
            "type": "string"
        },
        "liliStopCommand": {
            "description": "Lili stop command",
            "type": "string"
        },
        "triggers": {
            "description": "Scene triggers",
            "type": "object",
            "properties": {
                "properties": {
                    "description": "List of properities triggering the scene",
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "description": "Identifier for the device",
                                "type": "integer",
                                "minimum": 0
                            },
                            "name": {
                                "description": "Identifier for the device's property",
                                "type": "string"
                            }
                        }
                    }
                },
                "globals": {
                    "description": "List of variables triggering the scene",
                    "type": "array",
                    "items": {
                        "description": "Variable name",
                        "type": "string"
                    }
                }
            }
        },
        "sortOrder": {
            "description": "Sort order when displayed in GUI",
            "type": "integer",
            "minimum": 0
        }
    },
    "required": [
        "name"
    ],
    "additionalProperties": false
}