{
    "templates": [
        {
            "description": "Notify me when a device runs out of battery",
            "ruleNameTemplate": "Low battery alert for %0",
            "stateEvaluatorTemplate": {
                "stateDescriptorTemplate": {
                    "interfaceName": "battery",
                    "interfaceState": "batteryCritical",
                    "operator": "ValueOperatorEquals",
                    "value": true,
                    "selectionId": 0
                }
            },
            "ruleActionTemplates": [
                {
                    "interfaceName": "notifications",
                    "interfaceAction": "notify",
                    "selectionId": 1,
                    "selectionMode": "SelectionModeDevice",
                    "params": [
                        {
                            "name": "title",
                            "value": "Low battery alert"
                        },
                        {
                            "name": "body",
                            "value": "%0 runs out of battery"
                        },
                        {
                            "name": "data",
                            "value": "open=$0"
                        }
                    ]
                }
            ]
        },
        {
            "description": "Notify me when something dries out",
            "ruleNameTemplate": "Notify %1 when %0 dries out",
            "stateEvaluatorTemplate": {
                "stateDescriptorTemplate": {
                    "interfaceName": "moisturesensor",
                    "interfaceState": "moisture",
                    "operator": "ValueOperatorLess",
                    "selectionMode": "SelectionModeDevice",
                    "selectionId": 0,
                    "value": 20
                }
            },
            "ruleActionTemplates": [
                {
                    "interfaceName": "notifications",
                    "interfaceAction": "notify",
                    "selectionId": 1,
                    "selectionMode": "SelectionModeDevice",
                    "params": [
                        {
                            "name": "title",
                            "value": "Water alert"
                        },
                        {
                            "name": "body",
                            "value": "%0 runs dry"
                        },
                        {
                            "name": "data",
                            "value": "open=$0"
                        }
                    ]
                }
            ]
        },
        {
            "description": "Notify me when a thing gets disconnected",
            "ruleNameTemplate": "Disconnect alert for %0",
            "stateEvaluatorTemplate": {
                "stateDescriptorTemplate": {
                    "interfaceName": "connectable",
                    "interfaceState": "connected",
                    "selectionId": 0,
                    "selectionMode": "SelectionModeDevice",
                    "operator": "ValueOperatorEquals",
                    "value": false
                }
            },
            "ruleActionTemplates": [
                {
                    "interfaceName": "notifications",
                    "interfaceAction": "notify",
                    "selectionId": 1,
                    "selectionMode": "SelectionModeDevice",
                    "params": [
                        {
                            "name": "title",
                            "value": "Disconnect alert"
                        },
                        {
                            "name": "body",
                            "value": "%0 has disconnected"
                        },
                        {
                            "name": "data",
                            "value": "open=$0"
                        }
                    ]
                }
            ]
        },
        {
            "description": "Notify me when a thing connects",
            "ruleNameTemplate": "Connection notification for %0",
            "stateEvaluatorTemplate": {
                "stateDescriptorTemplate": {
                    "interfaceName": "connectable",
                    "interfaceState": "connected",
                    "selectionId": 0,
                    "selectionMode": "SelectionModeDevice",
                    "operator": "ValueOperatorEquals",
                    "value": true
                }
            },
            "ruleActionTemplates": [
                {
                    "interfaceName": "notifications",
                    "interfaceAction": "notify",
                    "selectionId": 1,
                    "selectionMode": "SelectionModeDevice",
                    "params": [
                        {
                            "name": "title",
                            "value": "Thing connected"
                        },
                        {
                            "name": "body",
                            "value": "%0 has connected"
                        },
                        {
                            "name": "data",
                            "value": "open=$0"
                        }
                    ]
                }
            ]
        }
    ]
}
