[
    {
        "id": "7118a1ca3f938274",
        "type": "tab",
        "label": "Presencia BLE",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "69b41b82ede454c2",
        "type": "Beacon-Scanner",
        "z": "7118a1ca3f938274",
        "name": "Beacon Scanner",
        "gracePeriod": 1000,
        "x": 100,
        "y": 40,
        "wires": [
            [
                "f679438e984c7c6c"
            ]
        ]
    },
    {
        "id": "f679438e984c7c6c",
        "type": "function",
        "z": "7118a1ca3f938274",
        "name": "Filtrar solo los de mi llavero",
        "func": "if (msg.payload.iBeacon && msg.payload.iBeacon.major == 1 && msg.payload.iBeacon.minor == 2)\n    return msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 180,
        "y": 100,
        "wires": [
            [
                "69eb90d0d8fbe290",
                "fadce36adbe0a957"
            ]
        ]
    },
    {
        "id": "69eb90d0d8fbe290",
        "type": "template",
        "z": "7118a1ca3f938274",
        "name": "on",
        "field": "payload",
        "fieldType": "msg",
        "format": "handlebars",
        "syntax": "mustache",
        "template": "on",
        "output": "str",
        "x": 390,
        "y": 100,
        "wires": [
            [
                "5c8fba79d84e1881"
            ]
        ]
    },
    {
        "id": "fadce36adbe0a957",
        "type": "trigger",
        "z": "7118a1ca3f938274",
        "name": "off despues de 10 segundos",
        "op1": "",
        "op2": "off",
        "op1type": "nul",
        "op2type": "str",
        "duration": "10",
        "extend": true,
        "overrideDelay": false,
        "units": "s",
        "reset": "",
        "bytopic": "all",
        "topic": "topic",
        "outputs": 1,
        "x": 200,
        "y": 140,
        "wires": [
            [
                "5c8fba79d84e1881"
            ]
        ]
    },
    {
        "id": "69e42413b2828f0e",
        "type": "rbe",
        "z": "7118a1ca3f938274",
        "name": "Cambios",
        "func": "rbe",
        "gap": "",
        "start": "",
        "inout": "out",
        "septopics": true,
        "property": "payload",
        "topi": "topic",
        "x": 380,
        "y": 360,
        "wires": [
            [
                "3a7f504afd5e4314",
                "00ed9ebba6bf3a1e"
            ]
        ]
    },
    {
        "id": "3a7f504afd5e4314",
        "type": "debug",
        "z": "7118a1ca3f938274",
        "name": "debug 1",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 540,
        "y": 340,
        "wires": []
    },
    {
        "id": "00ed9ebba6bf3a1e",
        "type": "ewelink-power-state-write",
        "z": "7118a1ca3f938274",
        "name": "Luz Cubierta",
        "deviceId": "xxxxxxxxx",
        "channel": "2",
        "auth": "7e18f914b49f711c",
        "x": 550,
        "y": 400,
        "wires": [
            []
        ]
    },
    {
        "id": "8d7ff75649790b7f",
        "type": "nighttime",
        "z": "7118a1ca3f938274",
        "name": "Es de noche",
        "lon": "-3.8064",
        "lat": "43.427",
        "start": "sunriseEnd",
        "end": "sunset",
        "x": 70,
        "y": 200,
        "wires": [
            [],
            [
                "3615e39c161e789c"
            ]
        ]
    },
    {
        "id": "14d35541417c7a22",
        "type": "BooleanLogicUltimate",
        "z": "7118a1ca3f938274",
        "name": "se cumple todo",
        "payloadPropName": "payload",
        "filtertrue": "both",
        "persist": true,
        "sInitializeWith": "WaitForPayload",
        "triggertopic": "trigger",
        "outputtriggeredby": "all",
        "inputCount": 2,
        "topic": "result",
        "restrictinputevaluation": false,
        "delayEvaluation": 0,
        "x": 350,
        "y": 220,
        "wires": [
            [
                "f2e59042dd92a2f5"
            ],
            [],
            []
        ]
    },
    {
        "id": "3615e39c161e789c",
        "type": "change",
        "z": "7118a1ca3f938274",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "topic",
                "pt": "msg",
                "to": "Condicion2",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 130,
        "y": 260,
        "wires": [
            [
                "14d35541417c7a22"
            ]
        ]
    },
    {
        "id": "5c8fba79d84e1881",
        "type": "change",
        "z": "7118a1ca3f938274",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "topic",
                "pt": "msg",
                "to": "Condicion1",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 450,
        "y": 140,
        "wires": [
            [
                "14d35541417c7a22"
            ]
        ]
    },
    {
        "id": "f2e59042dd92a2f5",
        "type": "switch",
        "z": "7118a1ca3f938274",
        "name": "",
        "property": "payload",
        "propertyType": "msg",
        "rules": [
            {
                "t": "true"
            },
            {
                "t": "false"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 110,
        "y": 360,
        "wires": [
            [
                "090a45434d3506b3"
            ],
            [
                "177d0c2e02b958f2"
            ]
        ]
    },
    {
        "id": "090a45434d3506b3",
        "type": "template",
        "z": "7118a1ca3f938274",
        "name": "on",
        "field": "payload",
        "fieldType": "msg",
        "format": "handlebars",
        "syntax": "mustache",
        "template": "on",
        "output": "str",
        "x": 230,
        "y": 340,
        "wires": [
            [
                "69e42413b2828f0e"
            ]
        ]
    },
    {
        "id": "177d0c2e02b958f2",
        "type": "template",
        "z": "7118a1ca3f938274",
        "name": "off",
        "field": "payload",
        "fieldType": "msg",
        "format": "handlebars",
        "syntax": "mustache",
        "template": "off",
        "output": "str",
        "x": 230,
        "y": 380,
        "wires": [
            [
                "69e42413b2828f0e"
            ]
        ]
    },
    {
        "id": "7e18f914b49f711c",
        "type": "ewelink-credentials"
    }
]