Advertisement
NittyGritty

Gas-to-InfluxDB

Nov 14th, 2022
994
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 5.52 KB | None | 0 0
  1. [
  2.     {
  3.         "id": "c4b6978530b3d880",
  4.         "type": "mqtt in",
  5.         "z": "de3d4dee.ee9e8",
  6.         "name": "",
  7.         "topic": "/home/Koss/Gas/Oben/#",
  8.         "qos": "2",
  9.         "datatype": "auto-detect",
  10.         "broker": "595dfa51.2c1224",
  11.         "nl": false,
  12.         "rap": true,
  13.         "rh": 0,
  14.         "inputs": 0,
  15.         "x": 170,
  16.         "y": 680,
  17.         "wires": [
  18.             [
  19.                 "2a51711fd1f24589"
  20.             ]
  21.         ]
  22.     },
  23.     {
  24.         "id": "5be7bc08a5469cec",
  25.         "type": "moment",
  26.         "z": "de3d4dee.ee9e8",
  27.         "name": "",
  28.         "topic": "",
  29.         "input": "payload",
  30.         "inputType": "msg",
  31.         "inTz": "ETC/GMT",
  32.         "adjAmount": "0",
  33.         "adjType": "hours",
  34.         "adjDir": "subtract",
  35.         "format": "dd DD. MMMM YYYY HH:mm:ss ",
  36.         "locale": "de_DE",
  37.         "output": "",
  38.         "outputType": "msg",
  39.         "outTz": "Europe/Berlin",
  40.         "x": 1020,
  41.         "y": 680,
  42.         "wires": [
  43.             [
  44.                 "e989f482dec35eab"
  45.             ]
  46.         ]
  47.     },
  48.     {
  49.         "id": "e989f482dec35eab",
  50.         "type": "debug",
  51.         "z": "de3d4dee.ee9e8",
  52.         "name": "",
  53.         "active": false,
  54.         "tosidebar": true,
  55.         "console": false,
  56.         "tostatus": true,
  57.         "complete": "payload",
  58.         "targetType": "msg",
  59.         "statusVal": "payload",
  60.         "statusType": "auto",
  61.         "x": 1030,
  62.         "y": 720,
  63.         "wires": []
  64.     },
  65.     {
  66.         "id": "7d6606e8f9143736",
  67.         "type": "function",
  68.         "z": "de3d4dee.ee9e8",
  69.         "name": "function 3",
  70.         "func": "var words = msg.topic.split('/');\nvar KnotenName = (words[3]);\n\nvar Count = msg.payload[0];\nvar Total = msg.payload[1];\nvar Time = msg.payload[2];\n\nvar Influx = [{\n    Room: KnotenName,\n    Count: Count,\n    Total: Total,\n    Time: Time\n}]\n\nvar Influx1 = { payload: Influx };\n\nInflux1.topic = \"/home/Koss/\" + KnotenName + \"/\";\n\n\n\nnode.status({   fill: \"blue\",\n                shape: \"ring\", \n                text: KnotenName +\n                    \" - Count: \" + Count +\n                    \", Total: \" + Total +\n                    \", Time: \" + Time + \"msec\"\n            });\n\nvar time = Date.now();\nvar Time2 = { payload: time };\n\nreturn [Influx1, Time2];\n",
  71.         "outputs": 2,
  72.         "noerr": 0,
  73.         "initialize": "",
  74.         "finalize": "",
  75.         "libs": [],
  76.         "x": 740,
  77.         "y": 680,
  78.         "wires": [
  79.             [
  80.                 "423ad0582809ba26",
  81.                 "3a583c7fc083e9c8"
  82.             ],
  83.             [
  84.                 "5be7bc08a5469cec"
  85.             ]
  86.         ],
  87.         "inputLabels": [
  88.             "merged Input"
  89.         ],
  90.         "outputLabels": [
  91.             "Influx",
  92.             "Msg last sent"
  93.         ]
  94.     },
  95.     {
  96.         "id": "d783bf4e0949e529",
  97.         "type": "join",
  98.         "z": "de3d4dee.ee9e8",
  99.         "name": "",
  100.         "mode": "custom",
  101.         "build": "array",
  102.         "property": "payload",
  103.         "propertyType": "msg",
  104.         "key": "topic",
  105.         "joiner": "\\n",
  106.         "joinerType": "str",
  107.         "accumulate": false,
  108.         "timeout": "1",
  109.         "count": "",
  110.         "reduceRight": false,
  111.         "reduceExp": "",
  112.         "reduceInit": "",
  113.         "reduceInitType": "num",
  114.         "reduceFixup": "",
  115.         "x": 550,
  116.         "y": 680,
  117.         "wires": [
  118.             [
  119.                 "7d6606e8f9143736"
  120.             ]
  121.         ]
  122.     },
  123.     {
  124.         "id": "2a51711fd1f24589",
  125.         "type": "switch",
  126.         "z": "de3d4dee.ee9e8",
  127.         "name": "Total",
  128.         "property": "topic",
  129.         "propertyType": "msg",
  130.         "rules": [
  131.             {
  132.                 "t": "eq",
  133.                 "v": "/home/Koss/Gas/Oben/Count",
  134.                 "vt": "str"
  135.             },
  136.             {
  137.                 "t": "eq",
  138.                 "v": "/home/Koss/Gas/Oben/Total",
  139.                 "vt": "str"
  140.             },
  141.             {
  142.                 "t": "eq",
  143.                 "v": "/home/Koss/Gas/Oben/Time",
  144.                 "vt": "str"
  145.             }
  146.         ],
  147.         "checkall": "true",
  148.         "repair": false,
  149.         "outputs": 3,
  150.         "x": 390,
  151.         "y": 680,
  152.         "wires": [
  153.             [
  154.                 "d783bf4e0949e529"
  155.             ],
  156.             [
  157.                 "d783bf4e0949e529"
  158.             ],
  159.             [
  160.                 "d783bf4e0949e529"
  161.             ]
  162.         ]
  163.     },
  164.     {
  165.         "id": "3a583c7fc083e9c8",
  166.         "type": "debug",
  167.         "z": "de3d4dee.ee9e8",
  168.         "name": "debug 6",
  169.         "active": true,
  170.         "tosidebar": true,
  171.         "console": false,
  172.         "tostatus": false,
  173.         "complete": "false",
  174.         "statusVal": "",
  175.         "statusType": "auto",
  176.         "x": 1060,
  177.         "y": 640,
  178.         "wires": []
  179.     },
  180.     {
  181.         "id": "595dfa51.2c1224",
  182.         "type": "mqtt-broker",
  183.         "name": "Miti16",
  184.         "broker": "192.168.123.16",
  185.         "port": "1883",
  186.         "clientid": "",
  187.         "autoConnect": true,
  188.         "usetls": false,
  189.         "protocolVersion": "4",
  190.         "keepalive": "60",
  191.         "cleansession": true,
  192.         "birthTopic": "",
  193.         "birthQos": "0",
  194.         "birthPayload": "",
  195.         "birthMsg": {},
  196.         "closeTopic": "",
  197.         "closePayload": "",
  198.         "closeMsg": {},
  199.         "willTopic": "",
  200.         "willQos": "0",
  201.         "willPayload": "",
  202.         "willMsg": {},
  203.         "sessionExpiry": ""
  204.     }
  205. ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement