{
    "templates": [
        {
            "description": "Turn on lights",
            "ruleNameTemplate": "%0 turns on %1",
            "eventDescriptorTemplates": [
                {
                    "interfaceName": "button",
                    "interfaceEvent": "pressed",
                    "selectionId": 0
                }
            ],
            "ruleActionTemplates": [
                {
                    "interfaceName": "light",
                    "interfaceAction": "power",
                    "selectionId": 1,
                    "selectionMode": "SelectionModeDevices",
                    "params": [
                        {
                            "name": "power",
                            "value": true
                        }
                    ]
                }
            ]
        },
        {
            "description": "Turn off lights",
            "ruleNameTemplate": "%0 turns off %1",
            "eventDescriptorTemplates": [
                {
                    "interfaceName": "button",
                    "interfaceEvent": "pressed",
                    "selectionId": 0
                }
            ],
            "ruleActionTemplates": [
                {
                    "interfaceName": "light",
                    "interfaceAction": "power",
                    "selectionId": 1,
                    "selectionMode": "SelectionModeDevices",
                    "params": [
                        {
                            "name": "power",
                            "value": false
                        }
                    ]
                }
            ]
        },
        {
            "description": "Switch a light",
            "ruleNameTemplate": "%0 switches %1",
            "eventDescriptorTemplates": [
                {
                    "interfaceName": "button",
                    "interfaceEvent": "pressed",
                    "selectionId": 0
                }
            ],
            "stateEvaluatorTemplate": {
                "stateDescriptorTemplate": {
                    "interfaceName": "light",
                    "interfaceState": "power",
                    "operator": "ValueOperatorEquals",
                    "value": false,
                    "selectionId": 1,
                    "selectionMode": "SelectionModeDevice"
                }
            },
            "ruleActionTemplates": [
                {
                    "interfaceName": "light",
                    "interfaceAction": "power",
                    "selectionId": 1,
                    "selectionMode": "SelectionModeDevice",
                    "params": [
                        {
                            "name": "power",
                            "value": true
                        }
                    ]
                }
            ],
            "ruleExitActionTemplates": [
                {
                    "interfaceName": "light",
                    "interfaceAction": "power",
                    "selectionId": 1,
                    "selectionMode": "SelectionModeDevice",
                    "params": [
                        {
                            "name": "power",
                            "value": false
                        }
                    ]
                }
            ]
        },
        {
            "description": "Turn off all lights",
            "ruleNameTemplate": "Turn off everything with %0",
            "eventDescriptorTemplates": [
                {
                    "interfaceName": "button",
                    "interfaceEvent": "pressed",
                    "selectionId": 0,
                    "selectionMode": "SelectionModeDevice"
                }
            ],
            "ruleActionTemplates": [
                {
                    "interfaceName": "light",
                    "interfaceAction": "power",
                    "selectionId": 1,
                    "selectionMode": "SelectionModeInterface",
                    "params": [
                        {
                            "name": "power",
                            "value": false
                        }
                    ]
                }
            ]
        }
    ]
}

