Guest User

MQTT Input

a guest
Nov 29th, 2023
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 3.91 KB | None | 0 0
  1. [
  2.     {
  3.         "id": "72d8b91cb63775a6",
  4.         "type": "mqtt in",
  5.         "z": "61a935fd.42fbec",
  6.         "g": "a69728ad.65b658",
  7.         "name": "Hermes In",
  8.         "topic": "hermes/intent/#",
  9.         "qos": "2",
  10.         "datatype": "json",
  11.         "broker": "8634c426d467f905",
  12.         "nl": true,
  13.         "rap": false,
  14.         "rh": 0,
  15.         "inputs": 0,
  16.         "x": 100,
  17.         "y": 80,
  18.         "wires": [
  19.             [
  20.                 "b327d1c1.951ec"
  21.             ]
  22.         ]
  23.     },
  24.     {
  25.         "id": "b327d1c1.951ec",
  26.         "type": "function",
  27.         "z": "61a935fd.42fbec",
  28.         "g": "a69728ad.65b658",
  29.         "name": "Format Data",
  30.         "func": "//msg.siteId = msg.payload.siteId;\n\nif (typeof msg.payload.slots !== \"undefined\") {\n    if (msg.payload.slots.length > 0) {\n        var rtn = {};\n\n        msg.payload.slots.forEach(item => {\n            if (typeof item.slotName !== \"undefined\") {\n                var sn = item.slotName;\n                var vv = item.value.value;\n                rtn[sn] = vv;\n            }\n        })\n\n        msg.payload.slots = rtn;\n    }\n}\n\nmsg.topic = msg.topic.replace(\"hermes\", \"jarvis\");\n\nreturn msg;\n",
  31.         "outputs": 1,
  32.         "timeout": "",
  33.         "noerr": 0,
  34.         "initialize": "",
  35.         "finalize": "",
  36.         "libs": [],
  37.         "x": 310,
  38.         "y": 80,
  39.         "wires": [
  40.             [
  41.                 "9926f0fb.18914",
  42.                 "ea8bae635abc4374"
  43.             ]
  44.         ]
  45.     },
  46.     {
  47.         "id": "9926f0fb.18914",
  48.         "type": "link out",
  49.         "z": "61a935fd.42fbec",
  50.         "g": "a69728ad.65b658",
  51.         "name": "Logging",
  52.         "mode": "link",
  53.         "links": [
  54.             "1da60329.1c119d",
  55.             "dfb6856d409c1739",
  56.             "dff3e2daa88b43f4"
  57.         ],
  58.         "x": 500,
  59.         "y": 60,
  60.         "wires": [],
  61.         "icon": "node-red/debug.svg",
  62.         "l": true
  63.     },
  64.     {
  65.         "id": "ea8bae635abc4374",
  66.         "type": "link out",
  67.         "z": "61a935fd.42fbec",
  68.         "g": "a69728ad.65b658",
  69.         "name": "Jarvis Out",
  70.         "mode": "link",
  71.         "links": [
  72.             "706b98b6bfa8f03a",
  73.             "93075a61c66b1afa",
  74.             "0788f910469a790f",
  75.             "77fce0497142e124",
  76.             "a06e083d7cb60053",
  77.             "400f5e299345fd7c"
  78.         ],
  79.         "x": 500,
  80.         "y": 100,
  81.         "wires": [],
  82.         "icon": "node-red/bridge.svg",
  83.         "l": true
  84.     },
  85.     {
  86.         "id": "93075a61c66b1afa",
  87.         "type": "link in",
  88.         "z": "61a935fd.42fbec",
  89.         "g": "ff0514a60392bc01",
  90.         "name": "Jarvis In",
  91.         "links": [
  92.             "ea8bae635abc4374"
  93.         ],
  94.         "x": 795,
  95.         "y": 600,
  96.         "wires": [
  97.             [
  98.                 "983ecb90.e0d3b8"
  99.             ]
  100.         ],
  101.         "icon": "node-red/bridge.svg"
  102.     },
  103.     {
  104.         "id": "983ecb90.e0d3b8",
  105.         "type": "link out",
  106.         "z": "61a935fd.42fbec",
  107.         "g": "ff0514a60392bc01",
  108.         "name": "Music",
  109.         "links": [
  110.             "5157e70bae68b04e"
  111.         ],
  112.         "x": 890,
  113.         "y": 600,
  114.         "wires": [],
  115.         "l": true
  116.     },
  117.     {
  118.         "id": "8634c426d467f905",
  119.         "type": "mqtt-broker",
  120.         "name": "MQTT",
  121.         "broker": "2.2.2.2",
  122.         "port": "1883",
  123.         "clientid": "",
  124.         "autoConnect": true,
  125.         "usetls": false,
  126.         "protocolVersion": "5",
  127.         "keepalive": "10",
  128.         "cleansession": true,
  129.         "autoUnsubscribe": true,
  130.         "birthTopic": "",
  131.         "birthQos": "0",
  132.         "birthPayload": "",
  133.         "birthMsg": {},
  134.         "closeTopic": "",
  135.         "closeQos": "0",
  136.         "closePayload": "",
  137.         "closeMsg": {},
  138.         "willTopic": "",
  139.         "willQos": "0",
  140.         "willPayload": "",
  141.         "willMsg": {},
  142.         "userProps": "",
  143.         "sessionExpiry": ""
  144.     }
  145. ]
Add Comment
Please, Sign In to add comment