[
    {
        "id": "a8abf135.4e74b",
        "type": "tab",
        "label": "Application",
        "disabled": false,
        "info": ""
    },
    {
        "id": "8de82c2.be3f4d",
        "type": "tab",
        "label": "System",
        "disabled": false,
        "info": ""
    },
    {
        "id": "aca520bf.85326",
        "type": "chatbot-telegram-node",
        "botname": "TotemZiMariaBot",
        "usernames": "",
        "polling": "1000",
        "store": "",
        "log": "",
        "debug": false,
        "skipMediaFiles": false,
        "webHook": "",
        "connectMode": "polling",
        "storeMessages": false,
        "enableMissionControl": false,
        "inspectMessages": false,
        "chatbotId": ""
    },
    {
        "id": "3b32c901.680796",
        "type": "chatbot-telegram-receive",
        "z": "a8abf135.4e74b",
        "bot": "aca520bf.85326",
        "botProduction": "",
        "x": 150,
        "y": 200,
        "wires": [
            [
                "5afcce3f.dbeea",
                "bcb23459bb66673c"
            ]
        ]
    },
    {
        "id": "ad4374d0.3cf8c8",
        "type": "file",
        "z": "a8abf135.4e74b",
        "name": "",
        "filename": "",
        "appendNewline": true,
        "createDir": false,
        "overwriteFile": "true",
        "encoding": "none",
        "x": 620,
        "y": 180,
        "wires": [
            [
                "83cc6d82bd432210"
            ]
        ]
    },
    {
        "id": "5afcce3f.dbeea",
        "type": "function",
        "z": "a8abf135.4e74b",
        "name": "Is a video ?",
        "func": "if (msg.payload.type===\"video\" || msg.payload.type===\"document\") {\n    msg.filename=\"/home/pi/video.mp4\";\n    msg.payload=msg.payload.content;\n    return msg;\n}\n",
        "outputs": 1,
        "noerr": 0,
        "x": 470,
        "y": 180,
        "wires": [
            [
                "ad4374d0.3cf8c8"
            ]
        ]
    },
    {
        "id": "978cf380.ced0b",
        "type": "debug",
        "z": "a8abf135.4e74b",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "x": 470,
        "y": 120,
        "wires": []
    },
    {
        "id": "61ae74ae.6f70dc",
        "type": "exec",
        "z": "a8abf135.4e74b",
        "command": "/usr/bin/omxplayer --loop video.mp4",
        "addpay": false,
        "append": "",
        "useSpawn": "false",
        "timer": "",
        "winHide": false,
        "oldrc": false,
        "name": "",
        "x": 1090,
        "y": 180,
        "wires": [
            [],
            [],
            []
        ]
    },
    {
        "id": "c50f8d3c.8c7b",
        "type": "chatbot-telegram-send",
        "z": "a8abf135.4e74b",
        "bot": "aca520bf.85326",
        "botProduction": "",
        "track": false,
        "passThrough": false,
        "outputs": 0,
        "x": 780,
        "y": 320,
        "wires": []
    },
    {
        "id": "e2440ff.8b366f",
        "type": "chatbot-message",
        "z": "a8abf135.4e74b",
        "name": "",
        "message": [
            {
                "message": "Benvenuto nello Zi Maria Totem Bot. Invia un video."
            }
        ],
        "x": 550,
        "y": 320,
        "wires": [
            [
                "c50f8d3c.8c7b"
            ]
        ]
    },
    {
        "id": "281d3de5.702aa2",
        "type": "debug",
        "z": "a8abf135.4e74b",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "x": 430,
        "y": 580,
        "wires": []
    },
    {
        "id": "b9368f55.09f5b",
        "type": "function",
        "z": "a8abf135.4e74b",
        "name": "Inizio",
        "func": "if (msg.action===\"down\" && msg.payload===102) {\n    return msg;\n}    ",
        "outputs": 1,
        "timeout": "",
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 390,
        "y": 640,
        "wires": [
            [
                "4e7e675626e6b1ff"
            ]
        ]
    },
    {
        "id": "722b662a.5123f8",
        "type": "exec",
        "z": "a8abf135.4e74b",
        "command": "sudo pkill omxplayer",
        "addpay": false,
        "append": "",
        "useSpawn": "false",
        "timer": "",
        "winHide": false,
        "oldrc": false,
        "name": "",
        "x": 600,
        "y": 720,
        "wires": [
            [],
            [],
            []
        ]
    },
    {
        "id": "26283b33.8ce7b4",
        "type": "function",
        "z": "a8abf135.4e74b",
        "name": "Fine",
        "func": "if (msg.action===\"down\" && msg.payload===107) {\n    return msg;\n}    ",
        "outputs": 1,
        "timeout": "",
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 390,
        "y": 720,
        "wires": [
            [
                "722b662a.5123f8"
            ]
        ]
    },
    {
        "id": "6ec5717d.24e",
        "type": "inject",
        "z": "a8abf135.4e74b",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": "1",
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 810,
        "y": 240,
        "wires": [
            [
                "61ae74ae.6f70dc"
            ]
        ]
    },
    {
        "id": "bcb23459bb66673c",
        "type": "function",
        "z": "a8abf135.4e74b",
        "name": "/start",
        "func": "if (msg.payload==\"/start\") {\n    return msg;\n}\n",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 370,
        "y": 300,
        "wires": [
            [
                "e2440ff.8b366f"
            ]
        ]
    },
    {
        "id": "ca0c2169f5f46d8a",
        "type": "rpi-keyboard",
        "z": "a8abf135.4e74b",
        "name": "",
        "x": 150,
        "y": 680,
        "wires": [
            [
                "b9368f55.09f5b",
                "26283b33.8ce7b4"
            ]
        ]
    },
    {
        "id": "4e7e675626e6b1ff",
        "type": "exec",
        "z": "a8abf135.4e74b",
        "command": "/usr/bin/omxplayer --loop video.mp4",
        "addpay": false,
        "append": "",
        "useSpawn": "true",
        "timer": "",
        "winHide": false,
        "oldrc": false,
        "name": "",
        "x": 650,
        "y": 640,
        "wires": [
            [],
            [],
            []
        ]
    },
    {
        "id": "83cc6d82bd432210",
        "type": "exec",
        "z": "a8abf135.4e74b",
        "command": "sudo pkill omxplayer",
        "addpay": false,
        "append": "",
        "useSpawn": "false",
        "timer": "",
        "winHide": false,
        "oldrc": false,
        "name": "",
        "x": 800,
        "y": 180,
        "wires": [
            [
                "61ae74ae.6f70dc"
            ],
            [],
            []
        ]
    },
    {
        "id": "1f9a57c3.477b38",
        "type": "exec",
        "z": "8de82c2.be3f4d",
        "command": "",
        "addpay": true,
        "append": "",
        "useSpawn": "false",
        "timer": "",
        "oldrc": false,
        "name": "",
        "x": 390,
        "y": 200,
        "wires": [
            [],
            [],
            []
        ]
    },
    {
        "id": "b60b0e09.78ad5",
        "type": "inject",
        "z": "8de82c2.be3f4d",
        "name": "",
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "sudo halt",
        "payloadType": "str",
        "x": 150,
        "y": 100,
        "wires": [
            [
                "1f9a57c3.477b38"
            ]
        ]
    },
    {
        "id": "68b67182.e642e",
        "type": "inject",
        "z": "8de82c2.be3f4d",
        "name": "",
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "sudo reboot",
        "payloadType": "str",
        "x": 160,
        "y": 140,
        "wires": [
            [
                "1f9a57c3.477b38"
            ]
        ]
    }
]