[{"data":1,"prerenderedAt":3482},["ShallowReactive",2],{"blog-\u002Fblog\u002F2025\u002F04\u002Fbuilding-oee-dashboard-with-flowfuse-2":3},{"id":4,"title":5,"body":6,"description":3466,"extension":3467,"meta":3468,"navigation":1427,"path":3478,"seo":3479,"stem":3480,"__hash__":3481},"blog\u002Fblog\u002F2025\u002F04\u002Fbuilding-oee-dashboard-with-flowfuse-2.md","Part 2: Building an OEE Dashboard with FlowFuse",{"type":7,"value":8,"toc":3454},"minimark",[9,26,31,34,53,62,65,70,73,111,115,118,123,160,163,173,177,180,185,255,270,278,282,418,426,430,433,652,659,668,676,680,683,900,908,912,915,918,938,942,950,1184,1219,1223,1324,1328,1351,2232,2241,2245,2248,2253,2277,2341,2346,2397,2401,2425,3101,3126,3135,3139,3142,3145,3401,3409,3412,3421,3428,3431,3434,3438,3450],[10,11,12,13,18,19,25],"p",{},"In ",[14,15,17],"a",{"href":16},"\u002Fblog\u002F2025\u002F04\u002Fbuilding-oee-dashboard-with-flowfuse-part-1\u002F","Part 1",", we explored the fundamentals of OEE, outlined a basic design of the dashboard, and identified the key elements to include in the OEE dashboard.\nIn this Part 2, we will focus on building the OEE dashboard interface using ",[14,20,24],{"href":21,"rel":22},"https:\u002F\u002Fdashboard.flowfuse.com\u002F",[23],"nofollow","FlowFuse Dashboard"," (Node-RED Dashboard 2.0) and FlowFuse, utilizing simulated production and downtime data.",[27,28,30],"h2",{"id":29},"getting-started","Getting Started",[10,32,33],{},"To simplify the development process, we will divide development into five key parts:",[35,36,37,41,44,47,50],"ol",{},[38,39,40],"li",{},"Collecting and configuring data",[38,42,43],{},"Preparing data for calculations",[38,45,46],{},"Calculating OEE and key metrics",[38,48,49],{},"Detailed breakdown of OEE data",[38,51,52],{},"Building the dashboard",[10,54,55,56,61],{},"Before we start, it is recommended to have a basic knowledge of Node-RED. For that, I recommend this free ",[14,57,60],{"href":58,"rel":59},"https:\u002F\u002Fnode-red-academy.learnworlds.com\u002Fcourse\u002Fnode-red-getting-started",[23],"Node-RED Fundamental Course",".",[10,63,64],{},"Additionally, ensure that you organize flows into well-structured groups. To match my group organization, I have provided images of the flow for each section. Also, if a Link In node is present at the start, create the group starting from the Link In node and ending at the Link Out node.",[66,67,69],"h3",{"id":68},"prerequisites","Prerequisites",[10,71,72],{},"Before you begin building the OEE Dashboard with FlowFuse, make sure you have the following:",[74,75,76,89,100],"ul",{},[38,77,78,82,83,88],{},[79,80,81],"strong",{},"Running FlowFuse Instance:"," Make sure you have a FlowFuse instance set up and running. If you don't have an account, check out our ",[14,84,87],{"href":85,"rel":86},"https:\u002F\u002Fapp.flowfuse.com\u002Faccount\u002Fcreate",[23],"free trial"," and learn how to create an instance in FlowFuse.",[38,90,91,94,95,99],{},[79,92,93],{},"FlowFuse Dashboard:"," Ensure you have ",[14,96,24],{"href":97,"rel":98},"https:\u002F\u002Fflows.nodered.org\u002Fnode\u002F@flowfuse\u002Fnode-red-dashboard",[23]," (also known as Node-RED Dashboard 2.0 in the community) installed and properly configured on your instance.",[38,101,102,94,105,110],{},[79,103,104],{},"SQLite Contrib Node:",[14,106,109],{"href":107,"rel":108},"https:\u002F\u002Fflows.nodered.org\u002Fnode\u002Fnode-red-node-sqlite",[23],"node-red-contrib-sqlite"," installed.",[66,112,114],{"id":113},"preparing-simulated-data","Preparing Simulated Data",[10,116,117],{},"Before building the dashboard, we need a data source for production and downtime metrics. This data will serve as input for OEE calculations. We will focus on connecting a real source in the next part, but for now, let's generate simulated data.",[119,120],"render-flow",{":height":121,"flow":122},"300","W3siaWQiOiJmYTcxNDdlMDRkNGQ1ZWMzIiwidHlwZSI6InRhYiIsImxhYmVsIjoiU2ltdWxhdGVkIERhdGEgR2VuZXJhdGlvbiIsImRpc2FibGVkIjpmYWxzZSwiaW5mbyI6IiIsImVudiI6W119LHsiaWQiOiIzZjIxMjZjM2MwMGI5ZTBkIiwidHlwZSI6Imdyb3VwIiwieiI6ImZhNzE0N2UwNGQ0ZDVlYzMiLCJzdHlsZSI6eyJzdHJva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ICBjb25zdCBzaGlmdER1cmF0aW9uID0gODtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRvdGFsRG93bnRpbWVNaW51dGVzID0gMDtcbiAgICAgICAgICAgICAgICAgICAgbGV0IGRvd250aW1lRXZlbnRzID0gW107XG5cbiAgICAgICAgICAgICAgICAgICAgLy8gSW5jcmVhc2UgZG93bnRpbWUgZnJlcXVlbmN5ICh1cCB0byA0IGV2ZW50cyBwZXIgc2hpZnQpXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IG51bURvd250aW1lcyA9IE1hdGguZmxvb3IoTWF0aC5yYW5kb20oKSAqIDQpICsgMTtcblxuICAgICAgICAgICAgICAgICAgICBmb3IgKGxldCBkID0gMDsgZCA8IG51bURvd250aW1lczsgZCsrKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoTWF0aC5yYW5kb20oKSA8IDAuNzUpIHsgIC8vIEluY3JlYXNlIHByb2JhYmlsaXR5IG9mIGRvd250aW1lXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGRvd250aW1lTWludXRlcyA9IE1hdGguZmxvb3IoNSArIE1hdGgucmFuZG9tKCkgKiAxMCk7IC8vIFNob3J0ZXIgZG93bnRpbWVzICg1LTE1IG1pbnMpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdG90YWxEb3dudGltZU1pbnV0ZXMgKz0gZG93bnRpbWVNaW51dGVzO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgZG93bnRpbWVTdGFydE1pbnV0ZXMgPSBNYXRoLmZsb29yKE1hdGgucmFuZG9tKCkgKiAoc2hpZnREdXJhdGlvbiAqIDYwIC0gZG93bnRpbWVNaW51dGVzKSk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgZG93bnRpbWVTdGFydCA9IG5ldyBEYXRlKHNoaWZ0VGltZXN0YW1wKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb3dudGltZVN0YXJ0LnNldE1pbnV0ZXMoZG93bnRpbWVTdGFydC5nZXRNaW51dGVzKCkgKyBkb3dudGltZVN0YXJ0TWludXRlcyk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBkb3dudGltZUVuZCA9IG5ldyBEYXRlKGRvd250aW1lU3RhcnQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvd250aW1lRW5kLnNldE1pbnV0ZXMoZG93bnRpbWVFbmQuZ2V0TWludXRlcygpICsgZG93bnRpbWVNaW51dGVzKTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGRvd250aW1lVHlwZSA9IGRvd250aW1lVHlwZXNbTWF0aC5mbG9vcihNYXRoLnJhbmRvbSgpICogZG93bnRpbWVUeXBlcy5sZW5ndGgpXTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBkb3dudGltZVJlYXNvbiA9IGRvd250aW1lVHlwZSA9PT0gXCJQbGFubmVkXCJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBwbGFubmVkRG93bnRpbWVSZWFzb25zW01hdGguZmxvb3IoTWF0aC5yYW5kb20oKSAqIHBsYW5uZWREb3dudGltZVJlYXNvbnMubGVuZ3RoKV1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiB1bnBsYW5uZWREb3dudGltZVJlYXNvbnNbTWF0aC5mbG9vcihNYXRoLnJhbmRvbSgpICogdW5wbGFubmVkRG93bnRpbWVSZWFzb25zLmxlbmd0aCldO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZG93bnRpbWVFdmVudHMucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRpbWVzdGFtcDogbm9ybWFsaXplVGltZXN0YW1wKHNoaWZ0VGltZXN0YW1wKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYXJlYSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWFjaGluZV9uYW1lOiBzaG9ydE1hY2hpbmVOYW1lLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaGlmdCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG93bnRpbWVfc3RhcnQ6IG5vcm1hbGl6ZVRpbWVzdGFtcChkb3dudGltZVN0YXJ0KSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG93bnRpbWVfZW5kOiBub3JtYWxpemVUaW1lc3RhbXAoZG93bnRpbWVFbmQpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb3dudGltZV9kdXJhdGlvbl9taW51dGVzOiBkb3dudGltZU1pbnV0ZXMsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvd250aW1lX3JlYXNvbjogZG93bnRpbWVSZWFzb24sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvd250aW1lX3R5cGU6IGRvd250aW1lVHlwZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGluZTogYExpbmUtJHtpbmRleCArIDF9YFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgY29uc3Qgb3BlcmF0aW5nVGltZSA9IChzaGlmdER1cmF0aW9uICogNjAgLSB0b3RhbERvd250aW1lTWludXRlcykgKiA2MDtcbiAgICAgICAgICAgICAgICAgICAgbGV0IGVmZmljaWVuY3kgPSBNYXRoLnJhbmRvbSgpICogMC4yICsgMC43NTtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHRhcmdldE91dHB1dCA9IE1hdGguZmxvb3Iob3BlcmF0aW5nVGltZSAvIDMpIHx8IDE7XG4gICAgICAgICAgICAgICAgICAgIGxldCB0b3RhbFByb2R1Y2VkID0gTWF0aC5mbG9vcih0YXJnZXRPdXRwdXQgKiBlZmZpY2llbmN5KTtcbiAgICAgICAgICAgICAgICAgICAgdG90YWxQcm9kdWNlZCA9IE1hdGgubWluKHRvdGFsUHJvZHVjZWQsIHRhcmdldE91dHB1dCk7XG5cbiAgICAgICAgICAgICAgICAgICAgY29uc3QgZGVmZWN0UmF0ZSA9IE1hdGgucmFuZG9tKCkgKiAwLjAyICsgMC4wMTtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgZGVmZWN0VW5pdHMgPSBNYXRoLmZsb29yKHRvdGFsUHJvZHVjZWQgKiBkZWZlY3RSYXRlKTtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgZ29vZFVuaXRzID0gdG90YWxQcm9kdWNlZCAtIGRlZmVjdFVuaXRzO1xuXG4gICAgICAgICAgICAgICAgICAgIGRhdGEucHVzaCh7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aW1lc3RhbXA6IG5vcm1hbGl6ZVRpbWVzdGFtcChzaGlmdFRpbWVzdGFtcCksXG4gICAgICAgICAgICAgICAgICAgICAgICBhcmVhLFxuICAgICAgICAgICAgICAgICAgICAgICAgbWFjaGluZV9uYW1lOiBzaG9ydE1hY2hpbmVOYW1lLFxuICAgICAgICAgICAgICAgICAgICAgICAgc2hpZnQsXG4gICAgICAgICAgICAgICAgICAgICAgICBzaGlmdF9kdXJhdGlvbjogc2hpZnREdXJhdGlvbixcbiAgICAgICAgICAgICAgICAgICAgICAgIG9wZXJhdGluZ190aW1lOiBvcGVyYXRpbmdUaW1lIC0gdG90YWxEb3dudGltZU1pbnV0ZXMgKiA2MCxcbiAgICAgICAgICAgICAgICAgICAgICAgIGdvb2RfdW5pdHM6IGdvb2RVbml0cyxcbiAgICAgICAgICAgICAgICAgICAgICAgIGRlZmVjdF91bml0czogZGVmZWN0VW5pdHMsXG4gICAgICAgICAgICAgICAgICAgICAgICB0b3RhbF9wcm9kdWNlZF91bml0czogdG90YWxQcm9kdWNlZCxcbiAgICAgICAgICAgICAgICAgICAgICAgIHRhcmdldF9vdXRwdXQ6IHRhcmdldE91dH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MTQ3ZTA0ZDRkNWVjMyIsImciOiJjMDU1MGRiODdkNmZiOTQ3IiwibXlkYiI6IjFhZTZkN2Y3ZmRiNjAxOTEiLCJzcWxxdWVyeSI6Im1zZy50b3BpYyIsInNxbCI6IiIsIm5hbWUiOiIiLCJ4Ijo3MzAsInkiOjUyMCwid2lyZXMiOltbIjZkY2Q2OWFjZDU5OTA3OTMiXV19LHsiaWQiOiIxYWU2ZDdmN2ZkYjYwMTkxIiwidHlwZSI6InNxbGl0ZWRiIiwiZGIiOiJzcWxsaXRlIiwibW9kZSI6IlJXQyJ9XQ==",[35,124,125,128,135,146,157],{},[38,126,127],{},"Import the provided flow for data generation.",[38,129,130,131,134],{},"Click the ",[79,132,133],{},"Deploy"," button to activate the flow.",[38,136,137,138,142,143,61],{},"On deployment, it will create two SQLite tables: ",[139,140,141],"code",{},"ProductionData"," and ",[139,144,145],{},"DowntimeData",[38,147,148,149,152,153,61],{},"Find the ",[79,150,151],{},"Inject node"," labeled ",[154,155,156],"em",{},"Click to generate and insert demo data",[38,158,159],{},"Click the inject node to trigger data generation.",[10,161,162],{},"The flow will generate data with the following fields:",[10,164,165,171],{},[166,167],"img",{"alt":168,"dataZoomable":169,"src":170},"Demo Production and Downtime data object","","\u002Fblog\u002F2025\u002F04\u002Fimages\u002Fdemo-data-props.png",[154,172,168],{},[66,174,176],{"id":175},"collecting-and-configuring-data","Collecting and Configuring Data",[10,178,179],{},"Once the simulated data is generated and stored in SQLite, the next step is to create a flow for configuration settings. These settings will be used across the entire flow, allowing the flow to be reused by simply modifying the settings. The configured data will then be collected for use in the OEE dashboard.",[181,182,184],"h4",{"id":183},"adding-flow-to-configure-settings:","Adding flow to configure settings:",[35,186,187,194,200,235,249],{},[38,188,189,190,193],{},"Click on the ",[79,191,192],{},"\"+\""," to create a new flow.",[38,195,196,197,61],{},"Name the newly created flow to ",[79,198,199],{},"OEE Dashboard for Line-1",[38,201,202,203,206,207],{},"Drag a ",[79,204,205],{},"Change node"," onto the canvas, double-click it, and add the following elements:",[74,208,209,219,227],{},[38,210,211,212,215,216],{},"Set ",[139,213,214],{},"flow.line"," to ",[139,217,218],{},"\"Line-1\"",[38,220,211,221,215,224],{},[139,222,223],{},"flow.shift_duration",[139,225,226],{},"12",[38,228,211,229,215,232],{},[139,230,231],{},"flow.shiftDuration24h",[139,233,234],{},"24",[38,236,237,238,240,241,244,245,248],{},"Drag an ",[79,239,151],{},", set it to trigger on deploy by enabling ",[79,242,243],{},"Inject once after X seconds"," (set delay to ",[139,246,247],{},"0.1"," seconds).",[38,250,251,252,254],{},"Click ",[79,253,133],{}," to apply changes.",[10,256,257,258,261,262,265,266,269],{},"In this flow, we are configuring the production line based on the demo data, specifically for ",[79,259,260],{},"Line-1",", as we are building the OEE dashboard for this line. The settings define the shift duration for the last ",[79,263,264],{},"X"," hours used in OEE calculations and the total shift duration within a ",[79,267,268],{},"24-hour"," period.",[10,271,272,276],{},[166,273],{"alt":274,"dataZoomable":169,"src":275},"Flow to set basic configuration settings that will be used across the OEE dashboard flow for calculations.","\u002Fblog\u002F2025\u002F04\u002Fimages\u002Fconfiguration-flow.png",[154,277,274],{},[181,279,281],{"id":280},"retrieving-data-from-sqlite:","Retrieving Data from SQLite:",[35,283,284,289,327,361,374,377,401,412,415],{},[38,285,237,286,288],{},[79,287,151],{}," and configure it to trigger at regular intervals.",[38,290,202,291,293,294],{},[79,292,205],{}," and add following elements:",[74,295,296,304,312,320],{},[38,297,211,298,215,301],{},[139,299,300],{},"msg.params",[139,302,303],{},"{}",[38,305,211,306,215,309],{},[139,307,308],{},"msg.params.$startTime",[139,310,311],{},"$moment($millis() - ($number($flowContext('shift_duration')) * 60 * 60 * 1000)).format('YYYY-MM-DD HH:mm:ss')",[38,313,211,314,215,317],{},[139,315,316],{},"msg.params.$endTime",[139,318,319],{},"$moment($millis()).format('YYYY-MM-DD HH:mm:ss')",[38,321,211,322,215,325],{},[139,323,324],{},"msg.params.$line",[139,326,214],{},[38,328,237,329,332,333],{},[79,330,331],{},"SQLite node"," and insert the following query:",[334,335,339],"pre",{"className":336,"code":337,"language":338,"meta":169,"style":169},"language-sql shiki shiki-themes github-light github-dark","SELECT timestamp, machine_name, area, line, total_produced_units, good_units, defect_units, target_output\nFROM ProductionData\nWHERE timestamp BETWEEN $startTime AND $endTime AND line = $line;\n","sql",[139,340,341,349,355],{"__ignoreMap":169},[342,343,346],"span",{"class":344,"line":345},"line",1,[342,347,348],{},"SELECT timestamp, machine_name, area, line, total_produced_units, good_units, defect_units, target_output\n",[342,350,352],{"class":344,"line":351},2,[342,353,354],{},"FROM ProductionData\n",[342,356,358],{"class":344,"line":357},3,[342,359,360],{},"WHERE timestamp BETWEEN $startTime AND $endTime AND line = $line;\n",[38,362,363,364],{},"Drag a Change node onto the canvas and set the following element to store the retrived production data result as new property:",[74,365,366],{},[38,367,211,368,215,371],{},[139,369,370],{},"msg.payload",[139,372,373],{},"msg.productionData",[38,375,376],{},"Connect the Inject node’s output to the input of the Change node that sets parameters. Then, connect the Change node’s output to the input of the SQLite node that retrieves production data. Finally, connect the SQLite node’s output to the input of last change node we added.",[38,378,379,380,332,382],{},"Drag another ",[79,381,331],{},[334,383,385],{"className":336,"code":384,"language":338,"meta":169,"style":169},"SELECT timestamp, machine_name, downtime_start, downtime_duration_minutes, downtime_reason\nFROM DowntimeData\nWHERE timestamp BETWEEN $startTime AND $endTime AND line = $line;\n",[139,386,387,392,397],{"__ignoreMap":169},[342,388,389],{"class":344,"line":345},[342,390,391],{},"SELECT timestamp, machine_name, downtime_start, downtime_duration_minutes, downtime_reason\n",[342,393,394],{"class":344,"line":351},[342,395,396],{},"FROM DowntimeData\n",[342,398,399],{"class":344,"line":357},[342,400,360],{},[38,402,363,403],{},[74,404,405],{},[38,406,211,407,215,409],{},[139,408,370],{},[139,410,411],{},"msg.downtimeData",[38,413,414],{},"Connect the SQLite node’s output to the input of last change node we added.",[38,416,417],{},"Now, drag the Link Out node onto the canvas and connect it to the last Change node.",[10,419,420,424],{},[166,421],{"alt":422,"dataZoomable":169,"src":423},"Flow that retrives the data from the sqlite table","\u002Fblog\u002F2025\u002F04\u002Fimages\u002Fsqlite-flow.png",[154,425,422],{},[66,427,429],{"id":428},"preparing-data-for-oee-calculations","Preparing Data for OEE Calculations",[10,431,432],{},"Now that we have a flow to retrieve production and downtime data, we can calculate key OEE metrics. The total number of good units, defective units, total produced units, target output, and downtime duration are summed across all production lines. Using these values, we can calculate availability, performance, and quality for the entire production system, which can then be used to calculate OEE.",[35,434,435,445,474,494,521,544,551,574,596,603,609,630,649],{},[38,436,437,438,441,442,61],{},"Drag the ",[79,439,440],{},"link in node"," onto the canvas and connect it to the ",[79,443,444],{},"link out node",[38,446,447,448,451,452,455,456],{},"Drag two ",[79,449,450],{},"Change nodes"," onto the canvas and connect them to the ",[79,453,454],{},"Link In"," node.",[74,457,458,466],{},[38,459,460,461,215,463,61],{},"In the first Change node, set ",[139,462,370],{},[139,464,465],{},"production_data",[38,467,468,469,215,471,61],{},"In the second Change node, set ",[139,470,370],{},[139,472,473],{},"downtime_data",[38,475,202,476,479,480,482,483,485,486,488,489,491,492,61],{},[79,477,478],{},"Split node"," onto the canvas and connect it to the first ",[79,481,205],{},", the one setting ",[139,484,465],{},". Configure the ",[79,487,478],{}," so that ",[139,490,370],{}," is assigned to ",[139,493,465],{},[38,495,496,497,451,500,502,503,506,507],{},"Drag three ",[79,498,499],{},"Join nodes",[79,501,478],{}," to sum individual data points. Configure each ",[79,504,505],{},"Join node"," with the following settings:",[74,508,509,512,515],{},[38,510,511],{},"Mode: Reduce Sequence",[38,513,514],{},"Initial Value: 0",[38,516,517,518],{},"Fix-up Expression: ",[139,519,520],{},"$A",[38,522,523,524],{},"Set the reduce expressions as follows:",[74,525,526,532,538],{},[38,527,528,529],{},"First Join Node: ",[139,530,531],{},"$A + msg.payload.total_produced_units",[38,533,534,535],{},"Second Join Node: ",[139,536,537],{},"$A + msg.payload.good_units",[38,539,540,541],{},"Third Join Node: ",[139,542,543],{},"$A + msg.payload.target_output",[38,545,496,546,548,549,61],{},[79,547,450],{}," onto the canvas and connect each to a ",[79,550,505],{},[38,552,553,554,556,557],{},"Configure these ",[79,555,450],{}," to store the summed values using the following variables to flow context:",[74,558,559,564,569],{},[38,560,561],{},[139,562,563],{},"total_produced_units",[38,565,566],{},[139,567,568],{},"total_good_units",[38,570,571],{},[139,572,573],{},"total_target_output",[38,575,202,576,441,579,581,582,584,585,587,588],{},[79,577,578],{},"Switch node",[79,580,205],{}," that sets the retrieved downtime data to ",[139,583,370],{},", for switch node set the Property to ",[139,586,370],{}," and add the following conditions:",[74,589,590,593],{},[38,591,592],{},"is not empty.",[38,594,595],{},"Otherwise.",[38,597,202,598,600,601,61],{},[79,599,478],{}," onto the canvas and connect it to the first output of the ",[79,602,578],{},[38,604,202,605,441,607,61],{},[79,606,505],{},[79,608,478],{},[38,610,611,612,506,614],{},"Configure the ",[79,613,505],{},[74,615,616,618,620,624],{},[38,617,511],{},[38,619,514],{},[38,621,517,622],{},[139,623,520],{},[38,625,626,627],{},"Reduce Expression: ",[139,628,629],{},"$A + payload.downtime_duration_minutes",[38,631,202,632,441,634,636,637,639,640],{},[79,633,205],{},[79,635,505],{},", Configure this ",[79,638,205],{}," to store the total downtime duration in the flow context with following element:",[74,641,642],{},[38,643,211,644,215,647],{},[139,645,646],{},"flow.total_downtime",[139,648,370],{},[38,650,651],{},"Drag another Change node onto the canvas and connect it to the second output of the Switch node, Set this Change node to store 0 in the flow context for total_downtime with following element:",[74,653,654],{},[38,655,211,656,658],{},[139,657,646],{}," to 0",[35,660,662],{"start":661},14,[38,663,202,664,667],{},[79,665,666],{},"Link Out"," node onto the canvas and connect it to any of the Change nodes that store the summed metrics in the flow context.",[10,669,670,674],{},[166,671],{"alt":672,"dataZoomable":169,"src":673},"Flow to prepare the data necessary to calculate OEE and all its three components.","\u002Fblog\u002F2025\u002F04\u002Fimages\u002Fpreparing-data-flow.png",[154,675,672],{},[66,677,679],{"id":678},"calculating-oee-and-key-metrics","Calculating OEE and Key Metrics",[10,681,682],{},"Now that we have all the necessary pieces, we can calculate the key metrics for OEE: Availability, Performance, and Quality and later OEE.",[35,684,685,690,873,881,890],{},[38,686,202,687,61],{},[79,688,689],{},"Link In node",[38,691,202,692,694,695,757],{},[79,693,205],{}," and add element as following:",[74,696,697,706,714,722,730,738,745,752],{},[38,698,211,699,215,702,705],{},[139,700,701],{},"msg.quality",[139,703,704],{},"($flowContext('total_good_units') \u002F $flowContext('total_produced_units')) * 100"," as JSONata expression.",[38,707,211,708,215,711,705],{},[139,709,710],{},"msg.availability",[139,712,713],{},"(($flowContext('shift_duration') - $flowContext('total_downtime')) \u002F $flowContext('shift_duration')) * 100",[38,715,211,716,215,719,705],{},[139,717,718],{},"msg.performance",[139,720,721],{},"($flowContext('total_produced_units') \u002F $flowContext('target_output')) * 100",[38,723,211,724,215,727,705],{},[139,725,726],{},"msg.oee",[139,728,729],{},"$round(((msg.availability \u002F 100) * (msg.performance \u002F 100) * (msg.quality \u002F 100)) * 100, 2)",[38,731,211,732,734,735],{},[139,733,701],{},"to ",[139,736,737],{},"$round(msg.quality, 2)",[38,739,211,740,215,742],{},[139,741,710],{},[139,743,744],{},"$round(msg.availability, 2)",[38,746,211,747,215,749],{},[139,748,718],{},[139,750,751],{},"$round(msg.performance, 2)",[38,753,211,754,756],{},[139,755,373],{}," to JSONata expression:",[334,758,762],{"className":759,"code":760,"language":761,"meta":169,"style":169},"language-json shiki shiki-themes github-light github-dark","[\n{\n    \"reason\": \"Total Good Units Produced\",\n    \"units\": $flowContext(\"total_good_units\")\n  },\n  {\n    \"series\": \"Total Defective Units Produced\",\n    \"units\": $number($flowContext(\"total_produced_units\")) - $number($flowContext(\"total_good_units\"))\n  }\n]\n","json",[139,763,764,770,775,791,809,815,821,834,861,867],{"__ignoreMap":169},[342,765,766],{"class":344,"line":345},[342,767,769],{"class":768},"sVt8B","[\n",[342,771,772],{"class":344,"line":351},[342,773,774],{"class":768},"{\n",[342,776,777,781,784,788],{"class":344,"line":357},[342,778,780],{"class":779},"sj4cs","    \"reason\"",[342,782,783],{"class":768},": ",[342,785,787],{"class":786},"sZZnC","\"Total Good Units Produced\"",[342,789,790],{"class":768},",\n",[342,792,794,797,799,803,806],{"class":344,"line":793},4,[342,795,796],{"class":779},"    \"units\"",[342,798,783],{"class":768},[342,800,802],{"class":801},"s7hpK","$flowContext(",[342,804,805],{"class":786},"\"total_good_units\"",[342,807,808],{"class":801},")\n",[342,810,812],{"class":344,"line":811},5,[342,813,814],{"class":768},"  },\n",[342,816,818],{"class":344,"line":817},6,[342,819,820],{"class":768},"  {\n",[342,822,824,827,829,832],{"class":344,"line":823},7,[342,825,826],{"class":779},"    \"series\"",[342,828,783],{"class":768},[342,830,831],{"class":786},"\"Total Defective Units Produced\"",[342,833,790],{"class":768},[342,835,837,839,841,844,847,850,853,856,858],{"class":344,"line":836},8,[342,838,796],{"class":779},[342,840,783],{"class":768},[342,842,843],{"class":801},"$number($flowContext(",[342,845,846],{"class":786},"\"total_produced_units\"",[342,848,849],{"class":801},"))",[342,851,852],{"class":801}," -",[342,854,855],{"class":801}," $number($flowContext(",[342,857,805],{"class":786},[342,859,860],{"class":801},"))\n",[342,862,864],{"class":344,"line":863},9,[342,865,866],{"class":768},"  }\n",[342,868,870],{"class":344,"line":869},10,[342,871,872],{"class":768},"]\n",[38,874,202,875,878,879,61],{},[79,876,877],{},"Link Out node"," and connect it to the ",[79,880,205],{},[38,882,883,884,886,887,889],{},"Drag a separate ",[79,885,454],{}," node for visualization and keep it in a separate flow. This will be the ",[79,888,454],{}," node where all the calculated final data for visualization will be stored.",[38,891,892,893,896,897,455],{},"Connect ",[79,894,895],{},"link out"," node to this ",[79,898,899],{},"link in",[10,901,902,906],{},[166,903],{"alt":904,"dataZoomable":169,"src":905},"Flow that calculates availability, quality, performance, and OEE, and also prepares production data for visualization.","\u002Fblog\u002F2025\u002F04\u002Fimages\u002Fcalculate-oee-and-key-metrics.png",[154,907,904],{},[66,909,911],{"id":910},"detailed-breakdown-of-oee-data","Detailed Breakdown of OEE Data",[10,913,914],{},"We have calculated the OEE and other key metrics. However, as discussed in the planning section of our previous article, we will also visualize recent downtime events, a downtime summary, the top underperforming machines (OEE-wise), and the OEE trend over the last 30 days on the dashboard.",[10,916,917],{},"Let’s do that.",[35,919,920,929],{},[38,921,437,922,441,924,926,927,61],{},[79,923,440],{},[79,925,444],{}," that is part of the SQLite flow, which is also connected to the change node that sets the retrieved downtime result to ",[139,928,370],{},[38,930,202,931,934,935,61],{},[79,932,933],{},"change node"," onto the canvas and set the following element: ",[139,936,937],{},"Set msg.downtime_data to msg.payload",[181,939,941],{"id":940},"downtime-summary","Downtime Summary",[35,943,944],{},[38,945,202,946,949],{},[79,947,948],{},"function node"," onto the canvas and add the following JavaScript to calculate the downtime summary:",[334,951,955],{"className":952,"code":953,"language":954,"meta":169,"style":169},"language-javascript shiki shiki-themes github-light github-dark","function calculateDowntimeByReason(downtimeData) {\n   if (!Array.isArray(downtimeData) || downtimeData.length === 0) {\n       return []; f\n   }\n   const summary = {};\n   downtimeData.forEach(({ downtime_reason, downtime_duration_minutes }) => {\n       summary[downtime_reason] = (summary[downtime_reason] || 0) + downtime_duration_minutes;\n   });\n   return Object.entries(summary).map(([reason, duration]) => ({\n       downtime_reason: reason,\n       downtime_duration_minutes: duration\n   }));\n}\nmsg.payload = calculateDowntimeByReason(msg.payload) || [];\nreturn msg;\n","javascript",[139,956,957,977,1014,1022,1027,1041,1070,1094,1099,1135,1140,1146,1152,1158,1175],{"__ignoreMap":169},[342,958,959,963,967,970,974],{"class":344,"line":345},[342,960,962],{"class":961},"szBVR","function",[342,964,966],{"class":965},"sScJk"," calculateDowntimeByReason",[342,968,969],{"class":768},"(",[342,971,973],{"class":972},"s4XuR","downtimeData",[342,975,976],{"class":768},") {\n",[342,978,979,982,985,988,991,994,997,1000,1003,1006,1009,1012],{"class":344,"line":351},[342,980,981],{"class":961},"   if",[342,983,984],{"class":768}," (",[342,986,987],{"class":961},"!",[342,989,990],{"class":768},"Array.",[342,992,993],{"class":965},"isArray",[342,995,996],{"class":768},"(downtimeData) ",[342,998,999],{"class":961},"||",[342,1001,1002],{"class":768}," downtimeData.",[342,1004,1005],{"class":779},"length",[342,1007,1008],{"class":961}," ===",[342,1010,1011],{"class":779}," 0",[342,1013,976],{"class":768},[342,1015,1016,1019],{"class":344,"line":357},[342,1017,1018],{"class":961},"       return",[342,1020,1021],{"class":768}," []; f\n",[342,1023,1024],{"class":344,"line":793},[342,1025,1026],{"class":768},"   }\n",[342,1028,1029,1032,1035,1038],{"class":344,"line":811},[342,1030,1031],{"class":961},"   const",[342,1033,1034],{"class":779}," summary",[342,1036,1037],{"class":961}," =",[342,1039,1040],{"class":768}," {};\n",[342,1042,1043,1046,1049,1052,1055,1058,1061,1064,1067],{"class":344,"line":817},[342,1044,1045],{"class":768},"   downtimeData.",[342,1047,1048],{"class":965},"forEach",[342,1050,1051],{"class":768},"(({ ",[342,1053,1054],{"class":972},"downtime_reason",[342,1056,1057],{"class":768},", ",[342,1059,1060],{"class":972},"downtime_duration_minutes",[342,1062,1063],{"class":768}," }) ",[342,1065,1066],{"class":961},"=>",[342,1068,1069],{"class":768}," {\n",[342,1071,1072,1075,1078,1081,1083,1085,1088,1091],{"class":344,"line":823},[342,1073,1074],{"class":768},"       summary[downtime_reason] ",[342,1076,1077],{"class":961},"=",[342,1079,1080],{"class":768}," (summary[downtime_reason] ",[342,1082,999],{"class":961},[342,1084,1011],{"class":779},[342,1086,1087],{"class":768},") ",[342,1089,1090],{"class":961},"+",[342,1092,1093],{"class":768}," downtime_duration_minutes;\n",[342,1095,1096],{"class":344,"line":836},[342,1097,1098],{"class":768},"   });\n",[342,1100,1101,1104,1107,1110,1113,1116,1119,1122,1124,1127,1130,1132],{"class":344,"line":863},[342,1102,1103],{"class":961},"   return",[342,1105,1106],{"class":768}," Object.",[342,1108,1109],{"class":965},"entries",[342,1111,1112],{"class":768},"(summary).",[342,1114,1115],{"class":965},"map",[342,1117,1118],{"class":768},"(([",[342,1120,1121],{"class":972},"reason",[342,1123,1057],{"class":768},[342,1125,1126],{"class":972},"duration",[342,1128,1129],{"class":768},"]) ",[342,1131,1066],{"class":961},[342,1133,1134],{"class":768}," ({\n",[342,1136,1137],{"class":344,"line":869},[342,1138,1139],{"class":768},"       downtime_reason: reason,\n",[342,1141,1143],{"class":344,"line":1142},11,[342,1144,1145],{"class":768},"       downtime_duration_minutes: duration\n",[342,1147,1149],{"class":344,"line":1148},12,[342,1150,1151],{"class":768},"   }));\n",[342,1153,1155],{"class":344,"line":1154},13,[342,1156,1157],{"class":768},"}\n",[342,1159,1160,1163,1165,1167,1170,1172],{"class":344,"line":661},[342,1161,1162],{"class":768},"msg.payload ",[342,1164,1077],{"class":961},[342,1166,966],{"class":965},[342,1168,1169],{"class":768},"(msg.payload) ",[342,1171,999],{"class":961},[342,1173,1174],{"class":768}," [];\n",[342,1176,1178,1181],{"class":344,"line":1177},15,[342,1179,1180],{"class":961},"return",[342,1182,1183],{"class":768}," msg;\n",[35,1185,1186,1200,1210],{"start":351},[38,1187,202,1188,1190,1191],{},[79,1189,933],{}," onto the canvas and set:",[74,1192,1193],{},[38,1194,211,1195,215,1197,61],{},[139,1196,370],{},[139,1198,1199],{},"msg.downtimeSummary",[38,1201,202,1202,1204,1205,215,1208,61],{},[79,1203,895],{}," node and connect it to the change node that sets ",[139,1206,1207],{},"msg.downtime_data",[139,1209,370],{},[38,1211,1212,1213,1215,1216,1218],{},"Connect this ",[79,1214,444],{}," to the ",[79,1217,440],{}," that we added earlier to receive all the calculated metrics for visualization.",[181,1220,1222],{"id":1221},"recent-downtime","Recent Downtime",[35,1224,1225,1246,1258,1284,1296,1315],{},[38,1226,202,1227,1230,1231,1233,1234],{},[79,1228,1229],{},"Switch"," node onto the canvas and set the property to ",[79,1232,370],{},". Add the following condition:",[74,1235,1236,1241],{},[38,1237,1238],{},[79,1239,1240],{},"is not empty",[38,1242,1243],{},[79,1244,1245],{},"otherwise",[38,1247,202,1248,1251,1252,1255,1256,455],{},[79,1249,1250],{},"Split"," node onto the canvas and connect it to the ",[79,1253,1254],{},"first output"," of the ",[79,1257,1229],{},[38,1259,202,1260,1251,1263,1265,1266,1269,1270,1275,1276,1279,1280,1283],{},[79,1261,1262],{},"Sort",[79,1264,1250],{}," node. Set the sort to ",[79,1267,1268],{},"\"message sequence\"",", key to ",[79,1271,1272],{},[139,1273,1274],{},"msg.payload.downtime_start",", and order to ",[79,1277,1278],{},"\"descending.\""," This will sort the downtime data from ",[79,1281,1282],{},"most recent to oldest"," based on its start time.",[38,1285,202,1286,1289,1290,1293,1294,455],{},[79,1287,1288],{},"Join"," node onto the canvas and set the mode to ",[79,1291,1292],{},"automatic",", then connect it to the ",[79,1295,1262],{},[38,1297,202,1298,1301,1302],{},[79,1299,1300],{},"Change"," node onto the canvas and set the following element:",[74,1303,1304],{},[38,1305,1306],{},[79,1307,211,1308,215,1311,1314],{},[139,1309,1310],{},"msg.recentDowntime",[139,1312,1313],{},"payload^(10)"," as a JSONata expression.",[38,1316,1317,1318,1320,1321,1323],{},"Connect the ",[79,1319,1300],{}," node to the ",[79,1322,666],{}," node that was added before.",[181,1325,1327],{"id":1326},"top-underperforming-machines","Top Underperforming Machines",[35,1329,1330,1341],{},[38,1331,202,1332,1251,1335,1337,1338,61],{},[79,1333,1334],{},"Function",[79,1336,454],{}," node that is receiving the ",[79,1339,1340],{},"SQLite result",[38,1342,1343,1344,1347,1348,1350],{},"Add the following ",[79,1345,1346],{},"JavaScript"," code to the ",[79,1349,1334],{}," node:",[334,1352,1354],{"className":952,"code":1353,"language":954,"meta":169,"style":169},"const productionData = msg.production_data;\nconst downtimeEvents = msg.downtime_data;\nconst shiftDuration = (flow.get('shift_duration') || 1) * 60; \u002F\u002F Convert hours to minutes\n\n\u002F\u002F Group production data by machine (including area)\nlet machineData = {};\nproductionData.forEach(data => {\n    if (!machineData[data.machine_name]) {\n        machineData[data.machine_name] = {\n            total_produced_units: 0,\n            good_units: 0,\n            target_output: 0,\n            count: 0,\n            area: data.area \u002F\u002F Store area\n        };\n    }\n    machineData[data.machine_name].total_produced_units += data.total_produced_units;\n    machineData[data.machine_name].good_units += data.good_units;\n    machineData[data.machine_name].target_output += data.target_output;\n    machineData[data.machine_name].count += 1;\n});\n\nlet oeeResults = Object.keys(machineData).map(machineName => {\n    let data = machineData[machineName];\n\n    let machineDowntime = downtimeEvents.filter(event => event.machine_name === machineName);\n\n    function calculateOEE(data, downtime) {\n        if (data.target_output === 0) {\n            return { availability: 0, performance: 0, quality: 0, oee: 0 };\n        }\n\n        let totalDowntime = downtime.reduce((acc, event) =>\n            typeof event.downtime_duration_minutes === 'number' ? acc + event.downtime_duration_minutes : acc\n            , 0);\n\n        let availability = (shiftDuration - totalDowntime) \u002F shiftDuration;\n        availability = Math.max(0, Math.min(1, availability));\n\n        let performance = data.target_output > 0 ? data.total_produced_units \u002F data.target_output : 0;\n        let quality = data.total_produced_units > 0 ? data.good_units \u002F data.total_produced_units : 0;\n\n        let oee = availability * performance * quality;\n\n        return {\n            availability: parseFloat((availability * 100).toFixed(2)),\n            performance: parseFloat((performance * 100).toFixed(2)),\n            quality: parseFloat((quality * 100).toFixed(2)),\n            oee: parseFloat((oee * 100).toFixed(2))\n        };\n    }\n\n    let metrics = calculateOEE(data, machineDowntime);\n\n    return {\n        machine_name: machineName,\n        area: data.area,\n        oee: metrics.oee\n    };\n});\n\n\u002F\u002F Filter only machines with OEE \u003C 85\nmsg.payload = oeeResults.filter(machine => machine.oee \u003C 85);\n\nreturn msg;\n",[139,1355,1356,1369,1381,1423,1429,1434,1446,1463,1475,1484,1494,1503,1512,1521,1529,1534,1540,1552,1563,1574,1587,1593,1598,1627,1641,1646,1678,1683,1703,1718,1747,1753,1758,1790,1820,1831,1836,1861,1893,1898,1931,1962,1967,1988,1993,2001,2032,2057,2082,2107,2112,2117,2122,2137,2142,2150,2156,2162,2168,2174,2179,2184,2190,2220,2225],{"__ignoreMap":169},[342,1357,1358,1361,1364,1366],{"class":344,"line":345},[342,1359,1360],{"class":961},"const",[342,1362,1363],{"class":779}," productionData",[342,1365,1037],{"class":961},[342,1367,1368],{"class":768}," msg.production_data;\n",[342,1370,1371,1373,1376,1378],{"class":344,"line":351},[342,1372,1360],{"class":961},[342,1374,1375],{"class":779}," downtimeEvents",[342,1377,1037],{"class":961},[342,1379,1380],{"class":768}," msg.downtime_data;\n",[342,1382,1383,1385,1388,1390,1393,1396,1398,1401,1403,1405,1408,1410,1413,1416,1419],{"class":344,"line":357},[342,1384,1360],{"class":961},[342,1386,1387],{"class":779}," shiftDuration",[342,1389,1037],{"class":961},[342,1391,1392],{"class":768}," (flow.",[342,1394,1395],{"class":965},"get",[342,1397,969],{"class":768},[342,1399,1400],{"class":786},"'shift_duration'",[342,1402,1087],{"class":768},[342,1404,999],{"class":961},[342,1406,1407],{"class":779}," 1",[342,1409,1087],{"class":768},[342,1411,1412],{"class":961},"*",[342,1414,1415],{"class":779}," 60",[342,1417,1418],{"class":768},"; ",[342,1420,1422],{"class":1421},"sJ8bj","\u002F\u002F Convert hours to minutes\n",[342,1424,1425],{"class":344,"line":793},[342,1426,1428],{"emptyLinePlaceholder":1427},true,"\n",[342,1430,1431],{"class":344,"line":811},[342,1432,1433],{"class":1421},"\u002F\u002F Group production data by machine (including area)\n",[342,1435,1436,1439,1442,1444],{"class":344,"line":817},[342,1437,1438],{"class":961},"let",[342,1440,1441],{"class":768}," machineData ",[342,1443,1077],{"class":961},[342,1445,1040],{"class":768},[342,1447,1448,1451,1453,1455,1458,1461],{"class":344,"line":823},[342,1449,1450],{"class":768},"productionData.",[342,1452,1048],{"class":965},[342,1454,969],{"class":768},[342,1456,1457],{"class":972},"data",[342,1459,1460],{"class":961}," =>",[342,1462,1069],{"class":768},[342,1464,1465,1468,1470,1472],{"class":344,"line":836},[342,1466,1467],{"class":961},"    if",[342,1469,984],{"class":768},[342,1471,987],{"class":961},[342,1473,1474],{"class":768},"machineData[data.machine_name]) {\n",[342,1476,1477,1480,1482],{"class":344,"line":863},[342,1478,1479],{"class":768},"        machineData[data.machine_name] ",[342,1481,1077],{"class":961},[342,1483,1069],{"class":768},[342,1485,1486,1489,1492],{"class":344,"line":869},[342,1487,1488],{"class":768},"            total_produced_units: ",[342,1490,1491],{"class":779},"0",[342,1493,790],{"class":768},[342,1495,1496,1499,1501],{"class":344,"line":1142},[342,1497,1498],{"class":768},"            good_units: ",[342,1500,1491],{"class":779},[342,1502,790],{"class":768},[342,1504,1505,1508,1510],{"class":344,"line":1148},[342,1506,1507],{"class":768},"            target_output: ",[342,1509,1491],{"class":779},[342,1511,790],{"class":768},[342,1513,1514,1517,1519],{"class":344,"line":1154},[342,1515,1516],{"class":768},"            count: ",[342,1518,1491],{"class":779},[342,1520,790],{"class":768},[342,1522,1523,1526],{"class":344,"line":661},[342,1524,1525],{"class":768},"            area: data.area ",[342,1527,1528],{"class":1421},"\u002F\u002F Store area\n",[342,1530,1531],{"class":344,"line":1177},[342,1532,1533],{"class":768},"        };\n",[342,1535,1537],{"class":344,"line":1536},16,[342,1538,1539],{"class":768},"    }\n",[342,1541,1543,1546,1549],{"class":344,"line":1542},17,[342,1544,1545],{"class":768},"    machineData[data.machine_name].total_produced_units ",[342,1547,1548],{"class":961},"+=",[342,1550,1551],{"class":768}," data.total_produced_units;\n",[342,1553,1555,1558,1560],{"class":344,"line":1554},18,[342,1556,1557],{"class":768},"    machineData[data.machine_name].good_units ",[342,1559,1548],{"class":961},[342,1561,1562],{"class":768}," data.good_units;\n",[342,1564,1566,1569,1571],{"class":344,"line":1565},19,[342,1567,1568],{"class":768},"    machineData[data.machine_name].target_output ",[342,1570,1548],{"class":961},[342,1572,1573],{"class":768}," data.target_output;\n",[342,1575,1577,1580,1582,1584],{"class":344,"line":1576},20,[342,1578,1579],{"class":768},"    machineData[data.machine_name].count ",[342,1581,1548],{"class":961},[342,1583,1407],{"class":779},[342,1585,1586],{"class":768},";\n",[342,1588,1590],{"class":344,"line":1589},21,[342,1591,1592],{"class":768},"});\n",[342,1594,1596],{"class":344,"line":1595},22,[342,1597,1428],{"emptyLinePlaceholder":1427},[342,1599,1601,1603,1606,1608,1610,1613,1616,1618,1620,1623,1625],{"class":344,"line":1600},23,[342,1602,1438],{"class":961},[342,1604,1605],{"class":768}," oeeResults ",[342,1607,1077],{"class":961},[342,1609,1106],{"class":768},[342,1611,1612],{"class":965},"keys",[342,1614,1615],{"class":768},"(machineData).",[342,1617,1115],{"class":965},[342,1619,969],{"class":768},[342,1621,1622],{"class":972},"machineName",[342,1624,1460],{"class":961},[342,1626,1069],{"class":768},[342,1628,1630,1633,1636,1638],{"class":344,"line":1629},24,[342,1631,1632],{"class":961},"    let",[342,1634,1635],{"class":768}," data ",[342,1637,1077],{"class":961},[342,1639,1640],{"class":768}," machineData[machineName];\n",[342,1642,1644],{"class":344,"line":1643},25,[342,1645,1428],{"emptyLinePlaceholder":1427},[342,1647,1649,1651,1654,1656,1659,1662,1664,1667,1669,1672,1675],{"class":344,"line":1648},26,[342,1650,1632],{"class":961},[342,1652,1653],{"class":768}," machineDowntime ",[342,1655,1077],{"class":961},[342,1657,1658],{"class":768}," downtimeEvents.",[342,1660,1661],{"class":965},"filter",[342,1663,969],{"class":768},[342,1665,1666],{"class":972},"event",[342,1668,1460],{"class":961},[342,1670,1671],{"class":768}," event.machine_name ",[342,1673,1674],{"class":961},"===",[342,1676,1677],{"class":768}," machineName);\n",[342,1679,1681],{"class":344,"line":1680},27,[342,1682,1428],{"emptyLinePlaceholder":1427},[342,1684,1686,1689,1692,1694,1696,1698,1701],{"class":344,"line":1685},28,[342,1687,1688],{"class":961},"    function",[342,1690,1691],{"class":965}," calculateOEE",[342,1693,969],{"class":768},[342,1695,1457],{"class":972},[342,1697,1057],{"class":768},[342,1699,1700],{"class":972},"downtime",[342,1702,976],{"class":768},[342,1704,1706,1709,1712,1714,1716],{"class":344,"line":1705},29,[342,1707,1708],{"class":961},"        if",[342,1710,1711],{"class":768}," (data.target_output ",[342,1713,1674],{"class":961},[342,1715,1011],{"class":779},[342,1717,976],{"class":768},[342,1719,1721,1724,1727,1729,1732,1734,1737,1739,1742,1744],{"class":344,"line":1720},30,[342,1722,1723],{"class":961},"            return",[342,1725,1726],{"class":768}," { availability: ",[342,1728,1491],{"class":779},[342,1730,1731],{"class":768},", performance: ",[342,1733,1491],{"class":779},[342,1735,1736],{"class":768},", quality: ",[342,1738,1491],{"class":779},[342,1740,1741],{"class":768},", oee: ",[342,1743,1491],{"class":779},[342,1745,1746],{"class":768}," };\n",[342,1748,1750],{"class":344,"line":1749},31,[342,1751,1752],{"class":768},"        }\n",[342,1754,1756],{"class":344,"line":1755},32,[342,1757,1428],{"emptyLinePlaceholder":1427},[342,1759,1761,1764,1767,1769,1772,1775,1778,1781,1783,1785,1787],{"class":344,"line":1760},33,[342,1762,1763],{"class":961},"        let",[342,1765,1766],{"class":768}," totalDowntime ",[342,1768,1077],{"class":961},[342,1770,1771],{"class":768}," downtime.",[342,1773,1774],{"class":965},"reduce",[342,1776,1777],{"class":768},"((",[342,1779,1780],{"class":972},"acc",[342,1782,1057],{"class":768},[342,1784,1666],{"class":972},[342,1786,1087],{"class":768},[342,1788,1789],{"class":961},"=>\n",[342,1791,1793,1796,1799,1801,1804,1807,1810,1812,1814,1817],{"class":344,"line":1792},34,[342,1794,1795],{"class":961},"            typeof",[342,1797,1798],{"class":768}," event.downtime_duration_minutes ",[342,1800,1674],{"class":961},[342,1802,1803],{"class":786}," 'number'",[342,1805,1806],{"class":961}," ?",[342,1808,1809],{"class":768}," acc ",[342,1811,1090],{"class":961},[342,1813,1798],{"class":768},[342,1815,1816],{"class":961},":",[342,1818,1819],{"class":768}," acc\n",[342,1821,1823,1826,1828],{"class":344,"line":1822},35,[342,1824,1825],{"class":768},"            , ",[342,1827,1491],{"class":779},[342,1829,1830],{"class":768},");\n",[342,1832,1834],{"class":344,"line":1833},36,[342,1835,1428],{"emptyLinePlaceholder":1427},[342,1837,1839,1841,1844,1846,1849,1852,1855,1858],{"class":344,"line":1838},37,[342,1840,1763],{"class":961},[342,1842,1843],{"class":768}," availability ",[342,1845,1077],{"class":961},[342,1847,1848],{"class":768}," (shiftDuration ",[342,1850,1851],{"class":961},"-",[342,1853,1854],{"class":768}," totalDowntime) ",[342,1856,1857],{"class":961},"\u002F",[342,1859,1860],{"class":768}," shiftDuration;\n",[342,1862,1864,1867,1869,1872,1875,1877,1879,1882,1885,1887,1890],{"class":344,"line":1863},38,[342,1865,1866],{"class":768},"        availability ",[342,1868,1077],{"class":961},[342,1870,1871],{"class":768}," Math.",[342,1873,1874],{"class":965},"max",[342,1876,969],{"class":768},[342,1878,1491],{"class":779},[342,1880,1881],{"class":768},", Math.",[342,1883,1884],{"class":965},"min",[342,1886,969],{"class":768},[342,1888,1889],{"class":779},"1",[342,1891,1892],{"class":768},", availability));\n",[342,1894,1896],{"class":344,"line":1895},39,[342,1897,1428],{"emptyLinePlaceholder":1427},[342,1899,1901,1903,1906,1908,1911,1914,1916,1918,1921,1923,1925,1927,1929],{"class":344,"line":1900},40,[342,1902,1763],{"class":961},[342,1904,1905],{"class":768}," performance ",[342,1907,1077],{"class":961},[342,1909,1910],{"class":768}," data.target_output ",[342,1912,1913],{"class":961},">",[342,1915,1011],{"class":779},[342,1917,1806],{"class":961},[342,1919,1920],{"class":768}," data.total_produced_units ",[342,1922,1857],{"class":961},[342,1924,1910],{"class":768},[342,1926,1816],{"class":961},[342,1928,1011],{"class":779},[342,1930,1586],{"class":768},[342,1932,1934,1936,1939,1941,1943,1945,1947,1949,1952,1954,1956,1958,1960],{"class":344,"line":1933},41,[342,1935,1763],{"class":961},[342,1937,1938],{"class":768}," quality ",[342,1940,1077],{"class":961},[342,1942,1920],{"class":768},[342,1944,1913],{"class":961},[342,1946,1011],{"class":779},[342,1948,1806],{"class":961},[342,1950,1951],{"class":768}," data.good_units ",[342,1953,1857],{"class":961},[342,1955,1920],{"class":768},[342,1957,1816],{"class":961},[342,1959,1011],{"class":779},[342,1961,1586],{"class":768},[342,1963,1965],{"class":344,"line":1964},42,[342,1966,1428],{"emptyLinePlaceholder":1427},[342,1968,1970,1972,1975,1977,1979,1981,1983,1985],{"class":344,"line":1969},43,[342,1971,1763],{"class":961},[342,1973,1974],{"class":768}," oee ",[342,1976,1077],{"class":961},[342,1978,1843],{"class":768},[342,1980,1412],{"class":961},[342,1982,1905],{"class":768},[342,1984,1412],{"class":961},[342,1986,1987],{"class":768}," quality;\n",[342,1989,1991],{"class":344,"line":1990},44,[342,1992,1428],{"emptyLinePlaceholder":1427},[342,1994,1996,1999],{"class":344,"line":1995},45,[342,1997,1998],{"class":961},"        return",[342,2000,1069],{"class":768},[342,2002,2004,2007,2010,2013,2015,2018,2021,2024,2026,2029],{"class":344,"line":2003},46,[342,2005,2006],{"class":768},"            availability: ",[342,2008,2009],{"class":965},"parseFloat",[342,2011,2012],{"class":768},"((availability ",[342,2014,1412],{"class":961},[342,2016,2017],{"class":779}," 100",[342,2019,2020],{"class":768},").",[342,2022,2023],{"class":965},"toFixed",[342,2025,969],{"class":768},[342,2027,2028],{"class":779},"2",[342,2030,2031],{"class":768},")),\n",[342,2033,2035,2038,2040,2043,2045,2047,2049,2051,2053,2055],{"class":344,"line":2034},47,[342,2036,2037],{"class":768},"            performance: ",[342,2039,2009],{"class":965},[342,2041,2042],{"class":768},"((performance ",[342,2044,1412],{"class":961},[342,2046,2017],{"class":779},[342,2048,2020],{"class":768},[342,2050,2023],{"class":965},[342,2052,969],{"class":768},[342,2054,2028],{"class":779},[342,2056,2031],{"class":768},[342,2058,2060,2063,2065,2068,2070,2072,2074,2076,2078,2080],{"class":344,"line":2059},48,[342,2061,2062],{"class":768},"            quality: ",[342,2064,2009],{"class":965},[342,2066,2067],{"class":768},"((quality ",[342,2069,1412],{"class":961},[342,2071,2017],{"class":779},[342,2073,2020],{"class":768},[342,2075,2023],{"class":965},[342,2077,969],{"class":768},[342,2079,2028],{"class":779},[342,2081,2031],{"class":768},[342,2083,2085,2088,2090,2093,2095,2097,2099,2101,2103,2105],{"class":344,"line":2084},49,[342,2086,2087],{"class":768},"            oee: ",[342,2089,2009],{"class":965},[342,2091,2092],{"class":768},"((oee ",[342,2094,1412],{"class":961},[342,2096,2017],{"class":779},[342,2098,2020],{"class":768},[342,2100,2023],{"class":965},[342,2102,969],{"class":768},[342,2104,2028],{"class":779},[342,2106,860],{"class":768},[342,2108,2110],{"class":344,"line":2109},50,[342,2111,1533],{"class":768},[342,2113,2115],{"class":344,"line":2114},51,[342,2116,1539],{"class":768},[342,2118,2120],{"class":344,"line":2119},52,[342,2121,1428],{"emptyLinePlaceholder":1427},[342,2123,2125,2127,2130,2132,2134],{"class":344,"line":2124},53,[342,2126,1632],{"class":961},[342,2128,2129],{"class":768}," metrics ",[342,2131,1077],{"class":961},[342,2133,1691],{"class":965},[342,2135,2136],{"class":768},"(data, machineDowntime);\n",[342,2138,2140],{"class":344,"line":2139},54,[342,2141,1428],{"emptyLinePlaceholder":1427},[342,2143,2145,2148],{"class":344,"line":2144},55,[342,2146,2147],{"class":961},"    return",[342,2149,1069],{"class":768},[342,2151,2153],{"class":344,"line":2152},56,[342,2154,2155],{"class":768},"        machine_name: machineName,\n",[342,2157,2159],{"class":344,"line":2158},57,[342,2160,2161],{"class":768},"        area: data.area,\n",[342,2163,2165],{"class":344,"line":2164},58,[342,2166,2167],{"class":768},"        oee: metrics.oee\n",[342,2169,2171],{"class":344,"line":2170},59,[342,2172,2173],{"class":768},"    };\n",[342,2175,2177],{"class":344,"line":2176},60,[342,2178,1592],{"class":768},[342,2180,2182],{"class":344,"line":2181},61,[342,2183,1428],{"emptyLinePlaceholder":1427},[342,2185,2187],{"class":344,"line":2186},62,[342,2188,2189],{"class":1421},"\u002F\u002F Filter only machines with OEE \u003C 85\n",[342,2191,2193,2195,2197,2200,2202,2204,2207,2209,2212,2215,2218],{"class":344,"line":2192},63,[342,2194,1162],{"class":768},[342,2196,1077],{"class":961},[342,2198,2199],{"class":768}," oeeResults.",[342,2201,1661],{"class":965},[342,2203,969],{"class":768},[342,2205,2206],{"class":972},"machine",[342,2208,1460],{"class":961},[342,2210,2211],{"class":768}," machine.oee ",[342,2213,2214],{"class":961},"\u003C",[342,2216,2217],{"class":779}," 85",[342,2219,1830],{"class":768},[342,2221,2223],{"class":344,"line":2222},64,[342,2224,1428],{"emptyLinePlaceholder":1427},[342,2226,2228,2230],{"class":344,"line":2227},65,[342,2229,1180],{"class":961},[342,2231,1183],{"class":768},[10,2233,2234,2238],{},[166,2235],{"alt":2236,"dataZoomable":169,"src":2237},"Flow that prepares the Recent Downtime, Downtime Summary, and Top Underperforming Machines (OEE-wise)\n","\u002Fblog\u002F2025\u002F04\u002Fimages\u002Fdowntime-events-summery-oee-machine-wise.png",[154,2239,2240],{},"Flow that prepares the Recent Downtime, Downtime Summary, and Top Underperforming Machines (OEE-wise)",[181,2242,2244],{"id":2243},"oee-trend-for-the-last-30-days","OEE Trend for the Last 30 Days",[10,2246,2247],{},"Now, to calculate the OEE for the last 30 days, we need the complete production and downtime data for that period. However, the current SQLite flow retrieves only the last 12 hours. Therefore, we need another SQLite flow to retrieve data from the last 30 days.",[2249,2250,2252],"h5",{"id":2251},"retrieving-production-and-downtime-data-for-the-last-30-days","Retrieving Production and Downtime Data for the Last 30 Days",[35,2254,2255,2269,2274],{},[38,2256,2257,2258,2261,2262,1215,2264,2266,2267,61],{},"Copy the existing ",[79,2259,2260],{},"SQLite flow"," from the ",[79,2263,151],{},[79,2265,205],{}," that sets the retrieved downtime result to ",[139,2268,370],{},[38,2270,189,2271,2273],{},[79,2272,205],{}," that sets the parameters for the SQL query, keep only the element setting the line parameter, and remove the rest.",[38,2275,2276],{},"Modify the first SQLite node's SQL query to the following:",[334,2278,2280],{"className":336,"code":2279,"language":338,"meta":169,"style":169},"SELECT\n    timestamp AS timestamp,\n    machine_name AS machine_name,\n    area AS area,\n    line AS line,\n    total_produced_units AS total_produced_units,\n    good_units AS good_units,\n    defect_units AS defect_units,\n    target_output AS target_output\nFROM ProductionData\nWHERE line = $line\n  AND timestamp >= datetime('now', '-30 days');\n",[139,2281,2282,2287,2292,2297,2302,2307,2312,2317,2322,2327,2331,2336],{"__ignoreMap":169},[342,2283,2284],{"class":344,"line":345},[342,2285,2286],{},"SELECT\n",[342,2288,2289],{"class":344,"line":351},[342,2290,2291],{},"    timestamp AS timestamp,\n",[342,2293,2294],{"class":344,"line":357},[342,2295,2296],{},"    machine_name AS machine_name,\n",[342,2298,2299],{"class":344,"line":793},[342,2300,2301],{},"    area AS area,\n",[342,2303,2304],{"class":344,"line":811},[342,2305,2306],{},"    line AS line,\n",[342,2308,2309],{"class":344,"line":817},[342,2310,2311],{},"    total_produced_units AS total_produced_units,\n",[342,2313,2314],{"class":344,"line":823},[342,2315,2316],{},"    good_units AS good_units,\n",[342,2318,2319],{"class":344,"line":836},[342,2320,2321],{},"    defect_units AS defect_units,\n",[342,2323,2324],{"class":344,"line":863},[342,2325,2326],{},"    target_output AS target_output\n",[342,2328,2329],{"class":344,"line":869},[342,2330,354],{},[342,2332,2333],{"class":344,"line":1142},[342,2334,2335],{},"WHERE line = $line\n",[342,2337,2338],{"class":344,"line":1148},[342,2339,2340],{},"  AND timestamp >= datetime('now', '-30 days');\n",[35,2342,2343],{"start":793},[38,2344,2345],{},"Modify the second SQLite node's SQL query to the following:",[334,2347,2349],{"className":336,"code":2348,"language":338,"meta":169,"style":169},"SELECT\n    timestamp AS timestamp,\n    machine_name AS machine_name,\n    downtime_start AS downtime_start,\n    downtime_duration_minutes AS downtime_duration_minutes,\n    downtime_reason AS downtime_reason\nFROM DowntimeData\nWHERE\n    timestamp BETWEEN $startTime AND $endTime\n    AND line = $line;\n",[139,2350,2351,2355,2359,2363,2368,2373,2378,2382,2387,2392],{"__ignoreMap":169},[342,2352,2353],{"class":344,"line":345},[342,2354,2286],{},[342,2356,2357],{"class":344,"line":351},[342,2358,2291],{},[342,2360,2361],{"class":344,"line":357},[342,2362,2296],{},[342,2364,2365],{"class":344,"line":793},[342,2366,2367],{},"    downtime_start AS downtime_start,\n",[342,2369,2370],{"class":344,"line":811},[342,2371,2372],{},"    downtime_duration_minutes AS downtime_duration_minutes,\n",[342,2374,2375],{"class":344,"line":817},[342,2376,2377],{},"    downtime_reason AS downtime_reason\n",[342,2379,2380],{"class":344,"line":823},[342,2381,396],{},[342,2383,2384],{"class":344,"line":836},[342,2385,2386],{},"WHERE\n",[342,2388,2389],{"class":344,"line":863},[342,2390,2391],{},"    timestamp BETWEEN $startTime AND $endTime\n",[342,2393,2394],{"class":344,"line":869},[342,2395,2396],{},"    AND line = $line;\n",[2249,2398,2400],{"id":2399},"calculating-last-30d-days-oee","Calculating last 30d days OEE",[35,2402,2403,2411,2417],{},[38,2404,437,2405,2407,2408,2410],{},[79,2406,877],{}," onto the canvas and connect it to the last ",[79,2409,205],{}," of the SQLite flow.",[38,2412,437,2413,2407,2415,61],{},[79,2414,689],{},[79,2416,877],{},[38,2418,437,2419,2422,2423,1816],{},[79,2420,2421],{},"Function node"," onto the canvas, add the following JavaScript, and connect the Function node to the ",[79,2424,689],{},[334,2426,2428],{"className":952,"code":2427,"language":954,"meta":169,"style":169},"let productionData = msg.production_data;\nlet downtimeData = msg.downtime_data;\nlet line = flow.get('line');\nlet shiftDuration = flow.get('shiftDuration24h') * 3600;\n\nlet groupedData = {};\n\nproductionData.forEach(entry => {\n    if (entry.line === line) {\n        let date = entry.timestamp.split(\" \")[0];\n\n        if (!groupedData[date]) {\n            groupedData[date] = {\n                totalShiftDuration: shiftDuration,\n                totalGoodUnits: 0,\n                totalProducedUnits: 0,\n                totalDowntimeSeconds: 0,\n                totalCycleTime: 0,\n                cycleCount: 0,\n                totalTargetOutput: 0,\n                timestamp: entry.timestamp\n            };\n        }\n\n        groupedData[date].totalGoodUnits += entry.good_units;\n        groupedData[date].totalProducedUnits += entry.total_produced_units;\n        groupedData[date].totalCycleTime += entry.cycle_time;\n        groupedData[date].cycleCount++;\n        groupedData[date].totalTargetOutput += entry.target_output;\n    }\n});\n\ndowntimeData.forEach(downtime => {\n    if (downtime.line === line) {\n        let date = downtime.timestamp.split(\" \")[0];\n        if (groupedData[date]) {\n            groupedData[date].totalDowntimeSeconds += downtime.downtime_duration_minutes * 60;\n        }\n    }\n});\n\nlet oeeResults = Object.entries(groupedData).map(([date, data]) => {\n    let avgCycleTime = data.cycleCount > 0 ? data.totalCycleTime \u002F data.cycleCount : 0;\n    let availableTime = data.totalShiftDuration - data.totalDowntimeSeconds;\n    let availability = availableTime \u002F data.totalShiftDuration;\n    let performance = data.totalTargetOutput > 0 ? data.totalProducedUnits \u002F data.totalTargetOutput : 0;\n    let quality = data.totalProducedUnits > 0 ? data.totalGoodUnits \u002F data.totalProducedUnits : 0;\n    let oee = (availability * performance * quality * 100).toFixed(2);\n\n    return { date, availability, performance, quality, oee, timestamp: data.timestamp };\n});\n\n\u002F\u002F Sort data by timestamp (oldest to most recent)\noeeResults.sort((a, b) => new Date(a.timestamp).valueOf() - new Date(b.timestamp).valueOf());\nmsg.payload = oeeResults;\nreturn msg;\n",[139,2429,2430,2441,2452,2473,2500,2504,2515,2519,2534,2546,2574,2578,2589,2598,2603,2612,2621,2630,2639,2648,2657,2662,2667,2671,2675,2685,2695,2705,2715,2725,2729,2733,2737,2752,2763,2786,2793,2809,2813,2817,2821,2825,2857,2888,2905,2920,2950,2979,3012,3016,3023,3027,3031,3036,3086,3095],{"__ignoreMap":169},[342,2431,2432,2434,2437,2439],{"class":344,"line":345},[342,2433,1438],{"class":961},[342,2435,2436],{"class":768}," productionData ",[342,2438,1077],{"class":961},[342,2440,1368],{"class":768},[342,2442,2443,2445,2448,2450],{"class":344,"line":351},[342,2444,1438],{"class":961},[342,2446,2447],{"class":768}," downtimeData ",[342,2449,1077],{"class":961},[342,2451,1380],{"class":768},[342,2453,2454,2456,2459,2461,2464,2466,2468,2471],{"class":344,"line":357},[342,2455,1438],{"class":961},[342,2457,2458],{"class":768}," line ",[342,2460,1077],{"class":961},[342,2462,2463],{"class":768}," flow.",[342,2465,1395],{"class":965},[342,2467,969],{"class":768},[342,2469,2470],{"class":786},"'line'",[342,2472,1830],{"class":768},[342,2474,2475,2477,2480,2482,2484,2486,2488,2491,2493,2495,2498],{"class":344,"line":793},[342,2476,1438],{"class":961},[342,2478,2479],{"class":768}," shiftDuration ",[342,2481,1077],{"class":961},[342,2483,2463],{"class":768},[342,2485,1395],{"class":965},[342,2487,969],{"class":768},[342,2489,2490],{"class":786},"'shiftDuration24h'",[342,2492,1087],{"class":768},[342,2494,1412],{"class":961},[342,2496,2497],{"class":779}," 3600",[342,2499,1586],{"class":768},[342,2501,2502],{"class":344,"line":811},[342,2503,1428],{"emptyLinePlaceholder":1427},[342,2505,2506,2508,2511,2513],{"class":344,"line":817},[342,2507,1438],{"class":961},[342,2509,2510],{"class":768}," groupedData ",[342,2512,1077],{"class":961},[342,2514,1040],{"class":768},[342,2516,2517],{"class":344,"line":823},[342,2518,1428],{"emptyLinePlaceholder":1427},[342,2520,2521,2523,2525,2527,2530,2532],{"class":344,"line":836},[342,2522,1450],{"class":768},[342,2524,1048],{"class":965},[342,2526,969],{"class":768},[342,2528,2529],{"class":972},"entry",[342,2531,1460],{"class":961},[342,2533,1069],{"class":768},[342,2535,2536,2538,2541,2543],{"class":344,"line":863},[342,2537,1467],{"class":961},[342,2539,2540],{"class":768}," (entry.line ",[342,2542,1674],{"class":961},[342,2544,2545],{"class":768}," line) {\n",[342,2547,2548,2550,2553,2555,2558,2561,2563,2566,2569,2571],{"class":344,"line":869},[342,2549,1763],{"class":961},[342,2551,2552],{"class":768}," date ",[342,2554,1077],{"class":961},[342,2556,2557],{"class":768}," entry.timestamp.",[342,2559,2560],{"class":965},"split",[342,2562,969],{"class":768},[342,2564,2565],{"class":786},"\" \"",[342,2567,2568],{"class":768},")[",[342,2570,1491],{"class":779},[342,2572,2573],{"class":768},"];\n",[342,2575,2576],{"class":344,"line":1142},[342,2577,1428],{"emptyLinePlaceholder":1427},[342,2579,2580,2582,2584,2586],{"class":344,"line":1148},[342,2581,1708],{"class":961},[342,2583,984],{"class":768},[342,2585,987],{"class":961},[342,2587,2588],{"class":768},"groupedData[date]) {\n",[342,2590,2591,2594,2596],{"class":344,"line":1154},[342,2592,2593],{"class":768},"            groupedData[date] ",[342,2595,1077],{"class":961},[342,2597,1069],{"class":768},[342,2599,2600],{"class":344,"line":661},[342,2601,2602],{"class":768},"                totalShiftDuration: shiftDuration,\n",[342,2604,2605,2608,2610],{"class":344,"line":1177},[342,2606,2607],{"class":768},"                totalGoodUnits: ",[342,2609,1491],{"class":779},[342,2611,790],{"class":768},[342,2613,2614,2617,2619],{"class":344,"line":1536},[342,2615,2616],{"class":768},"                totalProducedUnits: ",[342,2618,1491],{"class":779},[342,2620,790],{"class":768},[342,2622,2623,2626,2628],{"class":344,"line":1542},[342,2624,2625],{"class":768},"                totalDowntimeSeconds: ",[342,2627,1491],{"class":779},[342,2629,790],{"class":768},[342,2631,2632,2635,2637],{"class":344,"line":1554},[342,2633,2634],{"class":768},"                totalCycleTime: ",[342,2636,1491],{"class":779},[342,2638,790],{"class":768},[342,2640,2641,2644,2646],{"class":344,"line":1565},[342,2642,2643],{"class":768},"                cycleCount: ",[342,2645,1491],{"class":779},[342,2647,790],{"class":768},[342,2649,2650,2653,2655],{"class":344,"line":1576},[342,2651,2652],{"class":768},"                totalTargetOutput: ",[342,2654,1491],{"class":779},[342,2656,790],{"class":768},[342,2658,2659],{"class":344,"line":1589},[342,2660,2661],{"class":768},"                timestamp: entry.timestamp\n",[342,2663,2664],{"class":344,"line":1595},[342,2665,2666],{"class":768},"            };\n",[342,2668,2669],{"class":344,"line":1600},[342,2670,1752],{"class":768},[342,2672,2673],{"class":344,"line":1629},[342,2674,1428],{"emptyLinePlaceholder":1427},[342,2676,2677,2680,2682],{"class":344,"line":1643},[342,2678,2679],{"class":768},"        groupedData[date].totalGoodUnits ",[342,2681,1548],{"class":961},[342,2683,2684],{"class":768}," entry.good_units;\n",[342,2686,2687,2690,2692],{"class":344,"line":1648},[342,2688,2689],{"class":768},"        groupedData[date].totalProducedUnits ",[342,2691,1548],{"class":961},[342,2693,2694],{"class":768}," entry.total_produced_units;\n",[342,2696,2697,2700,2702],{"class":344,"line":1680},[342,2698,2699],{"class":768},"        groupedData[date].totalCycleTime ",[342,2701,1548],{"class":961},[342,2703,2704],{"class":768}," entry.cycle_time;\n",[342,2706,2707,2710,2713],{"class":344,"line":1685},[342,2708,2709],{"class":768},"        groupedData[date].cycleCount",[342,2711,2712],{"class":961},"++",[342,2714,1586],{"class":768},[342,2716,2717,2720,2722],{"class":344,"line":1705},[342,2718,2719],{"class":768},"        groupedData[date].totalTargetOutput ",[342,2721,1548],{"class":961},[342,2723,2724],{"class":768}," entry.target_output;\n",[342,2726,2727],{"class":344,"line":1720},[342,2728,1539],{"class":768},[342,2730,2731],{"class":344,"line":1749},[342,2732,1592],{"class":768},[342,2734,2735],{"class":344,"line":1755},[342,2736,1428],{"emptyLinePlaceholder":1427},[342,2738,2739,2742,2744,2746,2748,2750],{"class":344,"line":1760},[342,2740,2741],{"class":768},"downtimeData.",[342,2743,1048],{"class":965},[342,2745,969],{"class":768},[342,2747,1700],{"class":972},[342,2749,1460],{"class":961},[342,2751,1069],{"class":768},[342,2753,2754,2756,2759,2761],{"class":344,"line":1792},[342,2755,1467],{"class":961},[342,2757,2758],{"class":768}," (downtime.line ",[342,2760,1674],{"class":961},[342,2762,2545],{"class":768},[342,2764,2765,2767,2769,2771,2774,2776,2778,2780,2782,2784],{"class":344,"line":1822},[342,2766,1763],{"class":961},[342,2768,2552],{"class":768},[342,2770,1077],{"class":961},[342,2772,2773],{"class":768}," downtime.timestamp.",[342,2775,2560],{"class":965},[342,2777,969],{"class":768},[342,2779,2565],{"class":786},[342,2781,2568],{"class":768},[342,2783,1491],{"class":779},[342,2785,2573],{"class":768},[342,2787,2788,2790],{"class":344,"line":1833},[342,2789,1708],{"class":961},[342,2791,2792],{"class":768}," (groupedData[date]) {\n",[342,2794,2795,2798,2800,2803,2805,2807],{"class":344,"line":1838},[342,2796,2797],{"class":768},"            groupedData[date].totalDowntimeSeconds ",[342,2799,1548],{"class":961},[342,2801,2802],{"class":768}," downtime.downtime_duration_minutes ",[342,2804,1412],{"class":961},[342,2806,1415],{"class":779},[342,2808,1586],{"class":768},[342,2810,2811],{"class":344,"line":1863},[342,2812,1752],{"class":768},[342,2814,2815],{"class":344,"line":1895},[342,2816,1539],{"class":768},[342,2818,2819],{"class":344,"line":1900},[342,2820,1592],{"class":768},[342,2822,2823],{"class":344,"line":1933},[342,2824,1428],{"emptyLinePlaceholder":1427},[342,2826,2827,2829,2831,2833,2835,2837,2840,2842,2844,2847,2849,2851,2853,2855],{"class":344,"line":1964},[342,2828,1438],{"class":961},[342,2830,1605],{"class":768},[342,2832,1077],{"class":961},[342,2834,1106],{"class":768},[342,2836,1109],{"class":965},[342,2838,2839],{"class":768},"(groupedData).",[342,2841,1115],{"class":965},[342,2843,1118],{"class":768},[342,2845,2846],{"class":972},"date",[342,2848,1057],{"class":768},[342,2850,1457],{"class":972},[342,2852,1129],{"class":768},[342,2854,1066],{"class":961},[342,2856,1069],{"class":768},[342,2858,2859,2861,2864,2866,2869,2871,2873,2875,2878,2880,2882,2884,2886],{"class":344,"line":1969},[342,2860,1632],{"class":961},[342,2862,2863],{"class":768}," avgCycleTime ",[342,2865,1077],{"class":961},[342,2867,2868],{"class":768}," data.cycleCount ",[342,2870,1913],{"class":961},[342,2872,1011],{"class":779},[342,2874,1806],{"class":961},[342,2876,2877],{"class":768}," data.totalCycleTime ",[342,2879,1857],{"class":961},[342,2881,2868],{"class":768},[342,2883,1816],{"class":961},[342,2885,1011],{"class":779},[342,2887,1586],{"class":768},[342,2889,2890,2892,2895,2897,2900,2902],{"class":344,"line":1990},[342,2891,1632],{"class":961},[342,2893,2894],{"class":768}," availableTime ",[342,2896,1077],{"class":961},[342,2898,2899],{"class":768}," data.totalShiftDuration ",[342,2901,1851],{"class":961},[342,2903,2904],{"class":768}," data.totalDowntimeSeconds;\n",[342,2906,2907,2909,2911,2913,2915,2917],{"class":344,"line":1995},[342,2908,1632],{"class":961},[342,2910,1843],{"class":768},[342,2912,1077],{"class":961},[342,2914,2894],{"class":768},[342,2916,1857],{"class":961},[342,2918,2919],{"class":768}," data.totalShiftDuration;\n",[342,2921,2922,2924,2926,2928,2931,2933,2935,2937,2940,2942,2944,2946,2948],{"class":344,"line":2003},[342,2923,1632],{"class":961},[342,2925,1905],{"class":768},[342,2927,1077],{"class":961},[342,2929,2930],{"class":768}," data.totalTargetOutput ",[342,2932,1913],{"class":961},[342,2934,1011],{"class":779},[342,2936,1806],{"class":961},[342,2938,2939],{"class":768}," data.totalProducedUnits ",[342,2941,1857],{"class":961},[342,2943,2930],{"class":768},[342,2945,1816],{"class":961},[342,2947,1011],{"class":779},[342,2949,1586],{"class":768},[342,2951,2952,2954,2956,2958,2960,2962,2964,2966,2969,2971,2973,2975,2977],{"class":344,"line":2034},[342,2953,1632],{"class":961},[342,2955,1938],{"class":768},[342,2957,1077],{"class":961},[342,2959,2939],{"class":768},[342,2961,1913],{"class":961},[342,2963,1011],{"class":779},[342,2965,1806],{"class":961},[342,2967,2968],{"class":768}," data.totalGoodUnits ",[342,2970,1857],{"class":961},[342,2972,2939],{"class":768},[342,2974,1816],{"class":961},[342,2976,1011],{"class":779},[342,2978,1586],{"class":768},[342,2980,2981,2983,2985,2987,2990,2992,2994,2996,2998,3000,3002,3004,3006,3008,3010],{"class":344,"line":2059},[342,2982,1632],{"class":961},[342,2984,1974],{"class":768},[342,2986,1077],{"class":961},[342,2988,2989],{"class":768}," (availability ",[342,2991,1412],{"class":961},[342,2993,1905],{"class":768},[342,2995,1412],{"class":961},[342,2997,1938],{"class":768},[342,2999,1412],{"class":961},[342,3001,2017],{"class":779},[342,3003,2020],{"class":768},[342,3005,2023],{"class":965},[342,3007,969],{"class":768},[342,3009,2028],{"class":779},[342,3011,1830],{"class":768},[342,3013,3014],{"class":344,"line":2084},[342,3015,1428],{"emptyLinePlaceholder":1427},[342,3017,3018,3020],{"class":344,"line":2109},[342,3019,2147],{"class":961},[342,3021,3022],{"class":768}," { date, availability, performance, quality, oee, timestamp: data.timestamp };\n",[342,3024,3025],{"class":344,"line":2114},[342,3026,1592],{"class":768},[342,3028,3029],{"class":344,"line":2119},[342,3030,1428],{"emptyLinePlaceholder":1427},[342,3032,3033],{"class":344,"line":2124},[342,3034,3035],{"class":1421},"\u002F\u002F Sort data by timestamp (oldest to most recent)\n",[342,3037,3038,3041,3044,3046,3048,3050,3053,3055,3057,3060,3063,3066,3069,3072,3074,3076,3078,3081,3083],{"class":344,"line":2139},[342,3039,3040],{"class":768},"oeeResults.",[342,3042,3043],{"class":965},"sort",[342,3045,1777],{"class":768},[342,3047,14],{"class":972},[342,3049,1057],{"class":768},[342,3051,3052],{"class":972},"b",[342,3054,1087],{"class":768},[342,3056,1066],{"class":961},[342,3058,3059],{"class":961}," new",[342,3061,3062],{"class":965}," Date",[342,3064,3065],{"class":768},"(a.timestamp).",[342,3067,3068],{"class":965},"valueOf",[342,3070,3071],{"class":768},"() ",[342,3073,1851],{"class":961},[342,3075,3059],{"class":961},[342,3077,3062],{"class":965},[342,3079,3080],{"class":768},"(b.timestamp).",[342,3082,3068],{"class":965},[342,3084,3085],{"class":768},"());\n",[342,3087,3088,3090,3092],{"class":344,"line":2144},[342,3089,1162],{"class":768},[342,3091,1077],{"class":961},[342,3093,3094],{"class":768}," oeeResults;\n",[342,3096,3097,3099],{"class":344,"line":2152},[342,3098,1180],{"class":961},[342,3100,1183],{"class":768},[35,3102,3103,3113,3119],{"start":793},[38,3104,437,3105,3107,3108,215,3110,61],{},[79,3106,205],{}," onto the canvas and set ",[139,3109,370],{},[139,3111,3112],{},"msg.oeeTrend",[38,3114,437,3115,441,3117,61],{},[79,3116,877],{},[79,3118,205],{},[38,3120,1212,3121,1215,3123,3125],{},[79,3122,877],{},[79,3124,689],{}," that was added earlier to receive all the calculated metrics for visualization.",[10,3127,3128,3132],{},[166,3129],{"alt":3130,"dataZoomable":169,"src":3131},"Flows that calculate the OEE for each day over the last 30 days","\u002Fblog\u002F2025\u002F04\u002Fimages\u002Foee-trend.png",[154,3133,3134],{},"Flows that calculate the OEE for each day over the last 30 days.",[66,3136,3138],{"id":3137},"building-the-oee-dashboard","Building the OEE Dashboard",[10,3140,3141],{},"Now that the key OEE metrics have been calculated and detailed insights into production performance have been gathered, it is time to bring everything together in a visually intuitive and interactive dashboard. The OEE dashboard will provide real-time visibility into availability, performance, and quality while also displaying recent downtime events, downtime summaries, underperforming machines, and historical OEE trends.",[10,3143,3144],{},"Using FlowFuse Dashboard (Node-RED Dashboard 2.0), a clean and efficient interface will be designed, allowing operators and decision-makers to monitor production efficiency at a glance.",[35,3146,3147,3158,3161,3208,3219,3233,3246,3273,3290,3326,3334,3356,3361,3394,3398],{},[38,3148,3149,3150,3152,3153],{},"Drag a Switch node onto the canvas, set the property to ",[139,3151,726],{},", and add the condition:",[74,3154,3155],{},[38,3156,3157],{},"\"Is not null\".",[38,3159,3160],{},"Connect it to the Link-In node that receives calculated metrics.",[38,3162,3163,3164,215,3166,3168,3169],{},"Drag a Change node, set ",[139,3165,726],{},[139,3167,370],{},", and connect it to a Gauge widget.",[74,3170,3171,3176,3190],{},[38,3172,3173,3174,61],{},"Create a new Group on a new page named ",[79,3175,260],{},[38,3177,3178,3179,3182,3183,3186,3187,61],{},"Set the page layout to ",[79,3180,3181],{},"Grid",", adjust the range from ",[79,3184,3185],{},"0 to 100",", and label the gauge ",[79,3188,3189],{},"OEE",[38,3191,3192,3193,3196,3197,3200,3201,142,3204,3207],{},"Choose ",[79,3194,3195],{},"Half Gauge"," as the type, set the style to ",[79,3198,3199],{},"Rounded",", and adjust the width and height to ",[79,3202,3203],{},"6",[79,3205,3206],{},"3"," for both the group and the widget.",[38,3209,3210,3211,1057,3213,3215,3216,3218],{},"Repeat these steps for ",[139,3212,701],{},[139,3214,710],{},", and ",[139,3217,718],{},", ensuring each has a separate Group with the correct label.",[38,3220,3221,3222,3224,3225,215,3227,1816,3229],{},"Drag a Switch node for ",[139,3223,373],{}," and connect it to a Change node setting ",[139,3226,373],{},[139,3228,370],{},[74,3230,3231],{},[38,3232,3157],{},[38,3234,3235,3236,1057,3238,1057,3240,3215,3243,3245],{},"Repeat this step for ",[139,3237,1199],{},[139,3239,1310],{},[139,3241,3242],{},"msg.topUnderPerformingMachines",[139,3244,3112],{},", ensuring each has a separate Switch node and Change node.",[38,3247,3248,3249,3251,3252,3255,3256,3259,3260,3263,3264,142,3267,3270,3271,61],{},"Drag a Bar Chart widget, create a new Group, set the width to ",[79,3250,3203],{}," and height to ",[79,3253,3254],{},"8"," for both the group and widget, label it ",[79,3257,3258],{},"Production Data",", group data by ",[79,3261,3262],{},"Stacks",", and map ",[79,3265,3266],{},"X to series",[79,3268,3269],{},"Y to units",". Connect it to the node setting ",[139,3272,373],{},[38,3274,3275,3276,3278,3279,142,3282,3285,3286,215,3288,61],{},"Duplicate the chart for ",[79,3277,941],{},", mapping ",[79,3280,3281],{},"X to downtime_reason",[79,3283,3284],{},"Y to downtime_duration_minutes",", and connect it to the node setting ",[139,3287,1199],{},[139,3289,370],{},[38,3291,3292,3293,3295,3296,3255,3298,3301,3302,3305,3306],{},"Drag a Table widget, create a new Group, set width ",[79,3294,3203],{}," and height ",[79,3297,2028],{},[79,3299,3300],{},"Recent Downtime Events",", set max rows to ",[79,3303,3304],{},"5",", and add columns with keys:",[74,3307,3308,3313,3318,3322],{},[38,3309,3310],{},[139,3311,3312],{},"machine_name",[38,3314,3315],{},[139,3316,3317],{},"downtime_start",[38,3319,3320],{},[139,3321,1060],{},[38,3323,3324],{},[139,3325,1054],{},[38,3327,3328,3329,215,3332,61],{},"Connect it to the node setting ",[139,3330,3331],{},"msg.recent_downtime",[139,3333,370],{},[38,3335,3336,3337,3339,3340],{},"Duplicate the table for ",[79,3338,1327],{},", adding columns with keys:",[74,3341,3342,3346,3351],{},[38,3343,3344],{},[139,3345,3312],{},[38,3347,3348],{},[139,3349,3350],{},"area",[38,3352,3353],{},[139,3354,3355],{},"oee",[38,3357,3358,3359,61],{},"Connect it to ",[139,3360,3242],{},[38,3362,3363,3364,3295,3366,3255,3368,3371,3372,3375,3376,3263,3379,142,3384,3389,3390,215,3392,61],{},"Drag a Line Chart widget, create a new Group, set width ",[79,3365,226],{},[79,3367,3304],{},[79,3369,3370],{},"Daily OEE Trend Over 24 Hours",", set X-axis to ",[79,3373,3374],{},"Timescale",", format ",[79,3377,3378],{},"Y-l-d",[79,3380,3381,3382],{},"X to ",[139,3383,2846],{},[79,3385,3386,3387],{},"Y to ",[139,3388,3355],{},". Connect it to the Change node setting ",[139,3391,3112],{},[139,3393,370],{},[38,3395,251,3396,61],{},[79,3397,133],{},[38,3399,3400],{},"Open the dashboard by clicking the Dashboard 2.0 button located at the top-right corner of the Dashboard 2.0 sidebar.",[10,3402,3403,3407],{},[166,3404],{"alt":3405,"dataZoomable":169,"src":3406},"OEE Dashboard UI flow","\u002Fblog\u002F2025\u002F04\u002Fimages\u002Foee-dashboard.png",[154,3408,3405],{},[10,3410,3411],{},"Your OEE dashboard is now set up and ready to use. It will visualize key metrics, including OEE, quality, availability, performance, production data, downtime events, and machine performance trends.",[10,3413,3414,3418],{},[166,3415],{"alt":3416,"dataZoomable":169,"src":3417},"OEE Dashboard results without proper theming and styling","\u002Fblog\u002F2025\u002F04\u002Fimages\u002Foee-dashboard-without-style.png",[154,3419,3420],{},"OEE Dashboard results without proper theming and styling.",[10,3422,3423,3426],{},[166,3424],{"alt":3416,"dataZoomable":169,"src":3425},"\u002Fblog\u002F2025\u002F04\u002Fimages\u002Foee-dashboard-without-style-2.png",[154,3427,3416],{},[10,3429,3430],{},"However, the dashboard may not yet look exactly as it did in the previous design or intended layout. Some components may not align correctly with adjacent components in terms of width and height. Additionally, on different screens, you may notice layout inconsistencies, and the top header elements, such as the OEE Dashboard title and logo is missing.",[10,3432,3433],{},"Do not worry—in the next part of this series, we will style the dashboard to match the original design. Later, we will demonstrate how to connect it to a real data source, scale it across your production lines, and explain how you can use this dashboard to improve production efficiency.",[27,3435,3437],{"id":3436},"what-next?","What Next?",[10,3439,3440,3441,3445,3446,61],{},"Part 3 of this series will follow soon. In the meantime, if you’re excited to quickly launch your OEE dashboard in your factory environment, don’t delay! ",[14,3442,3444],{"href":85,"rel":3443},[23],"Register for a FlowFuse account"," now and initiate your journey with our new effective, ready-made ",[14,3447,3449],{"href":3448},"\u002Fblueprints\u002Fmanufacturing\u002Foee-dashboard\u002F","OEE Dashboard Blueprint",[3451,3452,3453],"style",{},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .s7hpK, html code.shiki .s7hpK{--shiki-default:#B31D28;--shiki-default-font-style:italic;--shiki-dark:#FDAEB7;--shiki-dark-font-style:italic}html pre.shiki code .szBVR, html code.shiki .szBVR{--shiki-default:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sScJk, html code.shiki .sScJk{--shiki-default:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .s4XuR, html code.shiki .s4XuR{--shiki-default:#E36209;--shiki-dark:#FFAB70}html pre.shiki code .sJ8bj, html code.shiki .sJ8bj{--shiki-default:#6A737D;--shiki-dark:#6A737D}",{"title":169,"searchDepth":351,"depth":351,"links":3455},[3456,3465],{"id":29,"depth":351,"text":30,"children":3457},[3458,3459,3460,3461,3462,3463,3464],{"id":68,"depth":357,"text":69},{"id":113,"depth":357,"text":114},{"id":175,"depth":357,"text":176},{"id":428,"depth":357,"text":429},{"id":678,"depth":357,"text":679},{"id":910,"depth":357,"text":911},{"id":3137,"depth":357,"text":3138},{"id":3436,"depth":351,"text":3437},"In Part 1, we explored the fundamentals of OEE, outlined a basic design of the dashboard, and identified the key elements to include in the OEE dashboard.\nIn this Part 2, we will focus on building the OEE dashboard interface using FlowFuse Dashboard (Node-RED Dashboard 2.0) and FlowFuse, utilizing simulated production and downtime data.","md",{"navTitle":5,"excerpt":3469},{"type":7,"value":3470},[3471],[10,3472,12,3473,18,3475,25],{},[14,3474,17],{"href":16},[14,3476,24],{"href":21,"rel":3477},[23],"\u002Fblog\u002F2025\u002F04\u002Fbuilding-oee-dashboard-with-flowfuse-2",{"title":5,"description":3466},"blog\u002F2025\u002F04\u002Fbuilding-oee-dashboard-with-flowfuse-2","2Q1u9cbc5J6mRcW2czXW8bmFttPYZ88JBGF7Q1I6viA",1780132427657]