I must be doing something basically wrong, as I cant get it to work. I am on the verge of giving up.
Attaching the entire flow (where I am rewriting the entire index.js file ) but is working
I want to understand , why cant i get the forEach
thing working?
[{"id":"3a20af9f0b232322","type":"tab","label":"Flow 3","disabled":false,"info":"","env":[]},{"id":"86196da223b60add","type":"group","z":"3a20af9f0b232322","name":"Load HTML/CSS/JS Files","style":{"stroke":"#9363b7","fill":"#dbcbe7","label":true,"color":"#6f2fa0"},"nodes":["64a682c69cc73e8a","698ebc8703e77635","714ce6e07b61f280","b328132626589c0a","b14b1b6615920eef","c066b1e73f0e65b1","c5c758fb0563ccc7","0fd0374b86a58a3c","2487c25c2642383b","3b5b64bb713b9a9e","d0dd33e35c8f1ad3","c42a7aefb5791676","ef9eb47925e03786","234aeb9ed9576c56","b5e8bade75688a70"],"x":44,"y":59,"w":812,"h":202},{"id":"7ab5a22cd67392c2","type":"group","z":"3a20af9f0b232322","name":"UI-BUILDER","style":{"stroke":"#ffcf3f","fill":"#ffefbf","label":true,"color":"#0070c0"},"nodes":["a4bd895056f646fe","1b114fabfb52db74","df939924253d4619","499308298c239550","5cf856ba7e2e6862"],"x":44,"y":289,"w":502,"h":152},{"id":"7bdce0666512b731","type":"group","z":"3a20af9f0b232322","name":"Update Time Every Second","style":{"stroke":"#3f5787","fill":"#7f8faf","label":true,"color":"#ffff00"},"nodes":["28422642ce0a174a","178548589dd8dab9","67abc3c4e7365874","c4a9f7bc21b9d658"],"x":44,"y":489,"w":602,"h":82},{"id":"3592ecb00ef22768","type":"group","z":"3a20af9f0b232322","name":"Simulate MySQL Query","style":{"stroke":"#0070c0","fill":"#ffff7f","label":true,"color":"#001f60"},"nodes":["2a2405d20ef35a10","88e358a2900c77f4","241702a04b393b62","cf7297f001e3758b","14d2df29906751db","0a81529866a95024","f32a875e0e59957b"],"x":44,"y":799,"w":712,"h":162},{"id":"fa0f33030a7da271","type":"group","z":"3a20af9f0b232322","name":"Show Selected Date and Selected Machine","style":{"stroke":"#0070c0","fill":"#c8e7a7","label":true,"color":"#001f60"},"nodes":["7eda60ae916b1cce","719cdf76ef8c4e8d","6533dd62217dd1b7","3d25271024417c93","94eddf62ccd5c333","70156f9757a24f22","93694f8b65005641","f2b9129de45e58b8"],"x":44,"y":599,"w":632,"h":182},{"id":"2fe1b2f178b93edc","type":"group","z":"3a20af9f0b232322","name":"Seeking replacement of this....","style":{"stroke":"#ff0000","fill":"#ff7f7f","label":true,"color":"#0070c0"},"nodes":["84b89ef35a890901","f5470e8ee2a5b3a2","927ce942ae1bbf13","37e4fd0368333b21","2b5b56e234fae22d"],"x":794,"y":799,"w":582,"h":142},{"id":"ef9eb47925e03786","type":"junction","z":"3a20af9f0b232322","g":"86196da223b60add","x":250,"y":160,"wires":[["c066b1e73f0e65b1","64a682c69cc73e8a","b328132626589c0a","3b5b64bb713b9a9e"]]},{"id":"64a682c69cc73e8a","type":"change","z":"3a20af9f0b232322","g":"86196da223b60add","name":"index.css","rules":[{"t":"set","p":"fname","pt":"msg","to":"index.css","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":140,"wires":[["698ebc8703e77635"]]},{"id":"698ebc8703e77635","type":"template","z":"3a20af9f0b232322","g":"86196da223b60add","name":"CSS","field":"payload","fieldType":"msg","format":"css","syntax":"mustache","template":":ROOT, :ROOT.LIGHT{COLOR-SCHEME:DARK;}\n .overflow-hidden {overflow: hidden;}\n .livedisplay {font-size: 2.5em;text-align: center;}\n\n.zero {border-radius: 10px;font-size: 2.8em;text-align: center;background-color:#2D2D2D;}\n\n.large-font-r {border-radius: 10px;font-size:2.8em;background:red;color: white;font-family: \"Trebuchet MS\";text-align: center;}\n.large-font-b {border-radius: 10px;font-size:2.8em;background:blue;color: white;font-family: \"Trebuchet MS\";text-align: center;}\n.large-font-g {border-radius: 10px;font-size:2.8em;background:green;color: white;font-family: \"Trebuchet MS\";text-align: center;}\n\n.another-large {color:white; font-size: 2em; vertical-align:\"middle\" ; text-align: center;}\n.medium-font {font-size: 1.3em; text-align: left;}\n.smallfont {font-family: \"arial narrow\";font-size:10px;color: cyan;text-align: center;font-weight:100;}\n.raw-input {font-size:1.3em;color: white;text-align: center;font-weight:200;}\n\n.mf {font-size:17px;color:yellow;font-family: \"arial narrow\";text-align: right;}\n.lf {font-size:35px;color: cyan;font-family: \"trebuchet ms\";text-align: center;}\n\n.oee {background:#101010; font-size: 0.9em; text-align: center;}\n.oee1 {background:#202020 ;color:yellow; font-size: 0.9em; text-align: center;}\n.oeehead {background:black ;color:white; font-size: 1.3em; text-align: center;font-weight: 200;}\n.oee2 {background:#505050 ;color:yellow; font-size: 1.3em; text-align: center; font-weight: 600;}\n.oeedn {background:#121212 ;color:pink ; font-size: 0.9em; text-align: center;}\n.oeeup {background:#121212 ;color:lightgreen; font-size: 0.9em; text-align: center;}\n.oee_grey {background:#525252 ;color:#020202; font-size: 0.9em; text-align: center;}\n.oee_grey {background:#525252 ;color:#020202; font-size: 0.9em; text-align: center;}\n.oee_green {background:green ;color:#020202; font-size: 1.3em; text-align: center;}\n.oee_pink {background:pink ;color:#020202; font-size: 1.3em; text-align: center;}\n\n.ltm {font-size: 0.9em; text-align: center;}\n\n.red {font-size:20px;color: pink;font-family: \"courier new\";text-align: center;}\n.red1 {font-size:20px;color: pink;font-family: \"courier new\";text-align: left;}\n.sum {font-size:20px;color: yellow;background:#202020;font-family: \"courier new\";text-align: center;}\n.orange {font-size:20px;color: orange;font-family: \"courier new\";text-align: center;}\n.green {font-size:20px;color: #55ff55;font-family: \"courier new\";text-align: center;}\n.green1 {font-size:20px;color: #55ff55;font-family: \"courier new\";text-align: left;}\n\n.shifts {font-size:20px;color: white;font-family: \"arial narrow\";text-align: right;}\n.mcselect {font-size:17px;color: #FBFF00;background:#505050;height:24px;font-family: \"courier\";text-align: center;}\n\n.hour0 {font-size:20px;color: white;background:darkgreen;height:30px;font-family: \"courier\";text-align: right;}\n.hour1 {font-size:18px;color: #FBFF00;background:#808080;height:25px;font-family: \"courier\";text-align: right;}\n.hour2 {font-size:18px;color: #FBFF00;background:#707070;height:25px;font-family: \"courier\";text-align: right;}\n.hour3 {font-size:18px;color: #FBFF00;background:#606060;height:25px;font-family: \"courier\";text-align: right;}\n.hour4 {font-size:18px;color: #FBFF00;background:#505050;height:25px;font-family: \"courier\";text-align: right;}\n.hour5 {font-size:18px;color: #FBFF00;background:#404040;height:25px;font-family: \"courier\";text-align: right;}\n.hour6 {font-size:18px;color: #FBFF00;background:#303030;height:25px;font-family: \"courier\";text-align: right;}\n.hour7 {font-size:18px;color: #FBFF00;background:#202020;height:25px;font-family: \"courier\";text-align: right;}\n\n\n.smallfont1 {font-size: 12px; color:yellow ; font-family: \"verdana\" ; text-align: center;}\n.f12 {font-size: 1em;background:red; color:yellow ; text-align: center;}\n\n.smallfont2 {color:grey ; font-family: \"verdana\" ; text-align: center;}\n.another-large1 {font-size: 20px; color: blue ;text-align: right;}\n\n.container {display: flex;flex-direction: column;align-items: center;}\n\n.time {font-size:0.5em;color: yellow;font-family: \"courier narrow\";text-align: center;}\n.rotate { font-size:12px; text-align: center; background:#404040; white-space: nowrap; vertical-align: middle; width: 1.0em;}\n.rotate div {\n -moz-transform: rotate(-90.0deg); /* FF3.5+ */ \n -o-transform: rotate(-90.0deg); /* Opera 10.5 */ \n -webkit-transform: rotate(-90.0deg); /* Saf3.1+, Chrome */\n filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=0.083); /* IE6,IE7 */\n -ms-filter: \"progid:DXImageTransform.Microsoft.BasicImage(rotation=0.083)\"; /* IE8 */\n margin-left: -10em;\n margin-right: -10em;}\n.m_on {font-size:17px;color: green;font-family: \"courier\";text-align: center;}\n.m_off {font-size:17px;color: brown;font-family: \"courier\";text-align: center;}\n.m_1 {font-size:15px;color: green;font-family: \"courier\";text-align: center;}\n.m_0 {font-size:15px;color: red;font-family: \"courier\";text-align: center;}\n\n .cap {font-size:20px;color: yellow;font-family: \"courier new\";text-align: left;}\n .zero1 {font-size:1em;color: #606060; font-family: \"courier new\";text-align: center;}\n .zero2 {font-size:1em;color: white; font-family: \"courier new\";text-align: center;}\n .zero3 {font-size:1em;color: black; font-family: \"courier new\";text-align: center;}\n .zero4 {font-size:1em;color: white; font-family: \"courier new\";text-align: center;}\n .zero5 {font-size:1em;color: yellow; font-family: \"courier new\";text-align: center;}\n\n.my-button {border: 2;color: white;align:center;padding: 1px;border-radius: 50px;transition: 0.4s ease;}\n.my-button:hover {background: black;cursor: pointer;}\n\n .btn-group .header {background-color: #198754;background-image: radial-gradient(circle, #198754 5%, #199754 15%, #198754 60%);border: none;border-radius: 30px;color: white;font-weight:700;font-family: AvenirNextCondensed-Bold;padding: 8px 20px;text-align: center;\n text-shadow: 2px 2px 4px #000000; display: inline-block;height:40px;font-size: 1.2em;cursor: default;float: left;border: 3px solid yellow;}\n\n .btn-group .button0 {background-color: grey;box-shadow:5px 5px 5px #0078d0;border: none;border-radius: 50px;color: white;padding: 8px 20px;text-align: center;\n display: inline-block;height:40px;font-size: 1.em;cursor: default;float: left;border: 3px solid black;}\n\n .btn-group .time_display {font-size:0.9em;background-color: green;box-sizing:border-box;border-radius: 50px;color: white;padding: 2px 20px;text-align: center;\n display: flexbox;height:40px;cursor: default;float: right;border: 3px solid black;}\n\n .btn-group .button1 {background-color: #0078d0;box-shadow: 5px 5px 5px #0cc005;border-radius: 50px;color: white;padding: 8px 20px;text-align: center;\n display: inline-block;height:40px;font-size: 1em;cursor: pointer;float: left;border: 3px solid black;}\n\n .btn-group .button2 {background-color: #0078d0;border: none;border-radius: 50px;color: white;padding: 8px 20px;text-align: center;\n display: inline-block;height:60px;font-size: 1.6em;cursor: pointer;float: left;border: 3px solid black;}\n\n .btn-group .button3 {background-color: #0078d0;border: none;border-radius: 50px;color: white;padding: 2px 20px;text-align: center;\n display: inline-block;height:60px;font-size: 0.8em;cursor: pointer;float: left;border: 1px solid black; }\n\n .btn-group .button4 {background-color: #0078d0;border: none;border-radius: 50px;color: white; padding: 2px 5px;text-align: center;\n display: inline-block;height:60px;font-size: 0.7em;font-weight: 100;cursor: pointer;float: left;border: 1px solid black; }\n\n .btn-group .button0:hover {background-color: grey;}\n .btn-group .button1:hover {background-color: red;transform: translateY(-2px);box-shadow: 0 5px #0078d0;}\n .btn-group .button2:hover {background-color: red;transform: translateY(-2px);box-shadow: 0 5px #0078d0;}\n .btn-group .button3:hover {background-color: red;transform: translateY(-2px);box-shadow: 0 5px #0078d0;}\n .btn-group .button4:hover {background-color: green;transform: translateY(-2px);box-shadow: 0 5px #0078d0;}\n\n .bigtext {font-size: 1.5em;}\n .button:active {background-color: magenta;box-shadow: 0 5px #666;transform: translateY(4px);}\n .button1:active {background-color: magenta;box-shadow: 0 5px #666;transform: translateY(4px);}\n .button2:active {background-color: magenta;box-shadow: 0 5px #666;transform: translateY(4px);}\n .button3:active {background-color: magenta;box-shadow: 0 5px #666;transform: translateY(4px);}\n .button4:active {background-color: magenta;box-shadow: 0 5px #666;transform: translateY(4px);}\n\n .marquee {height: 30px;overflow: hidden;position: relative;background: black;color: lightgreen;font-weight: 200;border: 1px solid pink;}\n .marquee p {position: absolute;width: 100%;height: 100%;margin: 0;line-height: 30px;text-align: center;moz-transform: translateX(100%);\n -webkit-transform: translateX(100%);transform: translateX(100%);moz-animation: scroll-left 30s linear infinite;webkit-animation: scroll-left 30s linear infinite;\n animation: scroll-left 30s linear infinite;}\n \n @-moz-keyframes scroll-left {0% {moz-transform: translateX(100%);}100% {-moz-transform: translateX(-100%);} }\n @-webkit-keyframes scroll-left {0% {-webkit-transform: translateX(100%);}100% {-webkit-transform: translateX(-100%);} }\n @keyframes scroll-left {0% {-moz-transform: translateX(100%);-webkit-transform: translateX(100%); transform: translateX(100%);}100% {\n -moz-transform: translateX(-100%);-webkit-transform: translateX(-100%); transform: translateX(-100%);}}\n\n","output":"str","x":560,"y":140,"wires":[["714ce6e07b61f280"]]},{"id":"714ce6e07b61f280","type":"uib-save","z":"3a20af9f0b232322","g":"86196da223b60add","url":"StateChart","uibId":"a4bd895056f646fe","folder":"src","fname":"","createFolder":false,"reload":false,"usePageName":false,"encoding":"utf8","mode":438,"name":"","topic":"","x":760,"y":140,"wires":[]},{"id":"b328132626589c0a","type":"change","z":"3a20af9f0b232322","g":"86196da223b60add","name":"index.js","rules":[{"t":"set","p":"fname","pt":"msg","to":"index.js","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":180,"wires":[["b5e8bade75688a70"]]},{"id":"b14b1b6615920eef","type":"uib-save","z":"3a20af9f0b232322","g":"86196da223b60add","url":"StateChart","uibId":"a4bd895056f646fe","folder":"src","fname":"","createFolder":false,"reload":false,"usePageName":false,"encoding":"utf8","mode":438,"name":"","topic":"","x":760,"y":180,"wires":[]},{"id":"c066b1e73f0e65b1","type":"change","z":"3a20af9f0b232322","g":"86196da223b60add","name":"index.html","rules":[{"t":"set","p":"fname","pt":"msg","to":"index.html","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":100,"wires":[["0fd0374b86a58a3c"]]},{"id":"c5c758fb0563ccc7","type":"uib-save","z":"3a20af9f0b232322","g":"86196da223b60add","url":"StateChart","uibId":"a4bd895056f646fe","folder":"src","fname":"","createFolder":false,"reload":false,"usePageName":false,"encoding":"utf8","mode":438,"name":"","topic":"","x":760,"y":100,"wires":[]},{"id":"0fd0374b86a58a3c","type":"template","z":"3a20af9f0b232322","g":"86196da223b60add","name":"HTML","field":"payload","fieldType":"msg","format":"html","syntax":"mustache","template":"<!doctype html>\n<html lang=\"en\">\n\n<head>\n\n <meta charset=\"utf-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n <link rel=\"icon\" href=\"../uibuilder/images/node-blue.ico\">\n\n <!-- Your own CSS (defaults to loading uibuilders css)-->\n <link type=\"text/css\" rel=\"stylesheet\" href=\"./index.css\" media=\"all\">\n\n <!-- #region Supporting Scripts. These MUST be in the right order. Note no leading / -->\n <script type=\"text/javascript\" src=\"https://www.gstatic.com/charts/loader.js\"></script>\n <!-- <script src=\"https://cdn.jsdelivr.net/npm/apexcharts\"></script> -->\n <script defer src=\"../uibuilder/uibuilder.iife.min.js\"></script>\n <script defer src=\"./index.js\">\n /* OPTIONAL: Put your custom code in that */\n </script>\n <!-- #endregion -->\n\n</head>\n\n<body class=\"uib\">\n\n <h4 class=\"with-subtitle\">\n </h4>\n\n\n <div class=\"btn-group\">\n \n \n <button id=\"b01\" class=\"header\" onclick=\"\">MyCompany Name</button>\n <button id=\"m01\" class=\"button0\" onclick=\"\">M-01</button>\n <button id=\"m02\" class=\"button0\" onclick=\"\">M-02</button>\n <button id=\"m03\" class=\"button1\" onclick=\"uibuilder.eventSend(event)\">M-03</button>\n <button id=\"m04\" class=\"button1\" onclick=\"uibuilder.eventSend(event)\">M-04</button>\n <button id=\"m05\" class=\"button0\" onclick=\"\">M-05</button>\n <button id=\"m06\" class=\"button0\" onclick=\"\">M-06</button>\n <button id=\"m07\" class=\"button0\" onclick=\"\">M-07</button>\n <button id=\"m08\" class=\"button1\" onclick=\"uibuilder.eventSend(event)\">M-08</button>\n <button id=\"m09\" class=\"button0\" onclick=\"\">M-09</button>\n <button id=\"m10\" class=\"button0\" onclick=\"\">M-10</button>\n <button id=\"m11\" class=\"button0\" onclick=\"\">M-11</button>\n <button id=\"m12\" class=\"button0\" onclick=\"\">M-12</button>\n <button id=\"m13\" class=\"button0\" onclick=\"\">M-13</button>\n <button id=\"m14\" class=\"button0\" onclick=\"\">M-14</button>\n <button id=\"m15\" class=\"button0\" onclick=\"\">M-15</button>\n <button id=\"m16\" class=\"button0\" onclick=\"\">M-16</button>\n <button id=\"b10\" class=\"time_display\" >Time</button>\n\n</div>\n<div uib-topic=\"btnreport\"></div>\n<br>\n<br>\n<br>\n<div id=\"sform1\">\n <form>\n <div title=\"Required. Type: Date\" class=\"required\">\n <label for=\"r3-date-req\">Select Date :</label>\n <input type=\"Date\" label=\"Select Date :\" id=\"r3-date-req\" value=\"{{curdate}}\" required=\"true\" onchange=\"this.dataset.newValue = this.value\"\n onfocus=\"this.dataset.oldValue = this.value\" name=\"r3-date-req\" title=\"Required. Type: Date\" >\n\n <button type=\"button\" title=\"Send the form data back to Node-RED\" onclick=\"uibuilder.eventSend(event)\" id=\"btn-send\">Send</button>\n <button type=\"button\" title=\"Reset the form\" onclick=\"uibuilder.eventSend(event)\" id=\"btn-reset\">Reset</button>\n </form> \n</div>\n<br>\n<br>\n<br>\n<div class = \"red1\" id=\"SelDate\">Select a Date</div>\n<div class = \"green1\" id=\"SelMc\">Select a Machine (Greyed out Buttons are not available)</div>\n<br>\n<br>\n<br>\n<div id=\"timeline\" style=\"height: 480px;\"></div>\n\n<div id=\"more\"></div>\n\n</html> ","output":"str","x":560,"y":100,"wires":[["c5c758fb0563ccc7"]]},{"id":"2487c25c2642383b","type":"inject","z":"3a20af9f0b232322","g":"86196da223b60add","name":"Load","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":140,"y":160,"wires":[["ef9eb47925e03786"]]},{"id":"3b5b64bb713b9a9e","type":"delay","z":"3a20af9f0b232322","g":"86196da223b60add","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":390,"y":220,"wires":[["d0dd33e35c8f1ad3"]]},{"id":"d0dd33e35c8f1ad3","type":"change","z":"3a20af9f0b232322","g":"86196da223b60add","name":"Reload","rules":[{"t":"set","p":"_ui","pt":"msg","to":"{\"method\":\"reload\"}","tot":"json"},{"t":"set","p":"topic","pt":"msg","to":"reload","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":570,"y":220,"wires":[["c42a7aefb5791676"]]},{"id":"c42a7aefb5791676","type":"link out","z":"3a20af9f0b232322","g":"86196da223b60add","name":"link out 61","mode":"link","links":["5cf856ba7e2e6862"],"x":685,"y":220,"wires":[]},{"id":"234aeb9ed9576c56","type":"link in","z":"3a20af9f0b232322","g":"86196da223b60add","name":"link in 15","links":["2b5b56e234fae22d"],"x":235,"y":220,"wires":[["3b5b64bb713b9a9e"]]},{"id":"b5e8bade75688a70","type":"template","z":"3a20af9f0b232322","g":"86196da223b60add","name":"JS","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":" google.charts.load('current', {'packages':['timeline']});\n google.charts.setOnLoadCallback(drawChart);\n function drawChart() {\n var container = document.getElementById('timeline');\n var chart = new google.visualization.Timeline(container);\n var dataTable = new google.visualization.DataTable();\n\n dataTable.addColumn({ type: 'string', id: 'Machine' });\n dataTable.addColumn({ type: 'string', id: 'State' });\n dataTable.addColumn({ type: 'date', id: 'Start' });\n dataTable.addColumn({ type: 'date', id: 'End' });\n dataTable.addRows([ ]);\n\n chart.draw(dataTable);\n }\n\n ","output":"str","x":560,"y":180,"wires":[["b14b1b6615920eef"]]},{"id":"a4bd895056f646fe","type":"uibuilder","z":"3a20af9f0b232322","g":"7ab5a22cd67392c2","name":"","topic":"","url":"StateChart","okToGo":true,"fwdInMessages":false,"allowScripts":false,"allowStyles":false,"copyIndex":true,"templateFolder":"blank","extTemplate":"","showfolder":false,"reload":false,"sourceFolder":"src","deployedVersion":"7.0.4","showMsgUib":false,"title":"","descr":"","editurl":"vscode://vscode-remote/ssh-remote+10.180.18.18\\Users\\OEEHo\\.node-red\\uibuilder/dt/?windowId=_blank","x":370,"y":390,"wires":[["499308298c239550"],[]]},{"id":"1b114fabfb52db74","type":"uib-cache","z":"3a20af9f0b232322","g":"7ab5a22cd67392c2","cacheall":true,"cacheKey":"topic","newcache":true,"num":"10","storeName":"memory","name":"Cache","storeContext":"context","varName":"uib_cache","x":180,"y":390,"wires":[["a4bd895056f646fe"]]},{"id":"df939924253d4619","type":"link in","z":"3a20af9f0b232322","g":"7ab5a22cd67392c2","name":"link in 16","links":["719cdf76ef8c4e8d"],"x":85,"y":390,"wires":[["1b114fabfb52db74"]]},{"id":"499308298c239550","type":"link out","z":"3a20af9f0b232322","g":"7ab5a22cd67392c2","name":"link out 62","mode":"link","links":["6533dd62217dd1b7"],"x":505,"y":400,"wires":[]},{"id":"5cf856ba7e2e6862","type":"link in","z":"3a20af9f0b232322","g":"7ab5a22cd67392c2","name":"link in 17","links":["c42a7aefb5791676","c4a9f7bc21b9d658"],"x":85,"y":330,"wires":[["a4bd895056f646fe"]]},{"id":"28422642ce0a174a","type":"change","z":"3a20af9f0b232322","g":"7bdce0666512b731","name":"","rules":[{"t":"set","p":"time","pt":"msg","to":"$fromMillis($millis(),'[FNn],[D] [MNn] [Y], [H01]:[m01]:[s01] ','+0530')","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":340,"y":530,"wires":[["67abc3c4e7365874"]]},{"id":"178548589dd8dab9","type":"cronplus","z":"3a20af9f0b232322","g":"7bdce0666512b731","name":"","outputField":"payload","timeZone":"","persistDynamic":false,"commandResponseMsgOutput":"output1","outputs":1,"options":[{"name":"time","topic":"time","payloadType":"date","payload":"","expressionType":"cron","expression":"* * * * * * *","location":"","offset":"0","solarType":"all","solarEvents":"sunrise,sunset"}],"x":150,"y":530,"wires":[["28422642ce0a174a"]]},{"id":"67abc3c4e7365874","type":"uib-update","z":"3a20af9f0b232322","g":"7bdce0666512b731","name":"Time","topic":"","mode":"update","modeSourceType":"update","cssSelector":"#b10","cssSelectorType":"str","slotSourceProp":"time","slotSourcePropType":"msg","attribsSource":"{\"style\": \"border: 1px solid silver;\"}","attribsSourceType":"json","slotPropMarkdown":false,"x":500,"y":530,"wires":[["c4a9f7bc21b9d658"]]},{"id":"c4a9f7bc21b9d658","type":"link out","z":"3a20af9f0b232322","g":"7bdce0666512b731","name":"link out 63","mode":"link","links":["5cf856ba7e2e6862"],"x":605,"y":530,"wires":[]},{"id":"7eda60ae916b1cce","type":"uib-update","z":"3a20af9f0b232322","g":"fa0f33030a7da271","name":"","topic":"","mode":"update","modeSourceType":"update","cssSelector":"#SelDate","cssSelectorType":"str","slotSourceProp":"seldate","slotSourcePropType":"msg","attribsSource":"","attribsSourceType":"msg","slotPropMarkdown":false,"x":545,"y":740,"wires":[["719cdf76ef8c4e8d"]],"l":false},{"id":"719cdf76ef8c4e8d","type":"link out","z":"3a20af9f0b232322","g":"fa0f33030a7da271","name":"link out 64","mode":"link","links":["df939924253d4619"],"x":635,"y":680,"wires":[]},{"id":"6533dd62217dd1b7","type":"link in","z":"3a20af9f0b232322","g":"fa0f33030a7da271","name":"link in 18","links":["499308298c239550"],"x":85,"y":710,"wires":[["94eddf62ccd5c333"]]},{"id":"3d25271024417c93","type":"change","z":"3a20af9f0b232322","g":"fa0f33030a7da271","name":"","rules":[{"t":"set","p":"seldate1","pt":"msg","to":"_ui.form[\"r3-date-req\"].data.oldValue","tot":"msg"},{"t":"set","p":"seldate2","pt":"msg","to":"_ui.form[\"r3-date-req\"].data.newValue","tot":"msg"},{"t":"set","p":"seldate","pt":"msg","to":"'Date Selected:'&seldate2","tot":"jsonata"},{"t":"set","p":"topic","pt":"msg","to":"t-seldate","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":740,"wires":[["7eda60ae916b1cce"]]},{"id":"94eddf62ccd5c333","type":"switch","z":"3a20af9f0b232322","g":"fa0f33030a7da271","name":"","property":"_ui.id","propertyType":"msg","rules":[{"t":"cont","v":"m","vt":"str"},{"t":"eq","v":"btn-send","vt":"str"}],"checkall":"false","repair":false,"outputs":2,"x":170,"y":710,"wires":[["70156f9757a24f22"],["3d25271024417c93"]]},{"id":"70156f9757a24f22","type":"change","z":"3a20af9f0b232322","g":"fa0f33030a7da271","name":"","rules":[{"t":"set","p":"mc","pt":"msg","to":"_ui.slotText","tot":"msg"},{"t":"set","p":"selmc","pt":"msg","to":"'Selected Machine: '&mc","tot":"jsonata"},{"t":"set","p":"topic","pt":"msg","to":"t-selmc","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":680,"wires":[["f2b9129de45e58b8","93694f8b65005641"]]},{"id":"93694f8b65005641","type":"uib-update","z":"3a20af9f0b232322","g":"fa0f33030a7da271","name":"","topic":"","mode":"update","modeSourceType":"update","cssSelector":"#SelMc","cssSelectorType":"str","slotSourceProp":"selmc","slotSourcePropType":"msg","attribsSource":"","attribsSourceType":"msg","slotPropMarkdown":false,"x":535,"y":680,"wires":[["719cdf76ef8c4e8d"]],"l":false},{"id":"2a2405d20ef35a10","type":"change","z":"3a20af9f0b232322","g":"3592ecb00ef22768","name":"","rules":[{"t":"set","p":"data2","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":880,"wires":[["0a81529866a95024"]]},{"id":"88e358a2900c77f4","type":"change","z":"3a20af9f0b232322","g":"3592ecb00ef22768","name":"M08","rules":[{"t":"set","p":"payload","pt":"msg","to":"[[\"m08\",\"ON\",\"2024,10,28,06,00\",\"2024,10,28,06,02\"],[\"m08\",\"OFF\",\"2024,10,28,06,02\",\"2024,10,28,06,09\"],[\"m08\",\"ON\",\"2024,10,28,06,09\",\"2024,10,28,06,11\"],[\"m08\",\"OFF\",\"2024,10,28,06,11\",\"2024,10,28,06,15\"],[\"m08\",\"ON\",\"2024,10,28,06,15\",\"2024,10,28,06,31\"],[\"m08\",\"OFF\",\"2024,10,28,06,31\",\"2024,10,28,06,33\"],[\"m08\",\"ON\",\"2024,10,28,06,33\",\"2024,10,28,06,37\"],[\"m08\",\"OFF\",\"2024,10,28,06,37\",\"2024,10,28,06,38\"]]","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":920,"wires":[["2a2405d20ef35a10"]]},{"id":"241702a04b393b62","type":"change","z":"3a20af9f0b232322","g":"3592ecb00ef22768","name":"M03","rules":[{"t":"set","p":"payload","pt":"msg","to":"[[\"m03\",\"OFF\",\"2024,10,28,06,00\",\"2024,10,28,06,06\"],[\"m03\",\"ON\",\"2024,10,28,06,06\",\"2024,10,28,06,07\"],[\"m03\",\"OFF\",\"2024,10,28,06,07\",\"2024,10,28,06,32\"],[\"m03\",\"ON\",\"2024,10,28,06,32\",\"2024,10,28,06,52\"],[\"m03\",\"OFF\",\"2024,10,28,06,52\",\"2024,10,28,07,22\"],[\"m03\",\"ON\",\"2024,10,28,07,22\",\"2024,10,28,07,47\"],[\"m03\",\"OFF\",\"2024,10,28,07,47\",\"2024,10,28,07,48\"],[\"m03\",\"ON\",\"2024,10,28,07,48\",\"2024,10,28,08,02\"]]","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":840,"wires":[["2a2405d20ef35a10"]]},{"id":"cf7297f001e3758b","type":"switch","z":"3a20af9f0b232322","g":"3592ecb00ef22768","name":"","property":"mc","propertyType":"msg","rules":[{"t":"eq","v":"M-03","vt":"str"},{"t":"eq","v":"M-04","vt":"str"},{"t":"eq","v":"M-08","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":180,"y":880,"wires":[["241702a04b393b62"],["f32a875e0e59957b"],["88e358a2900c77f4"]]},{"id":"14d2df29906751db","type":"link in","z":"3a20af9f0b232322","g":"3592ecb00ef22768","name":"link in 19","links":["f2b9129de45e58b8"],"x":85,"y":880,"wires":[["cf7297f001e3758b"]]},{"id":"f2b9129de45e58b8","type":"link out","z":"3a20af9f0b232322","g":"fa0f33030a7da271","name":"link out 65","mode":"link","links":["14d2df29906751db"],"x":475,"y":640,"wires":[]},{"id":"0a81529866a95024","type":"link out","z":"3a20af9f0b232322","g":"3592ecb00ef22768","name":"link out 66","mode":"link","links":["37e4fd0368333b21"],"x":715,"y":880,"wires":[]},{"id":"f32a875e0e59957b","type":"change","z":"3a20af9f0b232322","g":"3592ecb00ef22768","name":"M04","rules":[{"t":"set","p":"payload","pt":"msg","to":"[[\"m04\",\"OFF\",\"2024,10,28,06,00\",\"2024,10,28,06,11\"],[\"m04\",\"ON\",\"2024,10,28,06,11\",\"2024,10,28,06,13\"],[\"m04\",\"OFF\",\"2024,10,28,06,13\",\"2024,10,28,06,33\"],[\"m04\",\"ON\",\"2024,10,28,06,33\",\"2024,10,28,06,39\"],[\"m04\",\"OFF\",\"2024,10,28,06,39\",\"2024,10,28,06,40\"],[\"m04\",\"ON\",\"2024,10,28,06,40\",\"2024,10,28,06,45\"],[\"m04\",\"OFF\",\"2024,10,28,06,45\",\"2024,10,28,06,49\"],[\"m04\",\"ON\",\"2024,10,28,06,49\",\"2024,10,28,06,51\"]]","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":400,"y":880,"wires":[["2a2405d20ef35a10"]]},{"id":"84b89ef35a890901","type":"change","z":"3a20af9f0b232322","g":"2fe1b2f178b93edc","name":"index.js","rules":[{"t":"set","p":"fname","pt":"msg","to":"index.js","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":940,"y":900,"wires":[["f5470e8ee2a5b3a2"]]},{"id":"f5470e8ee2a5b3a2","type":"template","z":"3a20af9f0b232322","g":"2fe1b2f178b93edc","name":"JS","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":" google.charts.load('current', {'packages':['timeline']});\n google.charts.setOnLoadCallback(drawChart);\n function drawChart() {\n var container = document.getElementById('timeline');\n var chart = new google.visualization.Timeline(container);\n var dataTable = new google.visualization.DataTable();\n\n dataTable.addColumn({ type: 'string', id: 'Machine' });\n dataTable.addColumn({ type: 'string', id: 'State' });\n dataTable.addColumn({ type: 'date', id: 'Start' });\n dataTable.addColumn({ type: 'date', id: 'End' });\n dataTable.addRows([\n ['{{flow.data2[0][0]}}', '{{flow.data2[0][1]}}', new Date({{flow.data2[0][2]}}), new Date({{flow.data2[0][3]}})],\n ['{{flow.data2[1][0]}}', '{{flow.data2[1][1]}}', new Date({{flow.data2[1][2]}}), new Date({{flow.data2[1][3]}})],\n ['{{flow.data2[2][0]}}', '{{flow.data2[2][1]}}', new Date({{flow.data2[2][2]}}), new Date({{flow.data2[2][3]}})],\n ['{{flow.data2[3][0]}}', '{{flow.data2[3][1]}}', new Date({{flow.data2[3][2]}}), new Date({{flow.data2[3][3]}})],\n ['{{flow.data2[4][0]}}', '{{flow.data2[4][1]}}', new Date({{flow.data2[4][2]}}), new Date({{flow.data2[4][3]}})],\n ['{{flow.data2[5][0]}}', '{{flow.data2[5][1]}}', new Date({{flow.data2[5][2]}}), new Date({{flow.data2[5][3]}})],\n ['{{flow.data2[6][0]}}', '{{flow.data2[6][1]}}', new Date({{flow.data2[6][2]}}), new Date({{flow.data2[6][3]}})],\n ['{{flow.data2[7][0]}}', '{{flow.data2[7][1]}}', new Date({{flow.data2[7][2]}}), new Date({{flow.data2[7][3]}})]\n ]);\n\n chart.draw(dataTable);\n }\n\n ","output":"str","x":1110,"y":900,"wires":[["927ce942ae1bbf13","2b5b56e234fae22d"]]},{"id":"927ce942ae1bbf13","type":"uib-save","z":"3a20af9f0b232322","g":"2fe1b2f178b93edc","url":"StateChart","uibId":"a4bd895056f646fe","folder":"src","fname":"","createFolder":false,"reload":false,"usePageName":false,"encoding":"utf8","mode":438,"name":"","topic":"","x":1280,"y":900,"wires":[]},{"id":"37e4fd0368333b21","type":"link in","z":"3a20af9f0b232322","g":"2fe1b2f178b93edc","name":"link in 20","links":["0a81529866a95024"],"x":835,"y":900,"wires":[["84b89ef35a890901"]]},{"id":"2b5b56e234fae22d","type":"link out","z":"3a20af9f0b232322","g":"2fe1b2f178b93edc","name":"link out 67","mode":"link","links":["234aeb9ed9576c56"],"x":1185,"y":840,"wires":[]}]