[ { "id": "300bc7ad.1fbd68", "type": "tab", "label": "Push via mqtt", "disabled": false, "info": "" }, { "id": "89cc8b9b.1012c8", "type": "inject", "z": "300bc7ad.1fbd68", "name": "", "topic": "", "payload": "", "payloadType": "date", "repeat": "60", "crontab": "", "once": false, "onceDelay": 0.1, "x": 150, "y": 80, "wires": [ [ "17d1902f.1901a" ] ] }, { "id": "17d1902f.1901a", "type": "function", "z": "300bc7ad.1fbd68", "name": "Random number generator", "func": "const randomValue = Math.round(Math.random() * 100);\n\nmsg.firstValue = randomValue;\n\nreturn msg;", "outputs": 1, "noerr": 0, "x": 420, "y": 80, "wires": [ [ "50756082.777c3" ] ] }, { "id": "50756082.777c3", "type": "function", "z": "300bc7ad.1fbd68", "name": "prepare-data-to-push", "func": "const now = new Date(), \nbody = () => {\n const signals = [];\n\n if (msg.firstValue) {\n\n signals.push({\n 'name': '',\n 'value': msg.firstValue\n });\n }\n \n if (msg.secondValue) {\n signals.push({\n 'name': '',\n 'value': msg.secondValue\n });\n }\n\n return {\n 'type': 'data',\n 'message': {\n 'device': '',\n 'date': now.toISOString(),\n signals \n }\n };\n};\n\nmsg.payload = body();\n\nreturn msg;", "outputs": 1, "noerr": 0, "x": 740, "y": 120, "wires": [ [ "5aefe896.eed548" ] ] }, { "id": "62e9c272.88da8c", "type": "inject", "z": "300bc7ad.1fbd68", "name": "timestamp-2", "topic": "", "payload": "", "payloadType": "date", "repeat": "60", "crontab": "", "once": false, "onceDelay": 0.1, "x": 140, "y": 160, "wires": [ [ "52810d83.630b84" ] ] }, { "id": "52810d83.630b84", "type": "function", "z": "300bc7ad.1fbd68", "name": "Random number generator", "func": "const randomValue = Math.round(Math.random() * 100);\n\nmsg.secondValue = randomValue;\n\nreturn msg;", "outputs": 1, "noerr": 0, "x": 420, "y": 160, "wires": [ [ "50756082.777c3" ] ] }, { "id": "5aefe896.eed548", "type": "mqtt out", "z": "300bc7ad.1fbd68", "name": "mqtt-to-databoom", "topic": "", "qos": "2", "retain": "false", "broker": "78d98aaf.137964", "x": 1010, "y": 120, "wires": [] }, { "id": "78d98aaf.137964", "type": "mqtt-broker", "z": "", "name": "mqtt.databoom", "broker": "mqtt.databoom.com", "port": "8883", "tls": "", "clientid": "", "usetls": true, "compatmode": true, "keepalive": "60", "cleansession": true, "birthTopic": "", "birthQos": "0", "birthPayload": "", "closeTopic": "", "closeQos": "0", "closePayload": "", "willTopic": "", "willQos": "0", "willPayload": "" } ]