Setting and printing heating curve with plotly as input for mixer

I am having a problem getting the attached flow to work. I am not able to change the demo chart to my format.
The graph I would like to create should look like this excel graph:

by varying the 3 parameters in the calculation node, I want to display the result.

my test flow :

[{"id":"7027f7d3eb635061","type":"tab","label":"chart ploty","disabled":false,"info":"","env":[]},{"id":"5e0d9a67.116c84","type":"ui_template","z":"7027f7d3eb635061","group":"2e16cb22.999174","name":"Load Plotly CDN","order":17,"width":0,"height":0,"format":"<script src=\"https://cdn.plot.ly/plotly-latest.min.js\"></script>\n","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"global","className":"","x":140,"y":80,"wires":[[]]},{"id":"1ca80c56.a7c7d4","type":"comment","z":"7027f7d3eb635061","name":"Plotly example flows","info":"","x":590,"y":220,"wires":[]},{"id":"66e905d7.65d2bc","type":"inject","z":"7027f7d3eb635061","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":"1","topic":"","payload":"","payloadType":"str","x":570,"y":260,"wires":[["324422cd.18882e"]]},{"id":"324422cd.18882e","type":"change","z":"7027f7d3eb635061","name":"UK Temperature - line chart","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"x\":[\"-20\",\"-19\",\"-18\",\"-17\",\"-16\",\"-15\",\"-14\",\"-13\",\"-12\",\"-11\",\"-10\",\"-9\",\"-8\",\"-7\",\"-6\",\"-5\",\"-4\",\"-3\",\"-2\",\"-1\",\"0\"],\"y\":[\"4.6\",\"4.9\",\"9.3\",\"14.2\",\"17.4\",\"19.3\",\"20.8\",\"21.6\",\"19.2\",\"14.3\",\"9.8\",\"6.3\"]}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":770,"y":260,"wires":[[]]},{"id":"2e5762f6.c687fe","type":"ui_template","z":"7027f7d3eb635061","group":"6aa20356.9b59bc","name":"Example 1","order":1,"width":"29","height":"10","format":"<div id=\"example1\"></div>\n<script>\n\n// Initialize chart\nvar data = [{x:[0],y:[0]}];\nvar layout = {\n    title:'Awaiting data',\n    };\nPlotly.newPlot('example1', data, layout);\n\n// Update data & layout\n(function(scope) {\n  scope.$watch('msg', function(msg) {\n    if (msg) {\n       \n    var data = [{\n        x:msg.payload.x,\n        y:msg.payload.y,\n        connectgaps: true\n        }];\n\n    var layout = {\n        title: \"Vorlauftemperatur\",\n        titlefont: {\n            size: 22,\n            },\n        autosize: true,\n        plot_bgcolor: '#ffffff',\n        paper_bgcolor: '#ffffff',\n        'xaxis': {\n            title: 'Aussen °C',\n            fixedrange: false\n            },\n        'yaxis': {\n            title: 'Vorlauftemp °C',\n            mode: 'lines',\n            fixedrange: false\n            }\n        };\n\n    Plotly.newPlot('example1', data, layout, { displayModeBar: false }, { staticPlot: true }, { displaylogo: false },)\n    }\n  });\n})(scope);\n</script>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","className":"","x":770,"y":580,"wires":[[]]},{"id":"99f06bfbe0452bac","type":"function","z":"7027f7d3eb635061","name":"function 20","func":"let a =[];\nlet c = -20;\n\nfor (let i = 0; i < 41; i++) {\n  t = (c).toFixed(0);  \n  a[i] = '\"' + t + '\"';\n  c = c+1;\n}\nmsg.payload = a;\nflow.set('a1',msg.payload);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":550,"y":380,"wires":[["f5163fe0ebd50c94"]]},{"id":"96dc3587e2ad60c1","type":"inject","z":"7027f7d3eb635061","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":400,"y":380,"wires":[["99f06bfbe0452bac"]]},{"id":"f5163fe0ebd50c94","type":"debug","z":"7027f7d3eb635061","name":"debug 20","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":720,"y":380,"wires":[]},{"id":"6d77d94b23983cd8","type":"function","z":"7027f7d3eb635061","name":"Heizkurve VL Soll","func":"//let a = flow.get('va');\n//let b = flow.get('vb');\n//let c = flow.get('vc');\n\nlet a = 20.00;\nlet b = 6.00;\nlet c = 0.70;\n\nlet x = msg.payload;\nif (x > 20.00){\n    msg.payload = 0;\n    return msg;\n}\nif (x < -20.00){\n    msg.payload = -20.00;\n}\nmsg.payload = a + b*Math.sqrt(c*(((20-x)+20)-20));\nmsg.payload = Number.parseFloat(msg.payload.toFixed(2));\nglobal.set('vorlauf_soll',msg.payload);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":570,"y":480,"wires":[["252731e71323cfe8","8f80d3a1c1b4a461"]]},{"id":"ed082435c76aa11e","type":"debug","z":"7027f7d3eb635061","name":"debug 21","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":960,"y":480,"wires":[]},{"id":"f70b3b6b333a3a34","type":"function","z":"7027f7d3eb635061","name":"parseFloat","func":"delete msg.topic;\nmsg.payload = parseFloat(msg.payload);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":390,"y":480,"wires":[["6d77d94b23983cd8"]]},{"id":"e2f39e8a1c3c7fb7","type":"function","z":"7027f7d3eb635061","name":"function 21","func":"let text =[];\nlet c = -20;\n\nfor (let i = 0; i < 41; i++) {\n    node.send({payload:c});\n    c = c+1;\n}\nnull;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":230,"y":480,"wires":[["f70b3b6b333a3a34"]]},{"id":"3a680589c62875e0","type":"inject","z":"7027f7d3eb635061","name":"","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"test","x":70,"y":480,"wires":[["e2f39e8a1c3c7fb7"]]},{"id":"252731e71323cfe8","type":"function","z":"7027f7d3eb635061","name":"function 22","func":"let a = context.get('a');\nlet c = context.get('c');\na[c] = '\"' + msg.payload.toFixed(2) + '\"';\nc = c + 1;\ncontext.set('a',a);\ncontext.set('c',c);\nif (c < 21){\n    return null;\n}\nmsg.payload = a;\ncontext.set('a',[]);\ncontext.set('c',0);\nflow.set('a2',msg.payload);\nreturn msg;","outputs":1,"noerr":0,"initialize":"// Code added here will be run once\n// whenever the node is started.\ncontext.set('a',[]);\ncontext.set('c',0)","finalize":"","libs":[],"x":770,"y":480,"wires":[["ed082435c76aa11e","a2668c674833b6b1"]]},{"id":"8f80d3a1c1b4a461","type":"debug","z":"7027f7d3eb635061","name":"debug 23","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":760,"y":440,"wires":[]},{"id":"a2668c674833b6b1","type":"function","z":"7027f7d3eb635061","name":"function 23","func":"s1 = '{\"x\":['\ns2 = '\"],\"y\":\"[';\ns3 =']}';\nmsg.payload = s1 + flow.get('a1') + s2 + flow.get('a2') + s3;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":550,"y":600,"wires":[["77fa6b6d81b19356","2e5762f6.c687fe"]]},{"id":"77fa6b6d81b19356","type":"debug","z":"7027f7d3eb635061","name":"debug 24","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":760,"y":620,"wires":[]},{"id":"2e16cb22.999174","type":"ui_group","name":"Chart","tab":"567d8fae.98148","order":1,"disp":false,"width":"10","collapse":false},{"id":"6aa20356.9b59bc","type":"ui_group","name":"examples","tab":"d5ad8b85.f5ba18","order":1,"disp":true,"width":"29","collapse":false,"className":""},{"id":"567d8fae.98148","type":"ui_tab","name":"Realtime Power","icon":"dashboard","order":1,"disabled":false,"hidden":false},{"id":"d5ad8b85.f5ba18","type":"ui_tab","name":"Plotly","icon":"dashboard","disabled":false,"hidden":false}]

I would very much appreciate your help .

Problem solved! :slight_smile:

[{"id":"7027f7d3eb635061","type":"tab","label":"chart ploty","disabled":false,"info":"","env":[]},{"id":"99f06bfbe0452bac","type":"function","z":"7027f7d3eb635061","name":"x array","func":"let a =[];\n\nfor (let i = 0; i < 41; i++) {\n  a[i] = (i-20).toFixed(0);\n}\nmsg.payload = a;\nflow.set('temp',msg.payload);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":270,"y":180,"wires":[["f5163fe0ebd50c94","e2f39e8a1c3c7fb7"]]},{"id":"96dc3587e2ad60c1","type":"inject","z":"7027f7d3eb635061","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":140,"y":180,"wires":[["99f06bfbe0452bac"]]},{"id":"f5163fe0ebd50c94","type":"debug","z":"7027f7d3eb635061","name":"debug 20","active":false,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":440,"y":180,"wires":[]},{"id":"6d77d94b23983cd8","type":"function","z":"7027f7d3eb635061","name":"Heizkurve VL Soll","func":"//let a = flow.get('va');\n//let b = flow.get('vb');\n//let c = flow.get('vc');\n\nlet a = 20.00;\nlet b = 6.00;\nlet c = 0.70;\n\nlet x = msg.payload;\nif (x > 20.00){\n    msg.payload = 0;\n    return msg;\n}\nif (x < -20.00){\n    msg.payload = -20.00;\n}\nmsg.payload = a + b*Math.sqrt(c*(((20-x)+20)-20));\nmsg.payload = Number.parseFloat(msg.payload.toFixed(2));\nglobal.set('vorlauf_soll',msg.payload);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":630,"y":260,"wires":[["49df44370aee1bc6"]]},{"id":"ed082435c76aa11e","type":"debug","z":"7027f7d3eb635061","name":"debug 21","active":false,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1160,"y":260,"wires":[]},{"id":"f70b3b6b333a3a34","type":"function","z":"7027f7d3eb635061","name":"parseFloat","func":"delete msg.topic;\nmsg.payload = parseFloat(msg.payload);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":450,"y":260,"wires":[["6d77d94b23983cd8"]]},{"id":"e2f39e8a1c3c7fb7","type":"function","z":"7027f7d3eb635061","name":"input temp -20 to 20","func":"let text =[];\nlet c = -20;\n\nfor (let i = 0; i < 41; i++) {\n    node.send({payload:((i-20).toFixed(2))});\n}\nnull;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":260,"y":260,"wires":[["f70b3b6b333a3a34"]]},{"id":"252731e71323cfe8","type":"function","z":"7027f7d3eb635061","name":"y array","func":"let a2 = context.get('a2');\nlet i = context.get('i');\nlet vorl = [];\n\na2[i] = msg.payload;\ni = i + 1;\ncontext.set('a2',a2);\ncontext.set('i',i);\nif (i < 41){\n    flow.set('vorl',a2);\n    return null;\n}\nmsg.payload = a2;\nreturn msg;","outputs":1,"noerr":0,"initialize":"// Code added here will be run once\n// whenever the node is started.\ncontext.set('a2',[]);\ncontext.set('i',0);","finalize":"","libs":[],"x":950,"y":260,"wires":[["ed082435c76aa11e","89650ccdb6f6b20e"]]},{"id":"49df44370aee1bc6","type":"function","z":"7027f7d3eb635061","name":"function 25","func":"let m = msg.payload;\nmsg.payload = m.toFixed(2);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":810,"y":260,"wires":[["252731e71323cfe8"]]},{"id":"89650ccdb6f6b20e","type":"function","z":"7027f7d3eb635061","name":"function 26","func":"let temp = flow.get('temp');\nlet vorl = flow.get('vorl');\n\nmsg.payload = {\"x\":temp,\"y\":vorl};\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":830,"y":360,"wires":[["916f85b2c74638fb"]]},{"id":"91f16376a975a7ff","type":"debug","z":"7027f7d3eb635061","name":"debug 28","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1160,"y":360,"wires":[]},{"id":"3c350bda599db6e4","type":"ui_template","z":"7027f7d3eb635061","group":"2e16cb22.999174","name":"Load Plotly CDN","order":17,"width":0,"height":0,"format":"<script src=\"https://cdn.plot.ly/plotly-latest.min.js\"></script>\n","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"global","className":"","x":140,"y":80,"wires":[[]]},{"id":"916f85b2c74638fb","type":"ui_template","z":"7027f7d3eb635061","group":"c0c414fd56cf062e","name":"Heizkurve","order":1,"width":"23","height":"15","format":"<div id=\"Heizkurve\"></div>\n\n<script>\n// Initialize chart\nvar data = [{x:[0],y:[0]}];\nvar layout = {\n    title:'Awaiting data',\n    };\nPlotly.newPlot('Heizkurve', data, layout);\n\n// Update data & layout\n(function(scope) {\n  scope.$watch('msg', function(msg) {\n    if (msg) {\n       \n    var data = [{\n        x:msg.payload.x,\n        y:msg.payload.y,\n        connectgaps: true\n        }];\n\n    var layout = {\n        title: \"Vorlauftemperarturkurve\",\n        titlefont: {\n            size: 22,\n            },\n        autosize: false,\n        width: 1225,\n        height: 795,\n        plot_bgcolor: '#ffffff',\n        paper_bgcolor: '#ffffff',\n        'xaxis': {\n            title: 'Aussentemperatur °C',\n            range: [-20, 20],\n            dtick: 1,\n            tickangle: 45,\n            },\n        'yaxis': {\n            title: 'Vorlauftemperatur °C',\n            mode: 'lines',\n            range: [0, 60],\n            dtick: 5,            \n            }\n        };\n\n    Plotly.newPlot('Heizkurve', data, layout, { displayModeBar: false }, { staticPlot: true }, { displaylogo: false },)\n    }\n  });\n})(scope);\n</script>\n","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","className":"","x":980,"y":360,"wires":[["91f16376a975a7ff"]]},{"id":"05fd2193a2e07ebf","type":"comment","z":"7027f7d3eb635061","name":"x-Achse","info":"","x":640,"y":180,"wires":[]},{"id":"06c6f250e696278f","type":"comment","z":"7027f7d3eb635061","name":"y-Achse","info":"","x":1340,"y":260,"wires":[]},{"id":"0238554e0d40eaf9","type":"comment","z":"7027f7d3eb635061","name":"Graph","info":"","x":1330,"y":360,"wires":[]},{"id":"2e16cb22.999174","type":"ui_group","name":"Chart","tab":"567d8fae.98148","order":1,"disp":false,"width":"10","collapse":false},{"id":"c0c414fd56cf062e","type":"ui_group","name":"Group 1","tab":"8385a11b57beb549","order":1,"disp":false,"width":"23","collapse":false,"className":""},{"id":"567d8fae.98148","type":"ui_tab","name":"Realtime Power","icon":"dashboard","order":1,"disabled":false,"hidden":false},{"id":"8385a11b57beb549","type":"ui_tab","name":"Tab 6","icon":"dashboard","order":6}]

2 Likes

Final flow where you can play with the curve

[{"id":"7027f7d3eb635061","type":"tab","label":"chart ploty","disabled":false,"info":"","env":[]},{"id":"99f06bfbe0452bac","type":"function","z":"7027f7d3eb635061","name":"x array","func":"let a =[];\ndelete msg.topic;\n\nfor (let i = 0; i < 41; i++) {\n  a[i] = (i-20).toFixed(0);\n}\nmsg.payload = a;\nflow.set('temp',msg.payload);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":250,"y":260,"wires":[["f5163fe0ebd50c94","e2f39e8a1c3c7fb7"]]},{"id":"96dc3587e2ad60c1","type":"inject","z":"7027f7d3eb635061","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":100,"y":240,"wires":[["99f06bfbe0452bac"]]},{"id":"f5163fe0ebd50c94","type":"debug","z":"7027f7d3eb635061","name":"x-Achse","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":260,"y":180,"wires":[]},{"id":"6d77d94b23983cd8","type":"function","z":"7027f7d3eb635061","name":"Heizkurve VL Soll","func":"let a = flow.get('va');\nlet b = flow.get('vb');\nlet c = flow.get('vc');\n\n//let a = 20.00;\n//let b = 6.00;\n//let c = 0.70;\n\nlet x = msg.payload;\nif (x > 20.00){\n    msg.payload = 0;\n    return msg;\n}\nif (x < -20.00){\n    msg.payload = -20.00;\n}\n\nlet t = \"va:\" + a  + \" | \" + \"vb:\" + b + \" | \"+ \"vc:\" + c;\nnode.status({text:t});\n\nmsg.payload = a + b*Math.sqrt(c*(((20-x)+20)-20));\nmsg.payload = Number.parseFloat(msg.payload.toFixed(2));\nmsg.payload = msg.payload.toFixed(2);\nglobal.set('vorlauf_soll',msg.payload);\nreturn msg;\n\n\n//msg.payload = Number.parseFloat(msg.payload.toFixed(2));","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":830,"y":260,"wires":[["252731e71323cfe8"]]},{"id":"ed082435c76aa11e","type":"debug","z":"7027f7d3eb635061","name":"y -Achse","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1000,"y":180,"wires":[]},{"id":"f70b3b6b333a3a34","type":"function","z":"7027f7d3eb635061","name":"parseFloat","func":"delete msg.topic;\nmsg.payload = parseFloat(msg.payload);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":650,"y":260,"wires":[["6d77d94b23983cd8"]]},{"id":"e2f39e8a1c3c7fb7","type":"function","z":"7027f7d3eb635061","name":"input temp from -20 to 20","func":"let text =[];\nlet c = -20;\n\nfor (let i = 0; i < 41; i++) {\n    node.send({payload:((i-20).toFixed(2))});\n}\nnull;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":450,"y":260,"wires":[["f70b3b6b333a3a34"]]},{"id":"252731e71323cfe8","type":"function","z":"7027f7d3eb635061","name":"y array","func":"let a2 = context.get('a2');\nlet i = context.get('i');\nlet vorl = [];\n\na2[i] = msg.payload;\ni = i + 1;\ncontext.set('a2',a2);\ncontext.set('i',i);\nif (i < 41){\n    flow.set('vorl',a2);\n    return null;\n}\ncontext.set('a2',[]);\ncontext.set('i',0);\nmsg.payload = a2;\nreturn msg;","outputs":1,"noerr":0,"initialize":"// Code added here will be run once\n// whenever the node is started.\ncontext.set('a2',[]);\ncontext.set('i',0);","finalize":"","libs":[],"x":990,"y":260,"wires":[["ed082435c76aa11e","89650ccdb6f6b20e"]]},{"id":"89650ccdb6f6b20e","type":"function","z":"7027f7d3eb635061","name":"function 26","func":"let temp = flow.get('temp');\nlet vorl = flow.get('vorl');\n\nmsg.payload = {\"x\":temp,\"y\":vorl};\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1150,"y":260,"wires":[["916f85b2c74638fb"]]},{"id":"91f16376a975a7ff","type":"debug","z":"7027f7d3eb635061","name":"debug 28","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1440,"y":260,"wires":[]},{"id":"3c350bda599db6e4","type":"ui_template","z":"7027f7d3eb635061","group":"2e16cb22.999174","name":"Load Plotly CDN","order":17,"width":0,"height":0,"format":"<script src=\"https://cdn.plot.ly/plotly-latest.min.js\"></script>\n","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"global","className":"","x":120,"y":80,"wires":[[]]},{"id":"916f85b2c74638fb","type":"ui_template","z":"7027f7d3eb635061","group":"c0c414fd56cf062e","name":"Heizkurve","order":1,"width":23,"height":15,"format":"<div id=\"Heizkurve\"></div>\n\n<script>\n// Initialize chart\nvar data = [{x:[0],y:[0]}];\nvar layout = {\n    title:'Awaiting data',\n    };\nPlotly.newPlot('Heizkurve', data, layout);\n\n// Update data & layout\n(function(scope) {\n  scope.$watch('msg', function(msg) {\n    if (msg) {\n       \n    var data = [{\n        x:msg.payload.x,\n        y:msg.payload.y,\n        connectgaps: true\n        }];\n\n    var layout = {\n        title: \"Vorlauftemperarturkurve\",\n        titlefont: {\n            size: 22,\n            },\n        autosize: false,\n        width: 1225,\n        height: 795,\n        plot_bgcolor: '#ffffff',\n        paper_bgcolor: '#ffffff',\n        'xaxis': {\n            title: 'Aussentemperatur °C',\n            range: [-20, 20],\n            dtick: 1,\n            tickangle: 45,\n            },\n        'yaxis': {\n            title: 'Vorlauftemperatur °C',\n            mode: 'lines',\n            range: [0, 60],\n            dtick: 5,            \n            }\n        };\n\n    Plotly.newPlot('Heizkurve', data, layout, { displayModeBar: false }, { staticPlot: true}, { displaylogo: false },)\n    }\n  });\n})(scope);\n</script>\n","storeOutMessages":false,"fwdInMessages":false,"resendOnRefresh":false,"templateScope":"local","className":"","x":1300,"y":260,"wires":[["91f16376a975a7ff"]]},{"id":"0238554e0d40eaf9","type":"comment","z":"7027f7d3eb635061","name":"Graph","info":"","x":1290,"y":180,"wires":[]},{"id":"38b2a07f851549d1","type":"ui_numeric","z":"7027f7d3eb635061","name":"ganz","label":"ganz","tooltip":"","group":"f89def69625bb5df","order":2,"width":3,"height":1,"wrap":false,"passthru":true,"topic":"ganz","topicType":"str","format":"{{value}}","min":0,"max":"50","step":1,"className":"","x":550,"y":420,"wires":[["13648929e30da780"]]},{"id":"85e029d11641a2b2","type":"ui_numeric","z":"7027f7d3eb635061","name":"zentel","label":"dec","tooltip":"","group":"f89def69625bb5df","order":3,"width":3,"height":1,"wrap":false,"passthru":true,"topic":"zentel","topicType":"str","format":"{{msg.payload}}","min":0,"max":"99","step":1,"className":"","x":550,"y":480,"wires":[["13648929e30da780"]]},{"id":"13648929e30da780","type":"function","z":"7027f7d3eb635061","name":"function 27","func":"if (msg.topic === \"ganz\"){\n    context.set('ganz', msg.payload)\n}\nif (msg.topic === \"zentel\"){\n    context.set('zentel', msg.payload)\n}\n\nmsg.payload = parseFloat((context.get('ganz') + context.get('zentel')/100).toFixed(2));\nmsg.payload = parseFloat(msg.payload);\nflow.set('va', msg.payload);\nreturn msg;","outputs":1,"noerr":0,"initialize":"// Code added here will be run once\n// whenever the node is started.\ncontext.set('ganz', 0);\ncontext.set('zentel', 0);\n","finalize":"","libs":[],"x":750,"y":440,"wires":[["cf1a023c1f900fe0","729213a23821f549"]]},{"id":"cf1a023c1f900fe0","type":"debug","z":"7027f7d3eb635061","name":"debug 29","active":false,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":920,"y":460,"wires":[]},{"id":"3d232bb513677e81","type":"ui_text","z":"7027f7d3eb635061","group":"f89def69625bb5df","order":1,"width":3,"height":1,"name":"Variable a","label":"Variable a:","format":"{{msg.payload}}","layout":"row-spread","className":"","x":1080,"y":420,"wires":[]},{"id":"16ceba5d31391390","type":"ui_numeric","z":"7027f7d3eb635061","name":"ganz","label":"ganz","tooltip":"","group":"f89def69625bb5df","order":5,"width":3,"height":1,"wrap":false,"passthru":true,"topic":"ganz","topicType":"str","format":"{{msg.payload}}","min":0,"max":"50","step":1,"className":"","x":550,"y":540,"wires":[["38fc796a93c871a9"]]},{"id":"d372c93dc879a6d4","type":"ui_numeric","z":"7027f7d3eb635061","name":"zentel","label":"dec","tooltip":"","group":"f89def69625bb5df","order":6,"width":3,"height":1,"wrap":false,"passthru":true,"topic":"zentel","topicType":"str","format":"{{msg.payload}}","min":0,"max":"99","step":1,"className":"","x":550,"y":600,"wires":[["38fc796a93c871a9"]]},{"id":"38fc796a93c871a9","type":"function","z":"7027f7d3eb635061","name":"function 28","func":"if (msg.topic === \"ganz\"){\n    context.set('ganz', msg.payload)\n}\nif (msg.topic === \"zentel\"){\n    context.set('zentel', msg.payload)\n}\n\nmsg.payload = parseFloat((context.get('ganz') + context.get('zentel')/100).toFixed(2));\nmsg.payload = parseFloat(msg.payload);\nflow.set('vb', msg.payload);\nreturn msg;","outputs":1,"noerr":0,"initialize":"// Code added here will be run once\n// whenever the node is started.\ncontext.set('ganz', 0);\ncontext.set('zentel', 0);\n","finalize":"","libs":[],"x":750,"y":560,"wires":[["d30477831a4580cd","4f675105621e70a1"]]},{"id":"d30477831a4580cd","type":"debug","z":"7027f7d3eb635061","name":"debug 30","active":false,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":920,"y":580,"wires":[]},{"id":"7263534f5b27102e","type":"ui_text","z":"7027f7d3eb635061","group":"f89def69625bb5df","order":4,"width":3,"height":1,"name":"Variable b","label":"Variable b:","format":"{{msg.payload}}","layout":"row-spread","className":"","x":1080,"y":540,"wires":[]},{"id":"5babf3ea41136684","type":"ui_numeric","z":"7027f7d3eb635061","name":"ganz","label":"ganz","tooltip":"","group":"f89def69625bb5df","order":8,"width":3,"height":1,"wrap":false,"passthru":true,"topic":"ganz","topicType":"str","format":"{{msg.payload}}","min":0,"max":"50","step":1,"className":"","x":550,"y":660,"wires":[["832cb121f9c6f0b4"]]},{"id":"f93646da4ba43453","type":"ui_numeric","z":"7027f7d3eb635061","name":"zentel","label":"dec","tooltip":"","group":"f89def69625bb5df","order":9,"width":3,"height":1,"wrap":false,"passthru":true,"topic":"zentel","topicType":"str","format":"{{msg.payload}}","min":0,"max":"99","step":1,"className":"","x":550,"y":720,"wires":[["832cb121f9c6f0b4"]]},{"id":"832cb121f9c6f0b4","type":"function","z":"7027f7d3eb635061","name":"function 29","func":"if (msg.topic === \"ganz\"){\n    context.set('ganz', msg.payload)\n}\nif (msg.topic === \"zentel\"){\n    context.set('zentel', msg.payload)\n}\n\nmsg.payload = parseFloat((context.get('ganz') + context.get('zentel')/100).toFixed(2));\nmsg.payload = parseFloat(msg.payload);\nflow.set('vc', msg.payload);\nreturn msg;","outputs":1,"noerr":0,"initialize":"// Code added here will be run once\n// whenever the node is started.\ncontext.set('ganz', 0);\ncontext.set('zentel', 0);\n","finalize":"","libs":[],"x":750,"y":680,"wires":[["4aba0a5104e01fdf","78176b783a21c0bb"]]},{"id":"4aba0a5104e01fdf","type":"debug","z":"7027f7d3eb635061","name":"debug 31","active":false,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":920,"y":700,"wires":[]},{"id":"d75e4cb434ad748b","type":"ui_text","z":"7027f7d3eb635061","group":"f89def69625bb5df","order":7,"width":3,"height":1,"name":"Variable c","label":"Variable c:","format":"{{msg.payload}}","layout":"row-spread","className":"","x":1080,"y":660,"wires":[]},{"id":"729213a23821f549","type":"function","z":"7027f7d3eb635061","name":"function 30","func":"msg.payload = msg.payload.toFixed(2);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":930,"y":420,"wires":[["3d232bb513677e81"]]},{"id":"4f675105621e70a1","type":"function","z":"7027f7d3eb635061","name":"function 31","func":"msg.payload = msg.payload.toFixed(2);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":930,"y":540,"wires":[["7263534f5b27102e"]]},{"id":"78176b783a21c0bb","type":"function","z":"7027f7d3eb635061","name":"function 32","func":"msg.payload = msg.payload.toFixed(2);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":930,"y":660,"wires":[["d75e4cb434ad748b"]]},{"id":"05acb33c992dce68","type":"ui_button","z":"7027f7d3eb635061","name":"start calc","group":"f89def69625bb5df","order":10,"width":0,"height":0,"passthru":false,"label":"Start calculation","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"","payloadType":"date","topic":"","topicType":"str","x":100,"y":280,"wires":[["99f06bfbe0452bac"]]},{"id":"9b28a34d46c6c2c6","type":"inject","z":"7027f7d3eb635061","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":100,"y":560,"wires":[["f76cfd6ae81610a7","6c9057083ce3503d","e59ebd86510085ab","45a300f65f240384","4dd0e3d712d04576","bd28ebed603514c1"]]},{"id":"bd28ebed603514c1","type":"function","z":"7027f7d3eb635061","name":"20","func":"msg.payload = 20;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":430,"y":420,"wires":[["38b2a07f851549d1"]]},{"id":"4dd0e3d712d04576","type":"function","z":"7027f7d3eb635061","name":"0","func":"msg.payload = 0;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":430,"y":480,"wires":[["85e029d11641a2b2"]]},{"id":"f76cfd6ae81610a7","type":"function","z":"7027f7d3eb635061","name":"20","func":"msg.payload = 6;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":430,"y":540,"wires":[["16ceba5d31391390"]]},{"id":"6c9057083ce3503d","type":"function","z":"7027f7d3eb635061","name":"0","func":"msg.payload = 0;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":430,"y":600,"wires":[["d372c93dc879a6d4"]]},{"id":"e59ebd86510085ab","type":"function","z":"7027f7d3eb635061","name":"0","func":"msg.payload = 0;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":430,"y":660,"wires":[["5babf3ea41136684"]]},{"id":"45a300f65f240384","type":"function","z":"7027f7d3eb635061","name":"0","func":"msg.payload = 70;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":430,"y":720,"wires":[["f93646da4ba43453"]]},{"id":"2e16cb22.999174","type":"ui_group","name":"Chart","tab":"567d8fae.98148","order":1,"disp":false,"width":"10","collapse":false},{"id":"c0c414fd56cf062e","type":"ui_group","name":"Graph","tab":"8385a11b57beb549","order":1,"disp":false,"width":"23","collapse":false,"className":""},{"id":"f89def69625bb5df","type":"ui_group","name":"Variables","tab":"8385a11b57beb549","order":2,"disp":true,"width":9,"collapse":false,"className":""},{"id":"567d8fae.98148","type":"ui_tab","name":"Realtime Power","icon":"dashboard","order":4,"disabled":false,"hidden":false},{"id":"8385a11b57beb549","type":"ui_tab","name":"Tab 6","icon":"dashboard","order":1}]

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.