Advertisement
Guest User

Node-Red example for OpenSprinkler

a guest
Jul 26th, 2019
891
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. [
  2.     {
  3.         "id": "a9972f50.75ddb8",
  4.         "type": "tab",
  5.         "label": "RPI to OS",
  6.         "disabled": false,
  7.         "info": "Flow for using the API calls from opensprinkler\nwith interacting buttons on GPIO ports from the RPI"
  8.     },
  9.     {
  10.         "id": "f960f681.b3fbe",
  11.         "type": "debug",
  12.         "z": "a9972f50.75ddb8",
  13.         "name": "api debugger",
  14.         "active": true,
  15.         "tosidebar": true,
  16.         "console": false,
  17.         "tostatus": false,
  18.         "complete": "true",
  19.         "targetType": "full",
  20.         "x": 1190,
  21.         "y": 330,
  22.         "wires": []
  23.     },
  24.     {
  25.         "id": "a759d49b.f4c6a8",
  26.         "type": "comment",
  27.         "z": "a9972f50.75ddb8",
  28.         "name": "start button (commit)",
  29.         "info": "receive input from a case mounted rotary switch.\nsend input to GPIO (high=1) ",
  30.         "x": 210,
  31.         "y": 255,
  32.         "wires": []
  33.     },
  34.     {
  35.         "id": "ede329cf.d67af",
  36.         "type": "rpi-gpio in",
  37.         "z": "a9972f50.75ddb8",
  38.         "name": "rotary stand 1 [PI/35]",
  39.         "pin": "35",
  40.         "intype": "down",
  41.         "debounce": "300",
  42.         "read": false,
  43.         "x": 295,
  44.         "y": 300,
  45.         "wires": [
  46.             [
  47.                 "9d322817.71844"
  48.             ]
  49.         ]
  50.     },
  51.     {
  52.         "id": "b0fe5293.002868",
  53.         "type": "rpi-gpio in",
  54.         "z": "a9972f50.75ddb8",
  55.         "name": "rotary stand 2 [PI/31]",
  56.         "pin": "31",
  57.         "intype": "down",
  58.         "debounce": "25",
  59.         "read": false,
  60.         "x": 295,
  61.         "y": 345,
  62.         "wires": [
  63.             [
  64.                 "9d322817.71844"
  65.             ]
  66.         ]
  67.     },
  68.     {
  69.         "id": "b9c402b4.00f7b8",
  70.         "type": "rpi-gpio in",
  71.         "z": "a9972f50.75ddb8",
  72.         "name": "rotary stand 3 [PI/29]",
  73.         "pin": "29",
  74.         "intype": "down",
  75.         "debounce": "25",
  76.         "read": false,
  77.         "x": 295,
  78.         "y": 390,
  79.         "wires": [
  80.             [
  81.                 "9d322817.71844"
  82.             ]
  83.         ]
  84.     },
  85.     {
  86.         "id": "44e70bf4.e03e8c",
  87.         "type": "rpi-gpio in",
  88.         "z": "a9972f50.75ddb8",
  89.         "name": "rotary stand 4 [PI/36]",
  90.         "pin": "36",
  91.         "intype": "down",
  92.         "debounce": "25",
  93.         "read": false,
  94.         "x": 295,
  95.         "y": 435,
  96.         "wires": [
  97.             [
  98.                 "9d322817.71844"
  99.             ]
  100.         ]
  101.     },
  102.     {
  103.         "id": "9d322817.71844",
  104.         "type": "function",
  105.         "z": "a9972f50.75ddb8",
  106.         "name": "Create Opensprinkler call",
  107.         "func": "// NOTE: The OS API has all the variables in the URL not in the body (payload) or header!\nvar counter = {};\nvar api     = {};\nvar load    = {}; \nvar zone    = flow.get('OSZONE');\n\nvar password=flow.get('pass') || 'NO-PASSWORD';      // get password from flow variable\nvar url =flow.get(\"OSurl\") || 'http://LOCALHOST:8080';        // get url from variable\n\n\nif  (msg.payload == 1) \n{\n    switch (msg.topic )\n    {\n        case \"pi/35\":\n            api.load = url+\"/cm?pw=\"+password+\"&sid=0&en=1&t=300\"; // zone 1\n            counter.payload = 'on';\n            counter.timeout = 300;\n            zone = \"Garden West\";\n            flow.set('OSZONE',zone);\n           // flow.set(\"blinker\",1,function(err){110,110})\n            break;\n        case \"pi/31\":\n            api.load = url+\"/cm?pw=\"+password+\"&sid=1&en=1&t=303600\"; // zone 2\n            counter.payload = 'on';\n            counter.timeout = 360;//300;\n            zone = \"Garden South\";\n            flow.set('OSZONE',zone);\n            break;\n        case \"pi/29\":\n            api.load = url+\"/cm?pw=\"+password+\"&sid=2&en=1&t=360\"; // zone 3 - border zuid\n            counter.payload = 'on';\n            counter.timeout = 360;//600;\n            zone = \"Borders South\";\n            flow.set('OSZONE',zone);\n            break;\n        case \"pi/36\":\n            api.load = url+\"/cm?pw=\"+password+\"&sid=3&en=1&t=300\"; // zone 4\n            counter.payload = 'on';\n            counter.timeout = 300;//600;\n            zone = \"Borders South\";\n            flow.set('OSZONE',zone);\n            break;\n        case \"pi/38\":\n            api.load = url+\"/mp?pw=\"+password+\"&pid=1&uwt=0\"; // RUN PROGRAM \"1 Borders\"\n            counter.payload = 'on';\n            counter.timeout = 15;//900;\n            zone = \"PROGR. alle borders\";\n            flow.set('OSZONE',zone);\n            break;\n        case \"pi/40\":\n             api.load = url+\"/mp?pw=\"+password+\"&pid=2&uwt=0\"; // RUN PROGRAM \"2 Gazon los\"\n            counter.payload = 'on';\n            counter.timeout = 15;//900;\n            zone = \"PROGR. Gazon totaal\";\n            flow.set('OSZONE',zone);\n            break;        \n        case \"pi/37\":\n            api.load = url+\"/cv?pw=\"+password+\"&rsn=1\"; // STOP ALL BUTTON!\n            counter.payload = 'cancel';\n            counter.timeout = 5;\n            zone = \"All STOP NOW!\";\n            flow.set('OSZONE',zone);\n            break;   \n    } //switch\n    \nflow.set('OSZONE',zone);\n} //if\nelse {return;} \napi.url = api.load;\nreturn [api, counter];\n\n",
  108.         "outputs": 2,
  109.         "noerr": 0,
  110.         "x": 595,
  111.         "y": 340,
  112.         "wires": [
  113.             [
  114.                 "b4a47b65.bee658",
  115.                 "4370a181.474fd8"
  116.             ],
  117.             [
  118.                 "8f8284e3.a4093",
  119.                 "be45f9aa.f81a88"
  120.             ]
  121.         ],
  122.         "info": "NOTE: The OS API has all the variables in the URL not in the body (payload) or header!\n"
  123.     },
  124.     {
  125.         "id": "5a718039.eb1b58",
  126.         "type": "http request",
  127.         "z": "a9972f50.75ddb8",
  128.         "name": "API opensprinkler",
  129.         "method": "GET",
  130.         "ret": "txt",
  131.         "paytoqs": false,
  132.         "url": "",
  133.         "tls": "",
  134.         "proxy": "",
  135.         "authType": "basic",
  136.         "x": 990,
  137.         "y": 330,
  138.         "wires": [
  139.             [
  140.                 "f960f681.b3fbe"
  141.             ]
  142.         ],
  143.         "icon": "font-awesome/fa-spinner"
  144.     },
  145.     {
  146.         "id": "7679d483.824c54",
  147.         "type": "md5",
  148.         "z": "a9972f50.75ddb8",
  149.         "name": "md5 password hash",
  150.         "fieldToHash": "payload",
  151.         "fieldTypeToHash": "msg",
  152.         "hashField": "pass",
  153.         "hashFieldType": "flow",
  154.         "x": 505,
  155.         "y": 165,
  156.         "wires": [
  157.             [
  158.                 "19e68d08.1d8ab3"
  159.             ]
  160.         ]
  161.     },
  162.     {
  163.         "id": "aefdef62.fa8ad",
  164.         "type": "inject",
  165.         "z": "a9972f50.75ddb8",
  166.         "name": "SET PASSWORD",
  167.         "topic": "http://YOUR-OS-URL:8080",
  168.         "payload": "YOUR-PASSWORD",
  169.         "payloadType": "str",
  170.         "repeat": "",
  171.         "crontab": "",
  172.         "once": true,
  173.         "onceDelay": 0.1,
  174.         "x": 255,
  175.         "y": 165,
  176.         "wires": [
  177.             [
  178.                 "7679d483.824c54",
  179.                 "f282ba39.d7be2"
  180.             ]
  181.         ]
  182.     },
  183.     {
  184.         "id": "78fa639d.139314",
  185.         "type": "debug",
  186.         "z": "a9972f50.75ddb8",
  187.         "name": "set URL",
  188.         "active": true,
  189.         "tosidebar": true,
  190.         "console": false,
  191.         "tostatus": false,
  192.         "complete": "true",
  193.         "targetType": "full",
  194.         "x": 725,
  195.         "y": 205,
  196.         "wires": []
  197.     },
  198.     {
  199.         "id": "19e68d08.1d8ab3",
  200.         "type": "debug",
  201.         "z": "a9972f50.75ddb8",
  202.         "name": "password hash",
  203.         "active": true,
  204.         "tosidebar": true,
  205.         "console": false,
  206.         "tostatus": false,
  207.         "complete": "true",
  208.         "targetType": "full",
  209.         "x": 745,
  210.         "y": 165,
  211.         "wires": []
  212.     },
  213.     {
  214.         "id": "8fb9b426.c1f44",
  215.         "type": "inject",
  216.         "z": "a9972f50.75ddb8",
  217.         "name": "debug insert GPIO29",
  218.         "topic": "pi/35",
  219.         "payload": "1",
  220.         "payloadType": "str",
  221.         "repeat": "",
  222.         "crontab": "",
  223.         "once": false,
  224.         "onceDelay": 0.1,
  225.         "x": 150,
  226.         "y": 300,
  227.         "wires": [
  228.             [
  229.                 "9d322817.71844"
  230.             ]
  231.         ],
  232.         "icon": "node-red/rpi.png",
  233.         "l": false,
  234.         "info": "run rotary 1"
  235.     },
  236.     {
  237.         "id": "f282ba39.d7be2",
  238.         "type": "function",
  239.         "z": "a9972f50.75ddb8",
  240.         "name": "flow.set('OSurl', OSURL);",
  241.         "func": "var OSURL = msg.topic\nflow.set('OSurl', OSURL);\nreturn msg;",
  242.         "outputs": 1,
  243.         "noerr": 0,
  244.         "x": 515,
  245.         "y": 205,
  246.         "wires": [
  247.             [
  248.                 "78fa639d.139314"
  249.             ]
  250.         ]
  251.     },
  252.     {
  253.         "id": "7548e7a4.a9088",
  254.         "type": "rpi-gpio in",
  255.         "z": "a9972f50.75ddb8",
  256.         "name": "rotary stand 5 [PI/38]",
  257.         "pin": "38",
  258.         "intype": "down",
  259.         "debounce": "25",
  260.         "read": false,
  261.         "x": 293,
  262.         "y": 481,
  263.         "wires": [
  264.             [
  265.                 "9d322817.71844"
  266.             ]
  267.         ]
  268.     },
  269.     {
  270.         "id": "2d8c0888.b32198",
  271.         "type": "rpi-gpio in",
  272.         "z": "a9972f50.75ddb8",
  273.         "name": "rotary stand 6 [PI/40]",
  274.         "pin": "40",
  275.         "intype": "down",
  276.         "debounce": "25",
  277.         "read": false,
  278.         "x": 295,
  279.         "y": 525,
  280.         "wires": [
  281.             [
  282.                 "9d322817.71844"
  283.             ]
  284.         ]
  285.     },
  286.     {
  287.         "id": "ab3fc1db.8f7f28",
  288.         "type": "rpi-gpio in",
  289.         "z": "a9972f50.75ddb8",
  290.         "name": "CANCEL [PI/37]",
  291.         "pin": "37",
  292.         "intype": "down",
  293.         "debounce": "250",
  294.         "read": false,
  295.         "x": 285,
  296.         "y": 620,
  297.         "wires": [
  298.             [
  299.                 "9d322817.71844",
  300.                 "3ec3f5f0.50369a",
  301.                 "c8911ca6.fb87b"
  302.             ]
  303.         ]
  304.     },
  305.     {
  306.         "id": "c462179f.25df38",
  307.         "type": "inject",
  308.         "z": "a9972f50.75ddb8",
  309.         "name": "debug insert GPIO37",
  310.         "topic": "pi/37",
  311.         "payload": "1",
  312.         "payloadType": "str",
  313.         "repeat": "",
  314.         "crontab": "",
  315.         "once": false,
  316.         "onceDelay": 0.1,
  317.         "x": 160,
  318.         "y": 620,
  319.         "wires": [
  320.             [
  321.                 "9d322817.71844",
  322.                 "3ec3f5f0.50369a"
  323.             ]
  324.         ],
  325.         "icon": "font-awesome/fa-stop-circle",
  326.         "l": false
  327.     },
  328.     {
  329.         "id": "b4a47b65.bee658",
  330.         "type": "debug",
  331.         "z": "a9972f50.75ddb8",
  332.         "name": "function",
  333.         "active": false,
  334.         "tosidebar": true,
  335.         "console": false,
  336.         "tostatus": false,
  337.         "complete": "true",
  338.         "targetType": "full",
  339.         "x": 765,
  340.         "y": 285,
  341.         "wires": [],
  342.         "l": false
  343.     },
  344.     {
  345.         "id": "be45f9aa.f81a88",
  346.         "type": "mytimeout",
  347.         "z": "a9972f50.75ddb8",
  348.         "name": "LCD countdown",
  349.         "outtopic": "",
  350.         "outsafe": "on",
  351.         "outwarning": "Warning",
  352.         "outunsafe": "off",
  353.         "warning": "5",
  354.         "timer": "",
  355.         "debug": false,
  356.         "ndebug": false,
  357.         "ignoreCase": false,
  358.         "repeat": false,
  359.         "again": false,
  360.         "x": 605,
  361.         "y": 520,
  362.         "wires": [
  363.             [
  364.                 "d69cc523.bb7c18",
  365.                 "3ec3f5f0.50369a"
  366.             ],
  367.             [
  368.                 "d4a53368.bd1aa",
  369.                 "8c8b93df.69955"
  370.             ]
  371.         ],
  372.         "outputLabels": [
  373.             "stats",
  374.             "counter"
  375.         ],
  376.         "info": "lcd counter"
  377.     },
  378.     {
  379.         "id": "d69cc523.bb7c18",
  380.         "type": "debug",
  381.         "z": "a9972f50.75ddb8",
  382.         "name": "status",
  383.         "active": true,
  384.         "tosidebar": true,
  385.         "console": false,
  386.         "tostatus": false,
  387.         "complete": "true",
  388.         "targetType": "full",
  389.         "x": 820,
  390.         "y": 500,
  391.         "wires": [],
  392.         "l": false
  393.     },
  394.     {
  395.         "id": "d4a53368.bd1aa",
  396.         "type": "debug",
  397.         "z": "a9972f50.75ddb8",
  398.         "name": "counter",
  399.         "active": false,
  400.         "tosidebar": true,
  401.         "console": false,
  402.         "tostatus": false,
  403.         "complete": "true",
  404.         "targetType": "full",
  405.         "x": 820,
  406.         "y": 600,
  407.         "wires": [],
  408.         "l": false
  409.     },
  410.     {
  411.         "id": "8c8b93df.69955",
  412.         "type": "function",
  413.         "z": "a9972f50.75ddb8",
  414.         "name": "LCD message",
  415.         "func": "\nvar String01 =flow.get('OSZONE') ||'abc';\nvar sString02 = msg.payload;\n\nif (msg.state === 1) // RUN state\n{\nmsg.payload = \n    {\n\tmsgs:   [\n\t\t    {\n\t\t\tmsg:String01,\n\t\t\t//msg:\"zone test\" ,\n\t\t\tpos:1,\n\t\t\tcenter:false\n\t\t    },\n\t\t    {\n\t\t\tmsg:sString02 + \"  seconden\",\n\t\t\tpos:1,\n\t\t\tcenter:true\n\t\t    }\n\t\t\t]\n    }\n}//if\nelse if (msg.state === 2 ) // warning state\n{  \n    msg.payload = \n    {\n\tmsgs:   [\n\t    \t\t    {\n\t\t\tmsg:String01,\n\t\t\tpos:1,\n\t\t\tcenter:true\n\t\t    },\n\t\t    {\n\t\t\tmsg: \"Bijna nog \" +sString02+ \" sec.\",\n\t\t\tpos:1,\n\t\t\tcenter:false\n\t\t    }\n\t        ]\n    }\n}\n\nelse if (msg.state === 0 && msg.payload === 0) //DONE state\n{  \n    msg.payload = \n        {\n    \tmsgs:   [\n    \t\t    {\n    \t\t\tmsg: \"|------------------|\",\n    \t\t\tpos:1,\n    \t\t\tcenter:false\n    \t\t    },\n    \t\t    {\n    \t\t\tmsg: \"|   Sproeibeurt    |\",\n    \t\t\tpos:1,\n    \t\t\tcenter:false\n    \t\t    },\n    \t\t    {\n    \t\t\tmsg: \"|    afgerond!     |\",\n    \t\t\tpos:1,\n    \t\t\tcenter:false\n    \t\t    },\n    \t\t    {\n    \t\t\tmsg: \"|------------------|\",\n    \t\t\tpos:1,\n    \t\t\tcenter:false\n    \t\t    }\n    \t        ]\n        }\n}\nelse if (msg.state === 0 && msg.payload === -1) //cancel state\n{  \n    msg.payload = \n        {\n    \tmsgs:   [\n    \t\t    {\n    \t\t\tmsg: \"|------------------|\",\n    \t\t\tpos:1,\n    \t\t\tcenter:false\n    \t\t    },\n    \t\t    {\n    \t\t\tmsg: \"| \"+String01+ \"  |\",\n    \t\t\tpos:1,\n    \t\t\tcenter:false\n    \t\t    },\n    \t\t    {\n    \t\t\tmsg: \"|                  |\",\n    \t\t\tpos:1,\n    \t\t\tcenter:false\n    \t\t    },\n    \t\t    {\n    \t\t\tmsg: \"|------------------|\",\n    \t\t\tpos:1,\n    \t\t\tcenter:false\n    \t\t    }\n    \t        ]\n        }\n}\nelse {return;} \nreturn msg;\n\n",
  416.         "outputs": 1,
  417.         "noerr": 0,
  418.         "x": 890,
  419.         "y": 555,
  420.         "wires": [
  421.             [
  422.                 "b38021.02e81fe",
  423.                 "bde95634.1e63d"
  424.             ]
  425.         ]
  426.     },
  427.     {
  428.         "id": "8f8284e3.a4093",
  429.         "type": "debug",
  430.         "z": "a9972f50.75ddb8",
  431.         "name": "",
  432.         "active": false,
  433.         "tosidebar": true,
  434.         "console": false,
  435.         "tostatus": false,
  436.         "complete": "true",
  437.         "targetType": "full",
  438.         "x": 765,
  439.         "y": 375,
  440.         "wires": [],
  441.         "l": false
  442.     },
  443.     {
  444.         "id": "3d326806.274e28",
  445.         "type": "delay",
  446.         "z": "a9972f50.75ddb8",
  447.         "name": "clear LCD after run",
  448.         "pauseType": "delayv",
  449.         "timeout": "15",
  450.         "timeoutUnits": "seconds",
  451.         "rate": "1",
  452.         "nbRateUnits": "1",
  453.         "rateUnits": "second",
  454.         "randomFirst": "1",
  455.         "randomLast": "5",
  456.         "randomUnits": "seconds",
  457.         "drop": false,
  458.         "x": 1055,
  459.         "y": 460,
  460.         "wires": [
  461.             [
  462.                 "bde95634.1e63d"
  463.             ]
  464.         ]
  465.     },
  466.     {
  467.         "id": "3ec3f5f0.50369a",
  468.         "type": "function",
  469.         "z": "a9972f50.75ddb8",
  470.         "name": "clear lcd",
  471.         "func": "if (msg.topic === \"pi/37\" ) // if cancel button is pressed\n{\nmsg.delay = 15000 //  10 sec.\nmsg.topic = \"flush\" //send this message now regardless of the old delay timer\nmsg.payload = {\n\tmsgs:[\n\t\t{\n\t\t\tmsg:'',\n\t\t\tpos:1,\n\t\t\tcenter:true\n\t\t}\n\t\t\n\t]\n};\n\n} //if\nelse {\n    msg.delay = (msg.timeout*1000)+15000 \nmsg.payload = {\n\tmsgs:[\n\t\t{\n\t\t\tmsg:'',\n\t\t\tpos:1,\n\t\t\tcenter:true\n\t\t}\n\t\t\n\t]\n};\n} //else\nreturn msg;",
  472.         "outputs": 1,
  473.         "noerr": 0,
  474.         "x": 865,
  475.         "y": 460,
  476.         "wires": [
  477.             [
  478.                 "3d326806.274e28"
  479.             ]
  480.         ],
  481.         "info": "clears the LCD after a run"
  482.     },
  483.     {
  484.         "id": "b38021.02e81fe",
  485.         "type": "debug",
  486.         "z": "a9972f50.75ddb8",
  487.         "name": "lcd debug",
  488.         "active": false,
  489.         "tosidebar": true,
  490.         "console": false,
  491.         "tostatus": false,
  492.         "complete": "payload",
  493.         "targetType": "msg",
  494.         "x": 1085,
  495.         "y": 560,
  496.         "wires": []
  497.     },
  498.     {
  499.         "id": "c8911ca6.fb87b",
  500.         "type": "debug",
  501.         "z": "a9972f50.75ddb8",
  502.         "name": "",
  503.         "active": true,
  504.         "tosidebar": true,
  505.         "console": false,
  506.         "tostatus": false,
  507.         "complete": "true",
  508.         "targetType": "full",
  509.         "x": 575,
  510.         "y": 620,
  511.         "wires": []
  512.     },
  513.     {
  514.         "id": "ba1ee891.4b909",
  515.         "type": "inject",
  516.         "z": "a9972f50.75ddb8",
  517.         "name": "debug insert GPIO29",
  518.         "topic": "pi/38",
  519.         "payload": "1",
  520.         "payloadType": "str",
  521.         "repeat": "",
  522.         "crontab": "",
  523.         "once": false,
  524.         "onceDelay": 0.1,
  525.         "x": 150,
  526.         "y": 480,
  527.         "wires": [
  528.             [
  529.                 "9d322817.71844"
  530.             ]
  531.         ],
  532.         "icon": "node-red/rpi.png",
  533.         "l": false,
  534.         "info": "run rotary 1"
  535.     },
  536.     {
  537.         "id": "4c3c20b6.02e71",
  538.         "type": "inject",
  539.         "z": "a9972f50.75ddb8",
  540.         "name": "debug insert GPIO31",
  541.         "topic": "pi/31",
  542.         "payload": "1",
  543.         "payloadType": "str",
  544.         "repeat": "",
  545.         "crontab": "",
  546.         "once": false,
  547.         "onceDelay": 0.1,
  548.         "x": 150,
  549.         "y": 345,
  550.         "wires": [
  551.             [
  552.                 "9d322817.71844"
  553.             ]
  554.         ],
  555.         "icon": "node-red/rpi.png",
  556.         "l": false,
  557.         "info": "run rotary 1"
  558.     },
  559.     {
  560.         "id": "bf8292cb.8b9768",
  561.         "type": "inject",
  562.         "z": "a9972f50.75ddb8",
  563.         "name": "",
  564.         "topic": "pi/29",
  565.         "payload": "1",
  566.         "payloadType": "str",
  567.         "repeat": "",
  568.         "crontab": "",
  569.         "once": false,
  570.         "onceDelay": 0.1,
  571.         "x": 150,
  572.         "y": 390,
  573.         "wires": [
  574.             [
  575.                 "9d322817.71844"
  576.             ]
  577.         ],
  578.         "icon": "node-red/rpi.png",
  579.         "l": false,
  580.         "info": "run rotary 1"
  581.     },
  582.     {
  583.         "id": "979e2ddc.5b917",
  584.         "type": "inject",
  585.         "z": "a9972f50.75ddb8",
  586.         "name": "",
  587.         "topic": "pi/36",
  588.         "payload": "1",
  589.         "payloadType": "str",
  590.         "repeat": "",
  591.         "crontab": "",
  592.         "once": false,
  593.         "onceDelay": 0.1,
  594.         "x": 150,
  595.         "y": 435,
  596.         "wires": [
  597.             [
  598.                 "9d322817.71844"
  599.             ]
  600.         ],
  601.         "icon": "node-red/rpi.png",
  602.         "l": false,
  603.         "info": "run rotary 1"
  604.     },
  605.     {
  606.         "id": "4370a181.474fd8",
  607.         "type": "delay",
  608.         "z": "a9972f50.75ddb8",
  609.         "name": "delay API",
  610.         "pauseType": "delay",
  611.         "timeout": "4",
  612.         "timeoutUnits": "seconds",
  613.         "rate": "1",
  614.         "nbRateUnits": "1",
  615.         "rateUnits": "second",
  616.         "randomFirst": "1",
  617.         "randomLast": "5",
  618.         "randomUnits": "seconds",
  619.         "drop": false,
  620.         "x": 810,
  621.         "y": 330,
  622.         "wires": [
  623.             [
  624.                 "5a718039.eb1b58"
  625.             ]
  626.         ],
  627.         "info": " delay API  call for sync with LCD"
  628.     },
  629.     {
  630.         "id": "373804fa.5e64ac",
  631.         "type": "inject",
  632.         "z": "a9972f50.75ddb8",
  633.         "name": "debug insert",
  634.         "topic": "pi/40",
  635.         "payload": "1",
  636.         "payloadType": "str",
  637.         "repeat": "",
  638.         "crontab": "",
  639.         "once": false,
  640.         "onceDelay": 0.1,
  641.         "x": 150,
  642.         "y": 525,
  643.         "wires": [
  644.             [
  645.                 "9d322817.71844"
  646.             ]
  647.         ],
  648.         "icon": "node-red/rpi.png",
  649.         "l": false,
  650.         "info": "run rotary 1"
  651.     },
  652.     {
  653.         "id": "b0cbc4f1.a9af8",
  654.         "type": "comment",
  655.         "z": "a9972f50.75ddb8",
  656.         "name": "set system variables here",
  657.         "info": "type your password into the **payload**\ntype your OpenSprinkler URL into the **topic**",
  658.         "x": 245,
  659.         "y": 105,
  660.         "wires": []
  661.     },
  662.     {
  663.         "id": "c546008b.3dba9",
  664.         "type": "comment",
  665.         "z": "a9972f50.75ddb8",
  666.         "name": "example GET API calls",
  667.         "info": "beaware that your password \nmust be encrypted with a MD5 hash",
  668.         "x": 235,
  669.         "y": 720,
  670.         "wires": []
  671.     },
  672.     {
  673.         "id": "69e6c543.fd29b4",
  674.         "type": "inject",
  675.         "z": "a9972f50.75ddb8",
  676.         "name": "get all config",
  677.         "topic": "",
  678.         "payload": "http://localhost:8080/jc?pw=6e216f3999d808ce106ae63446b60031",
  679.         "payloadType": "str",
  680.         "repeat": "",
  681.         "crontab": "",
  682.         "once": false,
  683.         "onceDelay": 0.1,
  684.         "x": 220,
  685.         "y": 795,
  686.         "wires": [
  687.             [
  688.                 "b96aef88.dbd92"
  689.             ]
  690.         ]
  691.     },
  692.     {
  693.         "id": "b96aef88.dbd92",
  694.         "type": "http request",
  695.         "z": "a9972f50.75ddb8",
  696.         "name": "API opensprinkler",
  697.         "method": "GET",
  698.         "ret": "txt",
  699.         "paytoqs": false,
  700.         "url": "",
  701.         "tls": "",
  702.         "proxy": "",
  703.         "authType": "basic",
  704.         "x": 450,
  705.         "y": 795,
  706.         "wires": [
  707.             [
  708.                 "8689f6a.f771208"
  709.             ]
  710.         ],
  711.         "icon": "font-awesome/fa-spinner"
  712.     },
  713.     {
  714.         "id": "8689f6a.f771208",
  715.         "type": "debug",
  716.         "z": "a9972f50.75ddb8",
  717.         "name": "api debugger",
  718.         "active": true,
  719.         "tosidebar": true,
  720.         "console": false,
  721.         "tostatus": false,
  722.         "complete": "true",
  723.         "targetType": "full",
  724.         "x": 680,
  725.         "y": 795,
  726.         "wires": []
  727.     },
  728.     {
  729.         "id": "bde95634.1e63d",
  730.         "type": "LCD20x4-I2C",
  731.         "z": "a9972f50.75ddb8",
  732.         "name": "",
  733.         "speed": "3",
  734.         "size": "20x4",
  735.         "x": 1350,
  736.         "y": 510,
  737.         "wires": []
  738.     },
  739.     {
  740.         "id": "5f26df7c.62d18",
  741.         "type": "comment",
  742.         "z": "a9972f50.75ddb8",
  743.         "name": "LCD",
  744.         "info": "connected to a LCD 2004.\nwith i2c connected to the opensprinkler board and a raspberry pi",
  745.         "x": 1310,
  746.         "y": 450,
  747.         "wires": []
  748.     }
  749. ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement