@ifp-software/node-red-contrib-oee-ai-connector
Version:
Easily connect your production machines to oee.ai – The Industry 4.0 solution for OEE optimization.
63 lines (62 loc) • 2.21 kB
JSON
[
{
"id": "86345f9.100eaa",
"type": "tab",
"label": "Send produced units during the last 30 seconds to oee.ai",
"disabled": false,
"info": "This example sends a random number between 75 and 100 to oee.ai every 30 seconds."
},
{
"id": "90079d9f.951b5",
"type": "inject",
"z": "86345f9.100eaa",
"name": "Timestamp every 30 seconds",
"props": [{ "p": "to", "v": "", "vt": "date" }],
"repeat": "30",
"crontab": "",
"once": true,
"onceDelay": 0.1,
"topic": "",
"x": 210,
"y": 80,
"wires": [["7676006.c4736"]],
"info": "This node is triggered every 30 seconds and sets `msg.to` to the current timestamp."
},
{
"id": "9585121c.2d87c",
"type": "oee-ai-connector",
"z": "86345f9.100eaa",
"name": "Send to oee.ai",
"server": "preview",
"x": 800,
"y": 80,
"wires": [],
"info": "This node sends the produced units (`msg.count`) during the last 30 seconds (`msg.to - 30 seconds`) to oee.ai ."
},
{
"id": "7676006.c4736",
"type": "function",
"z": "86345f9.100eaa",
"name": "Random number between 75 and 100",
"func": "msg.count = Math.floor(Math.random() * 25) + 75;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 530,
"y": 80,
"wires": [["9585121c.2d87c"]],
"info": "This node sets `msg.count` to a random number between 75 and 100.\n\nReplace this node with a node that reads the produced units from the actual production machine in the last 30 seconds and writes it into `msg.count`."
},
{
"id": "7b9027d3.68a948",
"type": "comment",
"z": "86345f9.100eaa",
"name": "^^ Configure this node",
"info": "To connect the node above to oee.ai please create a new sensor at the desired location in the oee.ai web interface at `Machine -> Sensors -> Create sensor`.\n\nCopy and paste the sensor's ID and token into the configuration input fields of the oee.ai connector node.\n\nThe selected server (`preview` for testing and development, `production` for live machine data) must match the one where the sensor was created.",
"x": 810,
"y": 140,
"wires": []
}
]