-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I can't do it work #1
Comments
Hello .. I tested the steps again today and its working for me (on Windows 11) |
Hello, When I trie navbar example, npm run build fails
If I clone the other example, node-red energy-monitor front-end works and show pages, but there isn't any communication to node-red. I tried to change datetime to show selection y uibuilder output msg but there isn't any message. I tried both in windows 10 and Raspian. |
possibly its because on my Windows system i had Git bash installed and thats why the Edit the
.. and try to build again. |
Hi. |
do you get any errors in your browser's Developers tools ? have you restarted the node-red server ? have you made sure you are using the correct url path as defined in the uibuilder node and have you set the |
Is your project compatible with https://totallyinformation.github.io/node-red-contrib-uibuilder/#/ version 5? I tried to install your project, but I get empty pages, only a header |
Hello @ericplan .. i found some time and tested it with uibuilder v5.0.2 as well. can you confirm that those settings match ? (url and uibuilder start path) |
Hello @unborn-andy, |
Always the one in
Heheh .. what did you expect? .. so you got it running (without the socket errors) .. well .. this is my project ;)
in this case, where we are using a bundler (parcel-bundler), a full path is needed otherwise the bundler complains and gives errors during the build step.
yes
Same here .. im new to this stuff also ;) |
Ah, clear. I expected to see the energy-monitor page as from the attached image. That was the thing I was looking for. Can you guide me through the installation for that energy-monitor with some tips? And if possible some sample flows from node-red? My setup is much the same as yours with modbus kWh-meters and a MariaDB. |
ok .. the header template was part of a larger energy-monitor project, which you can study here I will share the flow and i hope you can make some sence out of it .. or at least get some ideas Flow that takes the values from Modbus and saves in Context and then in db
uibuilder Flow that links requests to and from the modbus flow
|
Hi,
Thanks for the reply and for the flow. Where should I put these Energy-Monitor files? In what directory? Documentation says it should be the root directory, this is navbar?
Regards,
Eric
… On 29 May 2022, at 17:33, unborn-andy ***@***.***> wrote:
I expected to see the energy-monitor page as from the attached image
ok .. the header template was part of a larger energy-monitor project, which you can study here
https://github.com/unborn-andy/nodered-monitor <https://github.com/unborn-andy/nodered-monitor>
There on each page .. i additionally use vue-chartjs for the charts, vue2-datepicker for selecting the date range
The code is a bit of a mess because i didnt have to much experience in coding
I will share the flow and i hope you can make some sence out of it .. or at least get some ideas
Note that im using sqlite db .. you'll have to replace that to match your db
Flow that takes the values from Modbus and saves in Context and then in db
Also responsible for making the queries to the db
[{"id":"89e2edc2.2ff858","type":"tab","label":"Elnet","disabled":false,"info":""},{"id":"345d67c9.e026a","type":"debug","z":"89e2edc2.2ff858","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":890,"y":1920,"wires":[]},{"id":"1c22e49c.2eee1b","type":"function","z":"89e2edc2.2ff858","name":"insert Volts","func":"let modbus = global.get('Modbus')\n\nlet entries = Object.entries(modbus) \nentries = entries.filter( el => el[0].match(/^V_/)) // filter Volts\n\nlet keys = entries.map( el => el[0]).join(', ')\nlet values = entries.map( el => el[1] ? el[1] : 'null' ).join(', ')\n\n\nlet newMsg = {};\n\n// newMsg.topic = `INSERT INTO Volts (dt, 'V_31_L1', 'V_31_L2', 'V_31_L3', 'V_32_L1', 'V_32_L2', 'V_32_L3', 'V_33_L1', 'V_33_L2', 'V_33_L3', 'V_34_L1', 'V_34_L2', 'V_34_L3', 'V_35_L1', 'V_35_L2', 'V_35_L3', 'V_36_L1', 'V_36_L2', 'V_36_L3') \n// VALUES (datetime('now', 'localtime'), ${V_31_L1}, ${V_31_L2}, ${V_31_L3}, ${V_32_L1}, ${V_32_L2}, ${V_32_L3}, ${V_33_L1}, ${V_33_L2}, ${V_33_L3}, ${V_34_L1}, ${V_34_L2}, ${V_34_L3}, ${V_35_L1}, ${V_35_L2}, ${V_35_L3}, ${V_36_L1}, ${V_36_L2}, ${V_36_L3})`;\n\nnewMsg.topic = `INSERT INTO Volts (dt, ${keys}) VALUES (datetime('now', 'localtime'), ${values})`;\n\nreturn newMsg;\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":470,"y":1760,"wires":[["f77916c8.cb92b"]]},{"id":"c0c98d2a.d142a","type":"comment","z":"89e2edc2.2ff858","name":"CRON insert Modbus values to sqlite DB ","info":"","x":840,"y":1780,"wires":[]},{"id":"d57b9ac9.d14f98","type":"function","z":"89e2edc2.2ff858","name":"Monthly Sql Query","func":"\nlet table = msg.payload.table;\nlet date = moment(msg.payload.startDate, 'MMM YYYY').format('YYYY-MM');\n\n//newMsg.topic = `SELECT * FROM ${table} WHERE dt IN (SELECT MAX(dt) FROM ${table} WHERE dt LIKE '${date}%' GROUP BY DATE(dt) UNION SELECT MIN(dt) FROM ${table} WHERE dt LIKE '${date}%' GROUP BY DATE(dt))`\nmsg.topic = `SELECT * FROM ${table} WHERE dt IN (SELECT MAX(dt) FROM ${table} WHERE dt LIKE '${date}%' GROUP BY DATE(dt) UNION SELECT MIN(dt) FROM ${table} WHERE dt LIKE '${date}%' GROUP BY DATE(dt))`\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[{"var":"moment","module":"moment"}],"x":376,"y":2639,"wires":[["9b0ec393.5651c8"]]},{"id":"9ebc192d.10738","type":"comment","z":"89e2edc2.2ff858","name":"Monthly Energy","info":"","x":366,"y":2579,"wires":[]},{"id":"c1de83ff.c444c8","type":"function","z":"89e2edc2.2ff858","name":"Daily Power","func":"\nlet startDate = msg.payload.startDate || moment().format('YYYY-MM-DD HH:mm:ss'); // \"2020-07-05 07:00:00\";\nlet endDate = msg.payload.endDate || moment().format('YYYY-MM-DD HH:mm:ss');\nlet table = msg.payload.table\n\nmsg.topic = `SELECT * FROM ${table}\nWHERE datetime(dt) BETWEEN datetime('${startDate}') AND datetime('${endDate}')`\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[{"var":"moment","module":"moment"}],"x":356,"y":3119,"wires":[["2874e962.9cb7ae"]]},{"id":"2a0693e2.8cd734","type":"comment","z":"89e2edc2.2ff858","name":"Daily Power","info":"","x":356,"y":3059,"wires":[]},{"id":"68a4aec7.1924b8","type":"link in","z":"89e2edc2.2ff858","name":"to sql","links":["e436e601.a543f","1df62ef8.d642e9"],"x":55,"y":3260,"wires":[["b415c1bd.5dd598"]]},{"id":"5132a6b1.df3ab","type":"link out","z":"89e2edc2.2ff858","name":"from sql","links":["8448e455.51aa1"],"x":1181,"y":3039,"wires":[]},{"id":"d73de77.1bac698","type":"function","z":"89e2edc2.2ff858","name":"insert Current","func":"let modbus = global.get('Modbus')\n\n\nlet entries = Object.entries(modbus) \nentries = entries.filter( el => el[0].match(/^A_/)) // filter Current\n\nlet keys = entries.map( el => el[0]).join(', ')\nlet values = entries.map( el => el[1] ? el[1] : 'null' ).join(', ')\n\nlet newMsg = {};\n\n// newMsg.topic = `INSERT INTO Current (dt, 'A_31_L1', 'A_31_L2', 'A_31_L3', 'A_32_L1', 'A_32_L2', 'A_32_L3', 'A_33_L1', 'A_33_L2', 'A_33_L3', 'A_34_L1', 'A_34_L2', 'A_34_L3', 'A_35_L1', 'A_35_L2', 'A_35_L3', 'A_36_L1', 'A_36_L2', 'A_36_L3') \n// VALUES (datetime('now', 'localtime'), ${A_31_L1}, ${A_31_L2}, ${A_31_L3}, ${A_32_L1}, ${A_32_L2}, ${A_32_L3}, ${A_33_L1}, ${A_33_L2}, ${A_33_L3}, ${A_34_L1}, ${A_34_L2}, ${A_34_L3}, ${A_35_L1}, ${A_35_L2}, ${A_35_L3}, ${A_36_L1}, ${A_36_L2}, ${A_36_L3})`;\n\nnewMsg.topic = `INSERT INTO Current (dt, ${keys}) VALUES (datetime('now', 'localtime'), ${values})`;\n\nreturn newMsg;\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":480,"y":1820,"wires":[["f77916c8.cb92b"]]},{"id":"5faef8c7.9d99d8","type":"change","z":"89e2edc2.2ff858","name":"chartData","rules":[{"t":"set","p":"cmd","pt":"msg","to":"chartPower","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"{\t \"labels\": [payload.dt],\t \"datasets\": [\t {\t \"label\": 'Meter A L1',\t \"backgroundColor\": '#0d6efd',\t \"borderColor\": '#0d6efd',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.P_31_L1],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Meter A L2',\t \"backgroundColor\": '#6610f2',\t \"borderColor\": '#6610f2',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.P_31_L2],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Meter A L3',\t \"backgroundColor\": '#6f42c1',\t \"borderColor\": '#6f42c1',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.P_31_L3],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Meter A T',\t \"backgroundColor\": '#8f42c1',\t \"borderColor\": '#8f42c1',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.P_31_T],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Meter B L1',\t \"backgroundColor\": '#d63384',\t \"borderColor\": '#d63384',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.P_32_L1],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Meter B L2',\t \"backgroundColor\": '#dc3545',\t \"borderColor\": '#dc3545',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.P_32_L2],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Meter B L3',\t \"backgroundColor\": '#fd7e14',\t \"borderColor\": '#fd7e14',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.P_32_L3],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Meter B T',\t \"backgroundColor\": '#fd9e14',\t \"borderColor\": '#fd9e14',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.P_32_T],\t 'fill': false,\t \"hidden\": false\t }\t \t ,\t {\t \"label\": 'Meter C L1',\t \"backgroundColor\": '#ffc107',\t \"borderColor\": '#ffc107',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.P_33_L1],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Meter C L2',\t \"backgroundColor\": '#198754',\t \"borderColor\": '#198754',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.P_33_L2],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Meter C L3',\t \"backgroundColor\": '#20c997',\t \"borderColor\": '#20c997',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.P_33_L3],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Meter C T',\t \"backgroundColor\": '#fd7e84',\t \"borderColor\": '#fd7e84',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.P_33_T],\t 'fill': false,\t \"hidden\": false\t }\t /*\t ,\t {\t \"label\": 'Heat Pump H.W. 2 L1',\t \"backgroundColor\": '#0dcaf0',\t \"borderColor\": '#0dcaf0',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.P_34_L1],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Heat Pump H.W. 2 L2',\t \"backgroundColor\": '#0d6efd',\t \"borderColor\": '#0d6efd',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.P_34_L2],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Heat Pump H.W. 2 L3',\t \"backgroundColor\": '#5C82FF',\t \"borderColor\": '#5C82FF',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.P_34_L3],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Heat Pump H.W. 2 T',\t \"backgroundColor\": '#6610f2',\t \"borderColor\": '#6610f2',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.P_34_T],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Heat Pump C.W. 1 L1',\t \"backgroundColor\": '#6f42c1',\t \"borderColor\": '#6f42c1',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.P_35_L1],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Heat Pump C.W. 1 L2',\t \"backgroundColor\": '#8f42c1',\t \"borderColor\": '#8f42c1',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.P_35_L2],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Heat Pump C.W. 1 L3',\t \"backgroundColor\": '#d63384',\t \"borderColor\": '#d63384',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.P_35_L3],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Heat Pump C.W. 1 T',\t \"backgroundColor\": '#dc3545',\t \"borderColor\": '#dc3545',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.P_35_T],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Heat Pump C.W. 2 L1',\t \"backgroundColor\": '#fd7e14',\t \"borderColor\": '#fd7e14',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.P_36_L1],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Heat Pump C.W. 2 L2',\t \"backgroundColor\": '#fd9e14',\t \"borderColor\": '#fd9e14',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.P_36_L2],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Heat Pump C.W. 2 L3',\t \"backgroundColor\": '#ffc107',\t \"borderColor\": '#ffc107',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.P_36_L3],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Heat Pump C.W. 2 T',\t \"backgroundColor\": '#198754',\t \"borderColor\": '#198754',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.P_36_T],\t 'fill': false,\t \"hidden\": false\t }\t */\t ]\t}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1066,"y":3039,"wires":[["5132a6b1.df3ab"]]},{"id":"b415c1bd.5dd598","type":"switch","z":"89e2edc2.2ff858","name":"","property":"cmd","propertyType":"msg","rules":[{"t":"eq","v":"chartEnergyAccMonthly","vt":"str"},{"t":"eq","v":"csvEnergyAccMonthly","vt":"str"},{"t":"eq","v":"chartEnergyMonthly","vt":"str"},{"t":"eq","v":"csvEnergyMonthly","vt":"str"},{"t":"eq","v":"chartEnergyYearly","vt":"str"},{"t":"eq","v":"csvEnergyYearly","vt":"str"},{"t":"eq","v":"chartEnergyTotal","vt":"str"},{"t":"eq","v":"csvEnergyTotal","vt":"str"},{"t":"eq","v":"chartPower","vt":"str"},{"t":"eq","v":"csvPower","vt":"str"},{"t":"eq","v":"chartFrequency","vt":"str"},{"t":"eq","v":"csvFrequency","vt":"str"},{"t":"eq","v":"chartCurrent","vt":"str"},{"t":"eq","v":"csvCurrent","vt":"str"},{"t":"eq","v":"chartVolts","vt":"str"},{"t":"eq","v":"csvVolts","vt":"str"},{"t":"eq","v":"chartPowerfactor","vt":"str"},{"t":"eq","v":"csvPowerfactor","vt":"str"},{"t":"eq","v":"chartHarmonicsVoltage","vt":"str"},{"t":"eq","v":"csvHarmonicsVoltage","vt":"str"},{"t":"eq","v":"chartHarmonicsCurrent","vt":"str"},{"t":"eq","v":"csvHarmonicsCurrent","vt":"str"},{"t":"eq","v":"shutdown","vt":"str"}],"checkall":"false","repair":false,"outputs":23,"x":136,"y":3259,"wires":[["1060ac83.97c9ab"],["1060ac83.97c9ab"],["d57b9ac9.d14f98"],["d57b9ac9.d14f98"],["fdbf53a6.639188"],["fdbf53a6.639188"],["f5b408f6.9a96e"],["f5b408f6.9a96e"],["c1de83ff.c444c8"],["c1de83ff.c444c8"],["7109c409.85dd4c"],["7109c409.85dd4c"],["40776913.afd758"],["40776913.afd758"],["53e37469.d47a5c"],["53e37469.d47a5c"],["58258855.415ce"],["58258855.415ce"],["ee9c5824.dedc6"],["ee9c5824.dedc6"],["24bc3e8e.b7d1ca"],["24bc3e8e.b7d1ca"],["7f02daf6.752c14"]]},{"id":"fcbce8c6.c74f","type":"function","z":"89e2edc2.2ff858","name":"Calculate Accumulative","func":"let moment = global.get('moment')\n\nif (msg.payload.length > 1) {\n \nlet arr = msg.payload\nlet result = [];\nlet keys = Object.keys(arr[0])\n\narr.forEach((el, index) => {\n if (index !=0 && index % 2 !== 0) {\n let obj = {}\n \n keys.forEach((key, i) => {\n if (i !=0) {\n \n let val = arr[index][key] - arr[index-1][key]\n obj.dt = moment(el.dt, 'YYYY-MM-DD HH:mm:ss').format('YYYY-MM-DD');\n obj[key] = val;\n \n }\n })\n \n result.push(obj) \n \n }\n \n})\n\nmsg.payload = result\nreturn [msg, null]\n}\nelse {\n msg.cmd = 'Error'\n msg.payload = \"No Data found in this time range !!!\"\n return [null, msg]\n}\n","outputs":2,"noerr":0,"initialize":"","finalize":"","x":736,"y":2639,"wires":[["a68a5761.c4a79"],["ffda6487.1307"]]},{"id":"69dbe4b3.af5694","type":"link out","z":"89e2edc2.2ff858","name":"from sql","links":["8448e455.51aa1"],"x":1181,"y":2579,"wires":[]},{"id":"e0e782a.258038","type":"change","z":"89e2edc2.2ff858","name":"chartData","rules":[{"t":"set","p":"cmd","pt":"msg","to":"chartEnergyMonthly","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"{\t \"labels\": [payload.dt],\t \"datasets\": [\t {\t \"label\": 'Meter A L1',\t \"backgroundColor\": '#0d6efd',\t \"borderColor\": '#0d6efd',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.EI_31_L1],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Meter A L2',\t \"backgroundColor\": '#6610f2',\t \"borderColor\": '#6610f2',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.EI_31_L2],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Meter A L3',\t \"backgroundColor\": '#6f42c1',\t \"borderColor\": '#6f42c1',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.EI_31_L3],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Meter A T',\t \"backgroundColor\": '#8f42c1',\t \"borderColor\": '#8f42c1',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.EI_31_T],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Meter B L1',\t \"backgroundColor\": '#d63384',\t \"borderColor\": '#d63384',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.EI_32_L1],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Meter B L2',\t \"backgroundColor\": '#dc3545',\t \"borderColor\": '#dc3545',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.EI_32_L2],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Meter B L3',\t \"backgroundColor\": '#fd7e14',\t \"borderColor\": '#fd7e14',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.EI_32_L3],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Meter B T',\t \"backgroundColor\": '#fd9e14',\t \"borderColor\": '#fd9e14',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.EI_32_T],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Meter C L1',\t \"backgroundColor\": '#ffc107',\t \"borderColor\": '#ffc107',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.EI_33_L1],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Meter C L2',\t \"backgroundColor\": '#198754',\t \"borderColor\": '#198754',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.EI_33_L2],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Meter C L3',\t \"backgroundColor\": '#20c997',\t \"borderColor\": '#20c997',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.EI_33_L3],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Meter C T',\t \"backgroundColor\": '#fd7e84',\t \"borderColor\": '#fd7e84',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.EI_33_T],\t 'fill': false,\t \"hidden\": false\t }\t /*,\t {\t \"label\": 'Heat Pump H.W. 2 L1',\t \"backgroundColor\": '#0dcaf0',\t \"borderColor\": '#0dcaf0',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.EI_34_L1],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Heat Pump H.W. 2 L2',\t \"backgroundColor\": '#0d6efd',\t \"borderColor\": '#0d6efd',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.EI_34_L2],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Heat Pump H.W. 2 L3',\t \"backgroundColor\": '#5C82FF',\t \"borderColor\": '#5C82FF',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.EI_34_L3],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Heat Pump H.W. 2 T',\t \"backgroundColor\": '#6610f2',\t \"borderColor\": '#6610f2',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.EI_34_T],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Heat Pump C.W. 1 L1',\t \"backgroundColor\": '#6f42c1',\t \"borderColor\": '#6f42c1',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.EI_35_L1],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Heat Pump C.W. 1 L2',\t \"backgroundColor\": '#8f42c1',\t \"borderColor\": '#8f42c1',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.EI_35_L2],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Heat Pump C.W. 1 L3',\t \"backgroundColor\": '#d63384',\t \"borderColor\": '#d63384',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.EI_35_L3],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Heat Pump C.W. 1 T',\t \"backgroundColor\": '#dc3545',\t \"borderColor\": '#dc3545',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.EI_35_T],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Heat Pump C.W. 2 L1',\t \"backgroundColor\": '#fd7e14',\t \"borderColor\": '#fd7e14',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.EI_36_L1],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Heat Pump C.W. 2 L2',\t \"backgroundColor\": '#fd9e14',\t \"borderColor\": '#fd9e14',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.EI_36_L2],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Heat Pump C.W. 2 L3',\t \"backgroundColor\": '#ffc107',\t \"borderColor\": '#ffc107',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.EI_36_L3],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Heat Pump C.W. 2 T',\t \"backgroundColor\": '#198754',\t \"borderColor\": '#198754',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.EI_36_T],\t 'fill': false,\t \"hidden\": false\t }\t */\t ]\t}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1066,"y":2579,"wires":[["69dbe4b3.af5694"]]},{"id":"b1bee4a.34e9618","type":"comment","z":"89e2edc2.2ff858","name":"Modbus read and set to GLOBAL","info":"","x":950,"y":280,"wires":[]},{"id":"cf18cb51.528238","type":"function","z":"89e2edc2.2ff858","name":"No data filter","func":"\nif (msg.payload.length > 0) {\n \nreturn [msg, null]\n}\nelse {\n msg.cmd = 'Error'\n msg.payload = \"No Data found in this time range !!!\"\n return [null, msg]\n}\n","outputs":2,"noerr":0,"initialize":"","finalize":"","x":696,"y":3119,"wires":[["39c2d499.c84c04"],["594d389b.51528"]]},{"id":"fdbf53a6.639188","type":"function","z":"89e2edc2.2ff858","name":"Yearly Sql Query","func":"\nlet table = msg.payload.table;\nlet date = moment(msg.payload.startDate, 'YYYY').format('YYYY');\n\nmsg.topic = `SELECT * FROM ${table} WHERE dt IN \n(SELECT MAX(dt) FROM ${table} WHERE dt LIKE '${date}%' GROUP BY strftime(\"%Y-%m\", dt) \nUNION SELECT MIN(dt) FROM ${table} WHERE dt LIKE '${date}%' GROUP BY strftime(\"%Y-%m\", dt))`\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[{"var":"moment","module":"moment"}],"x":376,"y":2799,"wires":[["d57613b4.630b5"]]},{"id":"891848d6.992ad8","type":"comment","z":"89e2edc2.2ff858","name":"Yearly Energy","info":"","x":356,"y":2739,"wires":[]},{"id":"b4109b24.2ce04","type":"function","z":"89e2edc2.2ff858","name":"Calculate Accumulative","func":"let moment = global.get('moment')\n\nif (msg.payload.length > 0) {\n \nlet arr = msg.payload\nlet result = [];\nlet keys = Object.keys(arr[0])\n\narr.forEach((el, index) => {\n if (index !=0 && index % 2 !== 0) {\n let obj = {}\n \n keys.forEach((key, i) => {\n if (i !=0) {\n \n let val = arr[index][key] - arr[index-1][key]\n obj.dt = moment(el.dt, 'YYYY-MM-DD HH:mm:ss').format('YYYY-MM');\n obj[key] = val;\n \n }\n })\n \n result.push(obj) \n \n }\n \n})\n\nmsg.payload = result\nreturn [msg, null]\n}\nelse {\n msg.cmd = 'Error'\n msg.payload = \"No Data found in this time range !!!\"\n return [null, msg]\n}\n","outputs":2,"noerr":0,"initialize":"","finalize":"","x":736,"y":2799,"wires":[["55c791a5.3607f8"],["1225d28c.64d165"]]},{"id":"96a4fa16.c820d8","type":"link out","z":"89e2edc2.2ff858","name":"from sql","links":["8448e455.51aa1"],"x":1181,"y":2739,"wires":[]},{"id":"7676f7d8.de7738","type":"change","z":"89e2edc2.2ff858","name":"chartData","rules":[{"t":"set","p":"cmd","pt":"msg","to":"chartEnergyYearly","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"{\t \"labels\": [payload.dt],\t \"datasets\": [\t {\t \"label\": 'Meter A L1',\t \"backgroundColor\": '#0d6efd',\t \"borderColor\": '#0d6efd',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.EI_31_L1],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Meter A L2',\t \"backgroundColor\": '#6610f2',\t \"borderColor\": '#6610f2',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.EI_31_L2],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Meter A L3',\t \"backgroundColor\": '#6f42c1',\t \"borderColor\": '#6f42c1',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.EI_31_L3],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Meter A T',\t \"backgroundColor\": '#8f42c1',\t \"borderColor\": '#8f42c1',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.EI_31_T],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Meter B L1',\t \"backgroundColor\": '#d63384',\t \"borderColor\": '#d63384',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.EI_32_L1],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Meter B L2',\t \"backgroundColor\": '#dc3545',\t \"borderColor\": '#dc3545',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.EI_32_L2],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Meter B L3',\t \"backgroundColor\": '#fd7e14',\t \"borderColor\": '#fd7e14',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.EI_32_L3],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Meter B T',\t \"backgroundColor\": '#fd9e14',\t \"borderColor\": '#fd9e14',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.EI_32_T],\t 'fill': false,\t \"hidden\": false\t }\t \t ,\t {\t \"label\": 'Meter C L1',\t \"backgroundColor\": '#ffc107',\t \"borderColor\": '#ffc107',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.EI_33_L1],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Meter C L2',\t \"backgroundColor\": '#198754',\t \"borderColor\": '#198754',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.EI_33_L2],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Meter C L3',\t \"backgroundColor\": '#20c997',\t \"borderColor\": '#20c997',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.EI_33_L3],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Meter C T',\t \"backgroundColor\": '#fd7e84',\t \"borderColor\": '#fd7e84',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.EI_33_T],\t 'fill': false,\t \"hidden\": false\t }\t /*,\t {\t \"label\": 'Heat Pump H.W. 2 L1',\t \"backgroundColor\": '#0dcaf0',\t \"borderColor\": '#0dcaf0',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.EI_34_L1],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Heat Pump H.W. 2 L2',\t \"backgroundColor\": '#0d6efd',\t \"borderColor\": '#0d6efd',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.EI_34_L2],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Heat Pump H.W. 2 L3',\t \"backgroundColor\": '#5C82FF',\t \"borderColor\": '#5C82FF',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.EI_34_L3],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Heat Pump H.W. 2 T',\t \"backgroundColor\": '#6610f2',\t \"borderColor\": '#6610f2',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.EI_34_T],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Heat Pump C.W. 1 L1',\t \"backgroundColor\": '#6f42c1',\t \"borderColor\": '#6f42c1',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.EI_35_L1],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Heat Pump C.W. 1 L2',\t \"backgroundColor\": '#8f42c1',\t \"borderColor\": '#8f42c1',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.EI_35_L2],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Heat Pump C.W. 1 L3',\t \"backgroundColor\": '#d63384',\t \"borderColor\": '#d63384',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.EI_35_L3],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Heat Pump C.W. 1 T',\t \"backgroundColor\": '#dc3545',\t \"borderColor\": '#dc3545',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.EI_35_T],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Heat Pump C.W. 2 L1',\t \"backgroundColor\": '#fd7e14',\t \"borderColor\": '#fd7e14',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.EI_36_L1],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Heat Pump C.W. 2 L2',\t \"backgroundColor\": '#fd9e14',\t \"borderColor\": '#fd9e14',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.EI_36_L2],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Heat Pump C.W. 2 L3',\t \"backgroundColor\": '#ffc107',\t \"borderColor\": '#ffc107',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.EI_36_L3],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Heat Pump C.W. 2 T',\t \"backgroundColor\": '#198754',\t \"borderColor\": '#198754',\t \"pointBorderColor\": 'white',\t \"pointBorderWidth\": 1,\t \"pointRadius\" : 4,\t \"data\": [payload.EI_36_T],\t 'fill': false,\t \"hidden\": false\t }\t */\t ]\t}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1066,"y":2739,"wires":[["96a4fa16.c820d8"]]},{"id":"f5b408f6.9a96e","type":"function","z":"89e2edc2.2ff858","name":"Total Sql Query","func":"\nlet table = msg.payload.table;\n//let date = moment(msg.payload.startDate, 'YYYY').format('YYYY');\n\nmsg.topic = `SELECT * FROM ${table} WHERE dt IN \n(SELECT MAX(dt) FROM ${table} GROUP BY strftime(\"%Y\", dt)\nUNION SELECT MIN(dt) FROM ${table} GROUP BY strftime(\"%Y\", dt))`\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[{"var":"moment","module":"moment"}],"x":366,"y":2979,"wires":[["7dbfa57b.d47b1c"]]},{"id":"7b65ea5f.e39a74","type":"comment","z":"89e2edc2.2ff858","name":"Total Energy","info":"","x":356,"y":2919,"wires":[]},{"id":"280e676.ca86818","type":"function","z":"89e2edc2.2ff858","name":"Calculate Accumulative","func":"let moment = global.get('moment')\n\nif (msg.payload.length > 1) {\n \nlet arr = msg.payload\nlet result = [];\nlet keys = Object.keys(arr[0])\n\narr.forEach((el, index) => {\n if (index !=0 && index % 2 !== 0) {\n let obj = {}\n \n keys.forEach((key, i) => {\n if (i !=0) {\n \n let val = arr[index][key] - arr[index-1][key]\n obj.dt = moment(el.dt, 'YYYY-MM-DD HH:mm:ss').format('YYYY');\n obj[key] = val;\n \n }\n })\n \n result.push(obj) \n \n }\n \n})\n\nmsg.payload = result\nreturn [msg, null]\n}\nelse {\n msg.cmd = 'Error'\n msg.payload = \"No Data found in this time range !!!\"\n return [null, msg]\n}\n","outputs":2,"noerr":0,"initialize":"","finalize":"","x":736,"y":2979,"wires":[["f017390e.b56e98"],["a6dc1db6.c9fdc8"]]},{"id":"5595f693.db8b6","type":"link out","z":"89e2edc2.2ff858","name":"from sql","links":["8448e455.51aa1"],"x":1181,"y":2899,"wires":[]},{"id":"14f1dcff.c384e3","type":"change","z":"89e2edc2.2ff858","name":"chartData","rules":[{"t":"set","p":"cmd","pt":"msg","to":"chartEnergyTotal","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"{\t \"labels\": [payload.dt],\t \"datasets\": [\t {\t \"label\": 'Meter A L1',\t \"backgroundColor\": '#0d6efd',\t \"borderColor\": '#0d6efd',\t \"data\": [payload.EI_31_L1],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Meter A L2',\t \"backgroundColor\": '#6610f2',\t \"borderColor\": '#6610f2',\t \"data\": [payload.EI_31_L2],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Meter A L3',\t \"backgroundColor\": '#6f42c1',\t \"borderColor\": '#6f42c1',\t \"data\": [payload.EI_31_L3],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Meter A T',\t \"backgroundColor\": '#8f42c1',\t \"borderColor\": '#8f42c1',\t \"data\": [payload.EI_31_T],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Meter B L1',\t \"backgroundColor\": '#d63384',\t \"borderColor\": '#d63384',\t \"data\": [payload.EI_32_L1],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Meter B L2',\t \"backgroundColor\": '#dc3545',\t \"borderColor\": '#dc3545',\t \"data\": [payload.EI_32_L2],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Meter B L3',\t \"backgroundColor\": '#fd7e14',\t \"borderColor\": '#fd7e14',\t \"data\": [payload.EI_32_L3],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Meter B T',\t \"backgroundColor\": '#fd9e14',\t \"borderColor\": '#fd9e14',\t \"data\": [payload.EI_32_T],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Meter C L1',\t \"backgroundColor\": '#ffc107',\t \"borderColor\": '#ffc107',\t \"data\": [payload.EI_33_L1],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Meter C L2',\t \"backgroundColor\": '#198754',\t \"borderColor\": '#198754',\t \"data\": [payload.EI_33_L2],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Meter C L3',\t \"backgroundColor\": '#20c997',\t \"borderColor\": '#20c997',\t \"data\": [payload.EI_33_L3],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Meter C T',\t \"backgroundColor\": '#fd7e84',\t \"borderColor\": '#fd7e84',\t \"data\": [payload.EI_33_T],\t 'fill': false,\t \"hidden\": false\t }\t /*\t ,\t {\t \"label\": 'Heat Pump H.W. 2 L1',\t \"backgroundColor\": '#0dcaf0',\t \"borderColor\": '#0dcaf0',\t \"data\": [payload.EI_34_L1],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Heat Pump H.W. 2 L2',\t \"backgroundColor\": '#0d6efd',\t \"borderColor\": '#0d6efd',\t \"data\": [payload.EI_34_L2],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Heat Pump H.W. 2 L3',\t \"backgroundColor\": '#5C82FF',\t \"borderColor\": '#5C82FF',\t \"data\": [payload.EI_34_L3],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Heat Pump H.W. 2 T',\t \"backgroundColor\": '#6610f2',\t \"borderColor\": '#6610f2',\t \"data\": [payload.EI_34_T],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Heat Pump C.W. 1 L1',\t \"backgroundColor\": '#6f42c1',\t \"borderColor\": '#6f42c1',\t \"data\": [payload.EI_35_L1],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Heat Pump C.W. 1 L2',\t \"backgroundColor\": '#8f42c1',\t \"borderColor\": '#8f42c1',\t \"data\": [payload.EI_35_L2],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Heat Pump C.W. 1 L3',\t \"backgroundColor\": '#d63384',\t \"borderColor\": '#d63384',\t \"data\": [payload.EI_35_L3],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Heat Pump C.W. 1 T',\t \"backgroundColor\": '#dc3545',\t \"borderColor\": '#dc3545',\t \"data\": [payload.EI_35_T],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Heat Pump C.W. 2 L1',\t \"backgroundColor\": '#fd7e14',\t \"borderColor\": '#fd7e14',\t \"data\": [payload.EI_36_L1],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Heat Pump C.W. 2 L2',\t \"backgroundColor\": '#fd9e14',\t \"borderColor\": '#fd9e14',\t \"data\": [payload.EI_36_L2],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Heat Pump C.W. 2 L3',\t \"backgroundColor\": '#ffc107',\t \"borderColor\": '#ffc107',\t \"data\": [payload.EI_36_L3],\t 'fill': false,\t \"hidden\": false\t },\t {\t \"label\": 'Heat Pump C.W. 2 T',\t \"backgroundColor\": '#198754',\t \"borderColor\": '#198754',\t \"data\": [payload.EI_36_T],\t 'fill': false,\t \"hidden\": false\t }\t */\t ]\t}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1066,"y":2899,"wires":[["5595f693.db8b6"]]},{"id":"39c2d499.c84c04","type":"switch","z":"89e2edc2.2ff858","name":"","property":"cmd","propertyType":"msg","rules":[{"t":"eq","v":"chartPower","vt":"str"},{"t":"eq","v":"csvPower","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":916,"y":3079,"wires":[["5faef8c7.9d99d8"],["c607a64f.18067"]]},{"id":"65cf4d3c.6a7704","type":"link out","z":"89e2edc2.2ff858","name":"data for CSV","links":["424e4ca9.28a51c"],"x":1181,"y":3119,"wires":[]},{"id":"f017390e.b56e98","type":"switch","z":"89e2edc2.2ff858","name":"","property":"cmd","propertyType":"msg","rules":[{"t":"eq","v":"chartEnergyTotal","vt":"str"},{"t":"eq","v":"csvEnergyTotal","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":916,"y":2939,"wires":[["14f1dcff.c384e3"],["570698c4.b7903"]]},{"id":"cdad4c4b.74c738","type":"link out","z":"89e2edc2.2ff858","name":"data for CSV","links":["424e4ca9.28a51c"],"x":1181,"y":2959,"wires":[]},{"id":"55c791a5.3607f8","type":"switch","z":"89e2edc2.2ff858","name":"","property":"cmd","propertyType":"msg","rules":[{"t":"eq","v":"chartEnergyYearly","vt":"str"},{"t":"eq","v":"csvEnergyYearly","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":916,"y":2779,"wires":[["7676f7d8.de7738"],["3cb9772e.377208"]]},{"id":"308fd335.9768e4","type":"link out","z":"89e2edc2.2ff858","name":"data for CSV","links":["424e4ca9.28a51c"],"x":1181,"y":2799,"wires":[]},{"id":"a68a5761.c4a79","type":"switch","z":"89e2edc2.2ff858","name":"","property":"cmd","propertyType":"msg","rules":[{"t":"eq","v":"chartEnergyMonthly","vt":"str"},{"t":"eq","v":"csvEnergyMonthly","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":916,"y":2619,"wires":[["e0e782a.258038"],["d91e6128.28f31"]]},{"id":"a97f831.70039","type":"link out","z":"89e2edc2.2ff858","name":"data for CSV","links":["424e4ca9.28a51c"],"x":1181,"y":2639,"wires":[]},{"id":"1225d28c.64d165","type":"link out","z":"89e2edc2.2ff858","name":"from sql","links":["8448e455.51aa1"],"x":881,"y":2839,"wires":[]},{"id":"ffda6487.1307","type":"link out","z":"89e2edc2.2ff858","name":"from sql","links":["8448e455.51aa1"],"x":881,"y":2679,"wires":[]},{"id":"a6dc1db6.c9fdc8","type":"link out","z":"89e2edc2.2ff858","name":"from sql","links":["8448e455.51aa1"],"x":901,"y":2999,"wires":[]},{"id":"594d389b.51528","type":"link out","z":"89e2edc2.2ff858","name":"from sql","links":["8448e455.51aa1"],"x":821,"y":3139,"wires":[]},{"id":"968c7cd0.6a1eb","type":"debug","z":"89e2edc2.2ff858","name":"3","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1195,"y":860,"wires":[],"l":false},{"id":"2f711978.b399a6","type":"function","z":"89e2edc2.2ff858","name":"set Global","func":"\n\nlet time = moment().format('YYYY-MM-DD HH:mm')\n\n// update global context\nglobal.set('Modbus', msg.payload)\n\n// send to uibuilder\nlet newMsg = {};\nlet status = global.get('Status')\nnewMsg.cmd = \"Overview\"\n\nnewMsg.payload = {dt:time, ...msg.payload, ...status}\n\nreturn newMsg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[{"var":"moment","module":"moment"}],"x":1070,"y":800,"wires":[["6f9d9a76.996294","968c7cd0.6a1eb"]]},{"id":"6f9d9a76.996294","type":"link out","z":"89e2edc2.2ff858","name":"","links":["8448e455.51aa1"],"x":1195,"y":800,"wires":[]},{"id":"249147b.1d31cb8","type":"join","z":"89e2edc2.2ff858","name":"","mode":"custom","build":"merged","property":"payload","propertyType":"msg","key":"unitId","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"168","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":930,"y":800,"wires":[["2f711978.b399a6"]]},{"id":"50f4d5f8.e58de4","type":"function","z":"89e2edc2.2ff858","name":"error","func":"\nlet time = moment().format('YYYY-MM-DD HH:mm:ss')\n\nif (msg.payload == \"\" || msg.hasOwnProperty('error')) {\n\n global.set(\"Status.Status_31\", \"Disconnected\")\n node.status({ fill: \"red\", shape: \"ring\", text: `Last disconnected ${time}` });\n\n msg.payload = {\n\n V_31_L1: null,\n V_31_L2: null,\n V_31_L3: null,\n A_31_L1: null,\n A_31_L2: null,\n A_31_L3: null,\n P_31_L1: null,\n P_31_L2: null,\n P_31_L3: null,\n P_31_T: null,\n S_31_T: null,\n Q_31_T: null,\n PF_31_L1: null,\n PF_31_L2: null,\n PF_31_L3: null,\n F_31_L1: null,\n F_31_L2: null,\n F_31_L3: null\n }\n\n return [null, msg]\n}\n\nelse {\n global.set(\"Status.Status_31\", \"Connected\")\n return [msg, null];\n}","outputs":2,"noerr":0,"initialize":"","finalize":"","libs":[{"var":"moment","module":"moment"}],"x":420,"y":120,"wires":[["92dcda2.7f34fa8"],["249147b.1d31cb8"]]},{"id":"12901b2f.4ba98d","type":"function","z":"89e2edc2.2ff858","name":"error","func":"\nlet time = moment().format('YYYY-MM-DD HH:mm:ss')\n\nif (msg.payload == \"\" || msg.hasOwnProperty('error')) {\n\nglobal.set(\"Status.Status_31\", \"Disconnected\") \nnode.status({fill:\"red\",shape:\"ring\",text:`Last disconnected ${time}`});\n\nmsg.payload = { \n THDV_31_L1: null,\n THDV_31_L2: null,\n THDV_31_L3: null,\n THDA_31_L1: null,\n THDA_31_L2: null,\n THDA_31_L3: null\n }\n \nreturn [null, msg]\n}\n\nelse {\n global.set(\"Status.Status_31\", \"Connected\")\nreturn [msg, null];\n}","outputs":2,"noerr":0,"initialize":"","finalize":"","libs":[{"var":"moment","module":"moment"}],"x":420,"y":180,"wires":[["686e6999.6ccb7"],["249147b.1d31cb8"]]},{"id":"c3916662.130968","type":"function","z":"89e2edc2.2ff858","name":"error","func":"\nlet time = moment().format('YYYY-MM-DD HH:mm:ss')\n\nif (msg.payload == \"\" || msg.hasOwnProperty('error')) {\n \nglobal.set(\"Status.Status_31\", \"Disconnected\")\nnode.status({fill:\"red\",shape:\"ring\",text:`Last disconnected ${time}`});\n\nmsg.payload = { \n EI_31_T: null,\n EI_31_L1: null,\n EI_31_L2: null,\n EI_31_L3: null\n }\n \nreturn [null, msg]\n}\n\nelse {\n \nglobal.set(\"Status.Status_31\", \"Connected\")\nreturn [msg, null];\n}","outputs":2,"noerr":0,"initialize":"","finalize":"","libs":[{"var":"moment","module":"moment"}],"x":420,"y":240,"wires":[["10965d7a.1396c3"],["249147b.1d31cb8"]]},{"id":"1b40dd10.bed813","type":"function","z":"89e2edc2.2ff858","name":"error","func":"\nlet time = moment().format('YYYY-MM-DD HH:mm:ss')\n\nif (msg.payload == \"\" || msg.hasOwnProperty('error')) {\n \nglobal.set(\"Status.Status_32\", \"Disconnected\")\nnode.status({fill:\"red\",shape:\"ring\",text:`Last disconnected ${time}`});\n\nmsg.payload = { \n V_32_L1: null,\n V_32_L2: null,\n V_32_L3: null,\n A_32_L1: null,\n A_32_L2: null,\n A_32_L3: null,\n P_32_L1: null,\n P_32_L2: null,\n P_32_L3: null,\n P_32_T: null,\n S_32_T: null,\n Q_32_T: null,\n PF_32_L1: null,\n PF_32_L2: null,\n PF_32_L3: null,\n F_32_L1: null,\n F_32_L2: null,\n F_32_L3: null\n }\n \nreturn [null, msg]\n}\n\nelse {\nglobal.set(\"Status.Status_32\", \"Connected\")\nreturn [msg, null];\n}","outputs":2,"noerr":0,"initialize":"","finalize":"","libs":[{"var":"moment","module":"moment"}],"x":420,"y":360,"wires":[["fc5d6700.89d99"],["249147b.1d31cb8"]]},{"id":"eaf8d07e.dce3e8","type":"function","z":"89e2edc2.2ff858","name":"error","func":"\nlet time = moment().format('YYYY-MM-DD HH:mm:ss')\n\nif (msg.payload == \"\" || msg.hasOwnProperty('error')) {\n \nglobal.set(\"Status.Status_32\", \"Disconnected\")\nnode.status({fill:\"red\",shape:\"ring\",text:`Last disconnected ${time}`});\n\nmsg.payload = { \n THDV_32_L1: null,\n THDV_32_L2: null,\n THDV_32_L3: null,\n THDA_32_L1: null,\n THDA_32_L2: null,\n THDA_32_L3: null\n }\n \nreturn [null, msg]\n}\n\nelse {\n \nglobal.set(\"Status.Status_32\", \"Connected\")\n\nreturn [msg, null];\n}","outputs":2,"noerr":0,"initialize":"","finalize":"","libs":[{"var":"moment","module":"moment"}],"x":420,"y":420,"wires":[["277fa485.07e634"],["249147b.1d31cb8"]]},{"id":"5581f5a5.422f04","type":"function","z":"89e2edc2.2ff858","name":"error","func":"\nlet time = moment().format('YYYY-MM-DD HH:mm:ss')\n\nif (msg.payload == \"\" || msg.hasOwnProperty('error')) {\n \nglobal.set(\"Status.Status_32\", \"Disconnected\")\nnode.status({fill:\"red\",shape:\"ring\",text:`Last disconnected ${time}`});\n\nmsg.payload = { \n EI_32_T: null,\n EI_32_L1: null,\n EI_32_L2: null,\n EI_32_L3: null\n }\n \nreturn [null, msg]\n}\n\nelse {\n \nglobal.set(\"Status.Status_32\", \"Connected\")\n\nreturn [msg, null];\n}","outputs":2,"noerr":0,"initialize":"","finalize":"","libs":[{"var":"moment","module":"moment"}],"x":421,"y":480,"wires":[["ad315052.ff68a"],["249147b.1d31cb8"]]},{"id":"2d144bfe.bbd5ac","type":"function","z":"89e2edc2.2ff858","name":"error","func":"\nlet time = moment().format('YYYY-MM-DD HH:mm:ss')\n\nif (msg.payload == \"\" || msg.hasOwnProperty('error')) {\nglobal.set(\"Status.Status_33\", \"Disconnected\")\nnode.status({fill:\"red\",shape:\"ring\",text:`Last disconnected ${time}`});\n\nmsg.payload = { \n V_33_L1: null,\n V_33_L2: null,\n V_33_L3: null,\n A_33_L1: null,\n A_33_L2: null,\n A_33_L3: null,\n P_33_L1: null,\n P_33_L2: null,\n P_33_L3: null,\n P_33_T: null,\n S_33_T: null,\n Q_33_T: null,\n PF_33_L1: null,\n PF_33_L2: null,\n PF_33_L3: null,\n F_33_L1: null,\n F_33_L2: null,\n F_33_L3: null\n }\n \nreturn [null, msg]\n}\n\nelse {\nglobal.set(\"Status.Status_33\", \"Connected\")\nreturn [msg, null];\n}","outputs":2,"noerr":0,"initialize":"","finalize":"","libs":[{"var":"moment","module":"moment"}],"x":420,"y":620,"wires":[["c52f0cd1.308308"],["249147b.1d31cb8"]]},{"id":"a85e5b73.5b3a4","type":"function","z":"89e2edc2.2ff858","name":"error","func":"\nlet time = moment().format('YYYY-MM-DD HH:mm:ss')\n\nif (msg.payload == \"\" || msg.hasOwnProperty('error')) {\n\nglobal.set(\"Status.Status_33\", \"Disconnected\")\nnode.status({fill:\"red\",shape:\"ring\",text:`Last disconnected ${time}`});\n\nmsg.payload = { \n THDV_33_L1: null,\n THDV_33_L2: null,\n THDV_33_L3: null,\n THDA_33_L1: null,\n THDA_33_L2: null,\n THDA_33_L3: null\n }\n \nreturn [null, msg]\n}\n\nelse {\n\nglobal.set(\"Status.Status_33\", \"Connected\")\n\nreturn [msg, null];\n}","outputs":2,"noerr":0,"initialize":"","finalize":"","libs":[{"var":"moment","module":"moment"}],"x":420,"y":680,"wires":[["605cc4f9.0ee4f4"],["249147b.1d31cb8"]]},{"id":"6f4dc409.834864","type":"function","z":"89e2edc2.2ff858","name":"error","func":"\nlet time = moment().format('YYYY-MM-DD HH:mm:ss')\n\nif (msg.payload == \"\" || msg.hasOwnProperty('error')) {\n\nglobal.set(\"Status.Status_33\", \"Disconnected\")\nnode.status({fill:\"red\",shape:\"ring\",text:`Last disconnected ${time}`});\n\nmsg.payload = { \n EI_33_T: null,\n EI_33_L1: null,\n EI_33_L2: null,\n EI_33_L3: null\n }\n \nreturn [null, msg]\n}\n\nelse {\n\nglobal.set(\"Status.Status_33\", \"Connected\")\n\nreturn [msg, null];\n}","outputs":2,"noerr":0,"initialize":"","finalize":"","libs":[{"var":"moment","module":"moment"}],"x":420,"y":740,"wires":[["329e1be2.2b1234"],["249147b.1d31cb8"]]},{"id":"f34e1dc.c7ba3e","type":"function","z":"89e2edc2.2ff858","name":"error","func":"\nlet time = moment().format('YYYY-MM-DD HH:mm:ss')\n\nif (msg.payload == \"\" || msg.hasOwnProperty('error')) {\n\nglobal.set(\"Status.Status_34\", \"Disconnected\")\nnode.status({fill:\"red\",shape:\"ring\",text:`Last disconnected ${time}`});\n\nmsg.payload = { \n V_34_L1: null,\n V_34_L2: null,\n V_34_L3: null,\n A_34_L1: null,\n A_34_L2: null,\n A_34_L3: null,\n P_34_L1: null,\n P_34_L2: null,\n P_34_L3: null,\n P_34_T: null,\n S_34_T: null,\n Q_34_T: null,\n PF_34_L1: null,\n PF_34_L2: null,\n PF_34_L3: null,\n F_34_L1: null,\n F_34_L2: null,\n F_34_L3: null\n }\n \nreturn [null, msg]\n}\n\nelse {\n \nglobal.set(\"Status.Status_34\", \"Connected\")\n\nreturn [msg, null];\n}","outputs":2,"noerr":0,"initialize":"","finalize":"","libs":[{"var":"moment","module":"moment"}],"x":420,"y":880,"wires":[["4e1757c2.34e64"],["249147b.1d31cb8"]]},{"id":"3a7ca906.1381ae","type":"function","z":"89e2edc2.2ff858","name":"error","func":"\nlet time = moment().format('YYYY-MM-DD HH:mm:ss')\n\nif (msg.payload == \"\" || msg.hasOwnProperty('error')) {\n\nglobal.set(\"Status.Status_34\", \"Disconnected\")\nnode.status({fill:\"red\",shape:\"ring\",text:`Last disconnected ${time}`});\n\nmsg.payload = { \n THDV_34_L1: null,\n THDV_34_L2: null,\n THDV_34_L3: null,\n THDA_34_L1: null,\n THDA_34_L2: null,\n THDA_34_L3: null\n }\n \nreturn [null, msg]\n}\n\nelse {\nglobal.set(\"Status.Status_34\", \"Connected\")\nreturn [msg, null];\n}","outputs":2,"noerr":0,"initialize":"","finalize":"","libs":[{"var":"moment","module":"moment"}],"x":420,"y":940,"wires":[["4c887dc9.dc973c"],["249147b.1d31cb8"]]},{"id":"1936a42f.31da4c","type":"function","z":"89e2edc2.2ff858","name":"error","func":"\nlet time = moment().format('YYYY-MM-DD HH:mm:ss')\n\nif (msg.payload == \"\" || msg.hasOwnProperty('error')) {\n\nglobal.set(\"Status.Status_34\", \"Disconnected\")\nnode.status({fill:\"red\",shape:\"ring\",text:`Last disconnected ${time}`});\n\nmsg.payload = { \n EI_34_T: null,\n EI_34_L1: null,\n EI_34_L2: null,\n EI_34_L3: null\n }\n \nreturn [null, msg]\n}\n\nelse {\n\nglobal.set(\"Status.Status_34\", \"Connected\")\nreturn [msg, null];\n}","outputs":2,"noerr":0,"initialize":"","finalize":"","libs":[{"var":"moment","module":"moment"}],"x":420,"y":1020,"wires":[["1b9659be.7ba1ce"],["249147b.1d31cb8"]]},{"id":"5ee79f06.e10bb8","type":"function","z":"89e2edc2.2ff858","name":"error","func":"\nlet time = moment().format('YYYY-MM-DD HH:mm:ss')\n\nif (msg.payload == \"\" || msg.hasOwnProperty('error')) {\nglobal.set(\"Status.Status_35\", \"Disconnected\")\nnode.status({fill:\"red\",shape:\"ring\",text:`Last disconnected ${time}`});\n\nmsg.payload = { \n V_35_L1: null,\n V_35_L2: null,\n V_35_L3: null,\n A_35_L1: null,\n A_35_L2: null,\n A_35_L3: null,\n P_35_L1: null,\n P_35_L2: null,\n P_35_L3: null,\n P_35_T: null,\n S_35_T: null,\n Q_35_T: null,\n PF_35_L1: null,\n PF_35_L2: null,\n PF_35_L3: null,\n F_35_L1: null,\n F_35_L2: null,\n F_35_L3: null\n }\n \nreturn [null, msg]\n}\n\nelse {\nglobal.set(\"Status.Status_35\", \"Connected\")\nreturn [msg, null];\n}","outputs":2,"noerr":0,"initialize":"","finalize":"","libs":[{"var":"moment","module":"moment"}],"x":420,"y":1140,"wires":[["a0f5e338.d2e648"],["249147b.1d31cb8"]]},{"id":"392534b9.c7792c","type":"function","z":"89e2edc2.2ff858","name":"error","func":"\nlet time = moment().format('YYYY-MM-DD HH:mm:ss')\n\nif (msg.payload == \"\" || msg.hasOwnProperty('error')) {\nglobal.set(\"Status.Status_35\", \"Disconnected\")\nnode.status({fill:\"red\",shape:\"ring\",text:`Last disconnected ${time}`});\n \nmsg.payload = { \n THDV_35_L1: null,\n THDV_35_L2: null,\n THDV_35_L3: null,\n THDA_35_L1: null,\n THDA_35_L2: null,\n THDA_35_L3: null\n }\n \nreturn [null, msg]\n}\n\nelse {\nglobal.set(\"Status.Status_35\", \"Connected\")\nreturn [msg, null];\n}","outputs":2,"noerr":0,"initialize":"","finalize":"","libs":[{"var":"moment","module":"moment"}],"x":420,"y":1200,"wires":[["a496298f.d24928"],["249147b.1d31cb8"]]},{"id":"5ac4412d.c6c238","type":"function","z":"89e2edc2.2ff858","name":"error","func":"\nlet time = moment().format('YYYY-MM-DD HH:mm:ss')\n\nif (msg.payload == \"\" || msg.hasOwnProperty('error')) {\n\nglobal.set(\"Status.Status_35\", \"Disconnected\")\nnode.status({fill:\"red\",shape:\"ring\",text:`Last disconnected ${time}`});\n\nmsg.payload = { \n EI_35_T: null,\n EI_35_L1: null,\n EI_35_L2: null,\n EI_35_L3: null\n }\n \nreturn [null, msg]\n}\n\nelse {\nglobal.set(\"Status.Status_35\", \"Connected\")\nreturn [msg, null];\n}","outputs":2,"noerr":0,"initialize":"","finalize":"","libs":[{"var":"moment","module":"moment"}],"x":420,"y":1260,"wires":[["d8644f57.fd0618"],["249147b.1d31cb8"]]},{"id":"807bebf8.3e9a18","type":"function","z":"89e2edc2.2ff858","name":"error","func":"\nlet time = moment().format('YYYY-MM-DD HH:mm:ss')\n\nif (msg.payload == \"\" || msg.hasOwnProperty('error')) {\nglobal.set(\"Status.Status_36\", \"Disconnected\")\nnode.status({fill:\"red\",shape:\"ring\",text:`Last disconnected ${time}`});\n\nmsg.payload = { \n V_36_L1: null,\n V_36_L2: null,\n V_36_L3: null,\n A_36_L1: null,\n A_36_L2: null,\n A_36_L3: null,\n P_36_L1: null,\n P_36_L2: null,\n P_36_L3: null,\n P_36_T: null,\n S_36_T: null,\n Q_36_T: null,\n PF_36_L1: null,\n PF_36_L2: null,\n PF_36_L3: null,\n F_36_L1: null,\n F_36_L2: null,\n F_36_L3: null\n }\n \nreturn [null, msg]\n}\n\nelse {\nglobal.set(\"Status.Status_36\", \"Connected\")\nreturn [msg, null];\n}","outputs":2,"noerr":0,"initialize":"","finalize":"","libs":[{"var":"moment","module":"moment"}],"x":420,"y":1380,"wires":[["eca16e8e.c04dc8"],["249147b.1d31cb8"]]},{"id":"8beef27c.3176","type":"function","z":"89e2edc2.2ff858","name":"error","func":"\nlet time = moment().format('YYYY-MM-DD HH:mm:ss')\n\nif (msg.payload == \"\" || msg.hasOwnProperty('error')) {\nglobal.set(\"Status.Status_36\", \"Disconnected\")\nnode.status({fill:\"red\",shape:\"ring\",text:`Last disconnected ${time}`});\n \nmsg.payload = { \n THDV_36_L1: null,\n THDV_36_L2: null,\n THDV_36_L3: null,\n THDA_36_L1: null,\n THDA_36_L2: null,\n THDA_36_L3: null\n }\n \nreturn [null, msg]\n}\n\nelse {\nglobal.set(\"Status.Status_36\", \"Connected\")\nreturn [msg, null];\n}","outputs":2,"noerr":0,"initialize":"","finalize":"","libs":[{"var":"moment","module":"moment"}],"x":420,"y":1440,"wires":[["b08a7e0c.ac8cf"],["249147b.1d31cb8"]]},{"id":"f6e1e7d9.61a3","type":"function","z":"89e2edc2.2ff858","name":"error","func":"\nlet time = moment().format('YYYY-MM-DD HH:mm:ss')\n\n\nif (msg.payload == \"\" || msg.hasOwnProperty('error')) {\nglobal.set(\"Status.Status_36\", \"Disconnected\")\nnode.status({fill:\"red\",shape:\"ring\",text:`Last disconnected ${time}`});\n\nmsg.payload = { \n EI_36_T: null,\n EI_36_L1: null,\n EI_36_L2: null,\n EI_36_L3: null\n }\n \nreturn [null, msg]\n}\n\nelse {\nglobal.set(\"Status.Status_36\", \"Connected\")\nreturn [msg, null];\n}","outputs":2,"noerr":0,"initialize":"","finalize":"","libs":[{"var":"moment","module":"moment"}],"x":420,"y":1500,"wires":[["7ee667ea.2f2a98"],["249147b.1d31cb8"]]},{"id":"41fb8c1d.91dabc","type":"function","z":"89e2edc2.2ff858","name":"insert PF","func":"let modbus = global.get('Modbus')\n\nlet PF_31_L1 = modbus['PF_31_L1'] \nlet PF_31_L2 = modbus['PF_31_L2'] \nlet PF_31_L3 = modbus['PF_31_L3']\nlet PF_32_L1 = modbus['PF_32_L1']\nlet PF_32_L2 = modbus['PF_32_L2'] \nlet PF_32_L3 = modbus['PF_32_L3'] \nlet PF_33_L1 = modbus['PF_33_L1'] \nlet PF_33_L2 = modbus['PF_33_L2'] \nlet PF_33_L3 = modbus['PF_33_L3'] \nlet PF_34_L1 = modbus['PF_34_L1'] \nlet PF_34_L2 = modbus['PF_34_L2'] \nlet PF_34_L3 = modbus['PF_34_L3'] \nlet PF_35_L1 = modbus['PF_35_L1'] \nlet PF_35_L2 = modbus['PF_35_L2'] \nlet PF_35_L3 = modbus['PF_35_L3']\nlet PF_36_L1 = modbus['PF_36_L1'] \nlet PF_36_L2
|
Thanks for this. What are the settings for the uibuilder "monitor" node? Same settings as for navbar? The settings did not come with the flow. |
yes .. same settings .. since we are using a build step with parcel-bundler And a sidenote. you dont need anything installed from the uibuilder node at the "Installed Packages" section ps. Did you manage to get it running ? |
Hi,
Started fresh this morning, clean copied everything, checked settings.
npm install runs without errors, but npm run build throws this error:
***@***.***:~/.node-red/uibuilder/monitor$ npm run build
***@***.*** build
parcel build ./src/index.html --public-url ./ --no-cache --out-dir ./dist/ --detailed-report
sh: 1: parcel: not found
What’s next?
Eric
… On 29 May 2022, at 23:17, unborn-andy ***@***.***> wrote:
Same settings as for navbar?
yes .. same settings .. since we are using a build step with parcel-bundler
the two main settings are the URL and serving the files from dist
<https://user-images.githubusercontent.com/93290787/170891565-671a4f0c-19ae-418d-bff4-4aa828aae8fe.png>
And a sidenote. you dont need anything installed from the uibuilder node at the "Installed Packages" section
because we include whatever packages we need ( bootstrap-vue, vue, vue-chartjs, vue-router, vue2-datepicker etc) ourselves in the package.json of the app.
—
Reply to this email directly, view it on GitHub <#1 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ALR6FSM4VPBTBURY7OPDOKLVMPNGJANCNFSM5RFJ7DFQ>.
You are receiving this because you were mentioned.
|
i know whats the problem .. in the Monitor project i had the parcel-bundler installed globally You can see this by comparing the two package.json files of the two projects To solve this add
ps. that project wasnt really intended for public view |
i pushed some updates to the Monitor repository (which i hadn't touched for months) |
Thats very strange .. it builds for me on Windows 11 Besides that .. try to remove the
|
Adding .vue to the filename did the trick for the rpm run build process, thanks. No more errors in the building process, but still a blank page in both Safari and Chrome. This is the console output from Chrome. Can I ignore the Red Cross with Vue app not available?
… On 31 May 2022, at 12:53, unborn-andy ***@***.***> wrote:
unknown option --detailed-report
cannot resolve .. Home
Thats very strange .. it builds for me on Windows 11
Did you by any chance have a newer version of Parcel .. maybe Parcel v2 installed globally that may take precedence over Parcel-bundler v1 that is as a devDependancy ? you can check with npm list -g --depth 0
Besides that .. try to remove the --detailed-report option from the script and
add the .vue extension to every file in the router.js file
import Home from "./components/Home.vue";
// import Table from "./components/Table.vue";
import Overview from "./components/Overview.vue";
import Power from "./components/Power.vue";
import Volts from "./components/Volts.vue";
import Current from "./components/Current.vue";
import Frequency from "./components/Frequency.vue";
import HarmonicsCurrent from "./components/HarmonicsCurrent.vue";
import HarmonicsVoltage from "./components/HarmonicsVoltage.vue";
import Powerfactor from "./components/Powerfactor.vue";
import EnergyAccMonthly from "./components/EnergyAccMonthly.vue";
import energyMonthly from "./components/EnergyMonthly.vue";
import energyYearly from "./components/EnergyYearly.vue";
import energyTotal from "./components/EnergyTotal.vue";
—
Reply to this email directly, view it on GitHub <#1 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ALR6FSPLTK26XB3V7IFWYCDVMXVS5ANCNFSM5RFJ7DFQ>.
You are receiving this because you were mentioned.
|
excellent .. im glad you got it working ..
yes .. that is just an informative message from uibuilder .. its not important for our application |
Two questions.
1. The errors in the browsers console can be ignored?
2. You sent a very limited flow with only six nodes and no text or info at all. There is nothing to detect or adapt in it. Is this correct, or did you intend to send something more?
… Op 31 mei 2022 om 23:18 heeft unborn-andy ***@***.***> het volgende geschreven:
Adding .vue to the filename did the trick for the rpm run build process, thanks
excellent .. im glad you got it working ..
regarding the blank page .. you have to see what you are sending from your db to the monitor uibuilder node and in turn to the front-end vue app .. study parts of my flow and try to replicate it .. thats the hardest part
Can I ignore the Red Cross with Vue app not available?
yes .. that is just an informative message from uibuilder .. its not important for our application
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.
|
Ignore the second question, I have to copy the flow from my mail.
… Op 31 mei 2022 om 23:18 heeft unborn-andy ***@***.***> het volgende geschreven:
Adding .vue to the filename did the trick for the rpm run build process, thanks
excellent .. im glad you got it working ..
regarding the blank page .. you have to see what you are sending from your db to the monitor uibuilder node and in turn to the front-end vue app .. study parts of my flow and try to replicate it .. thats the hardest part
Can I ignore the Red Cross with Vue app not available?
yes .. that is just an informative message from uibuilder .. its not important for our application
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.
|
In this screenshot you see a blank page, and errors caused by a typo somewhere in the script. You can also see I am able to send data to the page, but there is nothing on display. This is Safari, lowest is Chrome
… On 1 Jun 2022, at 11:57, unborn-andy ***@***.***> wrote:
It depends. what errors ? You mentioned one. If its this :
<https://user-images.githubusercontent.com/93290787/171378216-2484db7b-2b07-4bf0-85fa-ecc29e959a94.png>
Then yes, it can be ignored. Are there any others ?
I've sent two flows in my post further up .. one that has 216 nodes and the uibuilder flow that had 6
—
Reply to this email directly, view it on GitHub <#1 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ALR6FSP55QB3UEMFCCTYEJ3VM4XZHANCNFSM5RFJ7DFQ>.
You are receiving this because you were mentioned.
|
sorry .. i dont see a screenshot with the errors attached in your post. |
I have no idea what those errors mean .. |
Looking further into it, it looks like the file names extend the lenght limit for a tag name.
How do i change this?
Verstuurd vanaf mijn iPad
… Op 1 jun. 2022 om 15:53 heeft unborn-andy ***@***.***> het volgende geschreven:
I have no idea what those errors mean ..
i tried to look on the internet but with no conclusive results
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.
|
Those names are created by the Parcel bundler
|
Thanks for the help. (And now the work starts for connecting the data sources) Below Package.json.
|
Wow .. you got it working 👍
.. what version did you have .. the newer Parcel version 2 ? Now you know why i thought of sharing a sh1tty little navbar header ;) .. that may not look like much
Indeed thats gonna take a bit to modify. |
No, I had version 1.12.5 but subsequent changing screens from Linux to Mac resulted in a typo. It was changed to (not existing) version 1.13.5. Changing still did result in an error due to minify.
For now I find it very attractive, especially the interaction between dashboard and Node Red
It will take time. Holiday season starts in weeks. |
Hi, I follow all your steps but it doesn't works for me. I can't build it.
This is the error log. Can you help me?
Regards
0 info it worked if it ends with ok 1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'build' ] 2 info using npm@6.14.16 3 info using node@v14.19.0 4 verbose run-script [ 'prebuild', 'build', 'postbuild' ] 5 info lifecycle src@1.0.0~prebuild: src@1.0.0 6 info lifecycle src@1.0.0~build: src@1.0.0 7 verbose lifecycle src@1.0.0~build: unsafe-perm in lifecycle true 8 verbose lifecycle src@1.0.0~build: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/root/.node-red/uibuilder/navbar3/node_modules/.bin:/root/.vscode-server/bin/c722ca6c7eed3d7987c0d5c3df> 9 verbose lifecycle src@1.0.0~build: CWD: /root/.node-red/uibuilder/navbar3 10 silly lifecycle src@1.0.0~build: Args: [ 10 silly lifecycle '-c', 10 silly lifecycle 'rm -rf ./dist/* && parcel build ./src/index.html --public-url ./ --no-cache --out-dir ./dist/ --detailed-report' 10 silly lifecycle ] 11 info lifecycle src@1.0.0~build: Failed to exec build script 12 verbose stack Error: src@1.0.0 build:
rm -rf ./dist/* && parcel build ./src/index.html --public-url ./ --no-cache --out-dir ./dist/ --detailed-report12 verbose stack spawn ENOENT 12 verbose stack at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:48:18) 12 verbose stack at ChildProcess.emit (events.js:400:28) 12 verbose stack at maybeClose (internal/child_process.js:1058:16) 12 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:293:5) 13 verbose pkgid src@1.0.0 14 verbose cwd /root/.node-red/uibuilder/navbar3 15 verbose Linux 5.9.16-rockchip 16 verbose argv "/usr/bin/node" "/usr/bin/npm" "run" "build" 17 verbose node v14.19.0 18 verbose npm v6.14.16 19 error code ELIFECYCLE 20 error syscall spawn 21 error file sh 22 error errno ENOENT 23 error src@1.0.0 build:
rm -rf ./dist/* && parcel build ./src/index.html --public-url ./ --no-cache --out-dir ./dist/ --detailed-report23 error spawn ENOENT
The text was updated successfully, but these errors were encountered: