[
    {
        "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": 640,
        "y": 380,
        "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": 800,
        "y": 360,
        "wires": []
    },
    {
        "id": "00ed9ebba6bf3a1e",
        "type": "ewelink-power-state-write",
        "z": "7118a1ca3f938274",
        "name": "Luz Cubierta",
        "deviceId": "xxxxxxxx",
        "channel": "2",
        "auth": "7e18f914b49f711c",
        "x": 810,
        "y": 420,
        "wires": [
            []
        ]
    },
    {
        "id": "8d7ff75649790b7f",
        "type": "nighttime",
        "z": "7118a1ca3f938274",
        "name": "Es de noche",
        "lon": "-3.8064",
        "lat": "43.427",
        "start": "sunriseEnd",
        "end": "sunset",
        "x": 90,
        "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": "3",
        "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"
            },
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "payload",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 140,
        "y": 260,
        "wires": [
            [
                "14d35541417c7a22"
            ]
        ]
    },
    {
        "id": "5c8fba79d84e1881",
        "type": "change",
        "z": "7118a1ca3f938274",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "topic",
                "pt": "msg",
                "to": "Condicion1",
                "tot": "str"
            },
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "payload",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 460,
        "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": 370,
        "y": 380,
        "wires": [
            [
                "090a45434d3506b3"
            ],
            [
                "177d0c2e02b958f2"
            ]
        ]
    },
    {
        "id": "090a45434d3506b3",
        "type": "template",
        "z": "7118a1ca3f938274",
        "name": "on",
        "field": "payload",
        "fieldType": "msg",
        "format": "handlebars",
        "syntax": "mustache",
        "template": "on",
        "output": "str",
        "x": 490,
        "y": 360,
        "wires": [
            [
                "69e42413b2828f0e"
            ]
        ]
    },
    {
        "id": "177d0c2e02b958f2",
        "type": "template",
        "z": "7118a1ca3f938274",
        "name": "off",
        "field": "payload",
        "fieldType": "msg",
        "format": "handlebars",
        "syntax": "mustache",
        "template": "off",
        "output": "str",
        "x": 490,
        "y": 400,
        "wires": [
            [
                "69e42413b2828f0e"
            ]
        ]
    },
    {
        "id": "f425ee5f5867a4fe",
        "type": "signalk-geofence",
        "z": "7118a1ca3f938274",
        "name": "En puerto",
        "mode": "sendAll",
        "context": "vessels.self",
        "period": 10000,
        "myposition": false,
        "lat": "43.42761333333333",
        "lon": "-3.8064333333333336",
        "distance": "50",
        "x": 80,
        "y": 340,
        "wires": [
            [
                "053eb908ee5d5de2"
            ],
            [
                "d1e4c7be6666831b"
            ],
            []
        ]
    },
    {
        "id": "053eb908ee5d5de2",
        "type": "change",
        "z": "7118a1ca3f938274",
        "name": "true",
        "rules": [
            {
                "t": "set",
                "p": "topic",
                "pt": "msg",
                "to": "Condicion3",
                "tot": "str"
            },
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "true",
                "tot": "bool"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 210,
        "y": 320,
        "wires": [
            [
                "14d35541417c7a22"
            ]
        ]
    },
    {
        "id": "d1e4c7be6666831b",
        "type": "change",
        "z": "7118a1ca3f938274",
        "name": "false",
        "rules": [
            {
                "t": "set",
                "p": "topic",
                "pt": "msg",
                "to": "Condicion3",
                "tot": "str"
            },
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "false",
                "tot": "bool"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 210,
        "y": 360,
        "wires": [
            [
                "14d35541417c7a22"
            ]
        ]
    },
    {
        "id": "7e18f914b49f711c",
        "type": "ewelink-credentials"
    }
]