Open EnergyOnSite opened 2 years ago
Hello .. I tested the steps again today and its working for me (on Windows 11) I dont understand from your error log, what could be the problem. Can you give us some more information on your system ?
Hello, When I trie navbar example, npm run build fails
`Run `npm audit` for details.
PS C:\Users\jmcor\.node-red\uibuilder\navbar> npm run build
> src@1.0.0 build
> rm -rf ./dist/* && parcel build ./src/index.html --public-url ./ --no-cache --out-dir ./dist/ --detailed-report
"rm" no se reconoce como un comando interno o externo,
programa o archivo por lotes ejecutable.`
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. Regards
"rm" no se reconoce como un comando interno o externo, programa o archivo por lotes ejecutable.
possibly its because on my Windows system i had Git bash installed and thats why the rm -rf ./dist/*
was recognized and on yours is not. What that command basically does is remove all files from dist folder before building again.
Edit the package.json
file of the uib-template-vue-navbar example
and remove the rm
command as follows
"scripts": {
"dev": "parcel watch ./src/index.html --public-url ./ --no-cache --out-dir ./dist/",
"build": "parcel build ./src/index.html --public-url ./ --no-cache --out-dir ./dist/ --detailed-report"
}
,
.. and try to build again.
Hi. Now npm run build works, but when load http://localhost:1880/navbar/ nothing is showed. Page are completely empty. However, using your node-red energy monitor project, page navigation works, but data transmision from Uibuilder to Node-red doesn't work. I can't get any message y uibuilder node output. Regards
nothing is showed. Page are completely empty.
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
(originally from your log is see you used navbar3
?? .. now you mention navbar
?? http://localhost:1880/navbar/ )
and have you set the dist
folder as the folder to serve the files ?
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.
Yes. its working fine for me.
That error you shared looks like a socket connection error ..
uibuilder.start('/navbar', '/uibuilder/vendor/socket.io')
in the app.js
file
expects your uibuilder node to be configured to serve from navbar
url path
can you confirm that those settings match ? (url and uibuilder start path)
Hello @unborn-andy, Thanks for the reply. Glad you’re still on this project. I removed the navbar node and start fresh today. As I read the documentation on uibuilder 5, pointing to my server with a full path is no longer required, a relative path is enough (step 1 configuration). Can you confirm this? Second thing I noticed that the navbar directory contained a folder node-modules and some more duplicate folders. Is this correct? This is all new for me, so excuse the questions. Node-red is up to date running on Ubuntu.
Did a fresh install this morning. From your manual it is not clear which index.html should be edited. There is one in dist, one in src. I edited them both. I still get a blank page with a black header bar with Project Name, Home etc. And this is the console log .
These are the libraries installed in uibuilder .
From your manual it is not clear which index.html should be edited
Always the one in src
.. the files in dist
will get replaced when you run the npm run build
command.
I still get a blank page with a black header bar with Project Name,
Heheh .. what did you expect? .. so you got it running (without the socket errors) .. well .. this is my project ;) a header uibuilder template, based on bootstrap-vue navbar using Vue 2 and Vue-router that demostrates how to have different .vue files as pages. The content of each vue component / page it up to you to develop, depending on your project.
pointing to my server with a full path is no longer required, a relative path is enough (step 1 configuration). Can you confirm this?
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.
the navbar directory contained a folder node-modules and some more duplicate folders
yes node-modules
folder gets created when you initially run npm install
. Npm looks at package.json
sees what dependancies the app has and installs them under the app's root folder.
I dont know what you mean with "duplicate folders"
This is all new for me, so excuse the questions
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.
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 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 = modbus['PF_36_L2'] \nlet PF_36_L3 = modbus['PF_36_L3'] \n\nlet entries = Object.entries(modbus) \nentries = entries.filter( el => el[0].match(/^PF_/)) // filter PF\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 Powerfactor (dt, 'PF_31_L1', 'PF_31_L2', 'PF_31_L3', 'PF_32_L1', 'PF_32_L2', 'PF_32_L3', 'PF_33_L1', 'PF_33_L2', 'PF_33_L3', 'PF_34_L1', 'PF_34_L2', 'PF_34_L3', 'PF_35_L1', 'PF_35_L2', 'PF_35_L3', 'PF_36_L1', 'PF_36_L2', 'PF_36_L3') \n// VALUES (datetime('now', 'localtime'), ${PF_31_L1}, ${PF_31_L2}, ${PF_31_L3}, ${PF_32_L1}, ${PF_32_L2}, ${PF_32_L3}, ${PF_33_L1}, ${PF_33_L2}, ${PF_33_L3}, ${PF_34_L1}, ${PF_34_L2}, ${PF_34_L3}, ${PF_35_L1}, ${PF_35_L2}, ${PF_35_L3}, ${PF_36_L1}, ${PF_36_L2}, ${PF_36_L3})`;\n\nnewMsg.topic = `INSERT INTO Powerfactor (dt, ${keys}) VALUES (datetime('now', 'localtime'), ${values})`;\n\nreturn newMsg;\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":460,"y":2000,"wires":[["f77916c8.cb92b"]]},{"id":"def70402.898f08","type":"function","z":"89e2edc2.2ff858","name":"insert Frequency","func":"let modbus = global.get('Modbus')\n\n// let F_31_L1 = modbus['F_31_L1'] \n// let F_31_L2 = modbus['F_31_L2']\n// let F_31_L3 = modbus['F_31_L3']\n// let F_32_L1 = modbus['F_32_L1'] \n// let F_32_L2 = modbus['F_32_L2'] \n// let F_32_L3 = modbus['F_32_L3'] \n// let F_33_L1 = modbus['F_33_L1'] \n// let F_33_L2 = modbus['F_33_L2'] \n// let F_33_L3 = modbus['F_33_L3'] \n// let F_34_L1 = modbus['F_34_L1'] \n// let F_34_L2 = modbus['F_34_L2']\n// let F_34_L3 = modbus['F_34_L3']\n// let F_35_L1 = modbus['F_35_L1'] \n// let F_35_L2 = modbus['F_35_L2'] \n// let F_35_L3 = modbus['F_35_L3'] \n// let F_36_L1 = modbus['F_36_L1']\n// let F_36_L2 = modbus['F_36_L2']\n// let F_36_L3 = modbus['F_36_L3'] \n\nlet entries = Object.entries(modbus) \nentries = entries.filter( el => el[0].match(/^F_/)) // filter Frequency\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 Frequency (dt, 'F_31_L1', 'F_31_L2', 'F_31_L3', 'F_32_L1', 'F_32_L2', 'F_32_L3', 'F_33_L1', 'F_33_L2', 'F_33_L3', 'F_34_L1', 'F_34_L2', 'F_34_L3', 'F_35_L1', 'F_35_L2', 'F_35_L3', 'F_36_L1', 'F_36_L2', 'F_36_L3') \n// VALUES (datetime('now', 'localtime'), ${F_31_L1}, ${F_31_L2}, ${F_31_L3}, ${F_32_L1}, ${F_32_L2}, ${F_32_L3}, ${F_33_L1}, ${F_33_L2}, ${F_33_L3}, ${F_34_L1}, ${F_34_L2}, ${F_34_L3}, ${F_35_L1}, ${F_35_L2}, ${F_35_L3}, ${F_36_L1}, ${F_36_L2}, ${F_36_L3})`;\n\nnewMsg.topic = `INSERT INTO Frequency (dt, ${keys}) VALUES (datetime('now', 'localtime'), ${values})`;\n\nreturn newMsg;\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":490,"y":2060,"wires":[["f77916c8.cb92b"]]},{"id":"ccb4d3fa.d4fa78","type":"function","z":"89e2edc2.2ff858","name":"insert Harmonics","func":"let modbus = global.get('Modbus')\n\n// let THDV_31_L1 = modbus['THDV_31_L1'] \n// let THDV_31_L2 = modbus['THDV_31_L2'] \n// let THDV_31_L3 = modbus['THDV_31_L3'] \n// let THDV_32_L1 = modbus['THDV_32_L1']\n// let THDV_32_L2 = modbus['THDV_32_L2'] \n// let THDV_32_L3 = modbus['THDV_32_L3'] \n// let THDV_33_L1 = modbus['THDV_33_L1'] \n// let THDV_33_L2 = modbus['THDV_33_L2'] \n// let THDV_33_L3 = modbus['THDV_33_L3'] \n// let THDV_34_L1 = modbus['THDV_34_L1']\n// let THDV_34_L2 = modbus['THDV_34_L2'] \n// let THDV_34_L3 = modbus['THDV_34_L3'] \n// let THDV_35_L1 = modbus['THDV_35_L1'] \n// let THDV_35_L2 = modbus['THDV_35_L2'] \n// let THDV_35_L3 = modbus['THDV_35_L3']\n// let THDV_36_L1 = modbus['THDV_36_L1'] \n// let THDV_36_L2 = modbus['THDV_36_L2']\n// let THDV_36_L3 = modbus['THDV_36_L3']\n\n// let THDA_31_L1 = modbus['THDA_31_L1'] \n// let THDA_31_L2 = modbus['THDA_31_L2'] \n// let THDA_31_L3 = modbus['THDA_31_L3'] \n// let THDA_32_L1 = modbus['THDA_32_L1'] \n// let THDA_32_L2 = modbus['THDA_32_L2'] \n// let THDA_32_L3 = modbus['THDA_32_L3'] \n// let THDA_33_L1 = modbus['THDA_33_L1'] \n// let THDA_33_L2 = modbus['THDA_33_L2'] \n// let THDA_33_L3 = modbus['THDA_33_L3'] \n// let THDA_34_L1 = modbus['THDA_34_L1'] \n// let THDA_34_L2 = modbus['THDA_34_L2'] \n// let THDA_34_L3 = modbus['THDA_34_L3']\n// let THDA_35_L1 = modbus['THDA_35_L1'] \n// let THDA_35_L2 = modbus['THDA_35_L2'] \n// let THDA_35_L3 = modbus['THDA_35_L3'] \n// let THDA_36_L1 = modbus['THDA_36_L1'] \n// let THDA_36_L2 = modbus['THDA_36_L2'] \n// let THDA_36_L3 = modbus['THDA_36_L3'] \n\nlet entries = Object.entries(modbus) \n\nlet THDV_entries = entries.filter( el => el[0].match(/^THDV_/)) // filter Harmonics\nlet THDA_entries = entries.filter( el => el[0].match(/^THDA_/)) // filter Harmonics\n\n\nlet THDV_keys = THDV_entries.map( el => el[0]).join(', ')\nlet THDV_values = THDV_entries.map( el => el[1] ? el[1] : 'null' ).join(', ')\n\nlet THDA_keys = THDA_entries.map( el => el[0]).join(', ')\nlet THDA_values = THDA_entries.map( el => el[1] ? el[1] : 'null' ).join(', ')\n\n\n\nlet newMsg = {};\n\n// newMsg.topic = `INSERT INTO Harmonics (dt, 'THDV_31_L1', 'THDV_31_L2', 'THDV_31_L3', 'THDV_32_L1', 'THDV_32_L2', 'THDV_32_L3', 'THDV_33_L1', 'THDV_33_L2', 'THDV_33_L3', 'THDV_34_L1', 'THDV_34_L2', 'THDV_34_L3', 'THDV_35_L1', 'THDV_35_L2', 'THDV_35_L3', 'THDV_36_L1', 'THDV_36_L2', 'THDV_36_L3', 'THDA_31_L1', 'THDA_31_L2', 'THDA_31_L3', 'THDA_32_L1', 'THDA_32_L2', 'THDA_32_L3', 'THDA_33_L1', 'THDA_33_L2', 'THDA_33_L3', 'THDA_34_L1', 'THDA_34_L2', 'THDA_34_L3', 'THDA_35_L1', 'THDA_35_L2', 'THDA_35_L3', 'THDA_36_L1', 'THDA_36_L2', 'THDA_36_L3' ) \n// VALUES (datetime('now', 'localtime'), ${THDV_31_L1}, ${THDV_31_L2}, ${THDV_31_L3}, ${THDV_32_L1}, ${THDV_32_L2}, ${THDV_32_L3}, ${THDV_33_L1}, ${THDV_33_L2}, ${THDV_33_L3}, ${THDV_34_L1}, ${THDV_34_L2}, ${THDV_34_L3}, ${THDV_35_L1}, ${THDV_35_L2}, ${THDV_35_L3}, ${THDV_36_L1}, ${THDV_36_L2}, ${THDV_36_L3}, ${THDA_31_L1}, ${THDA_31_L2}, ${THDA_31_L3}, ${THDA_32_L1}, ${THDA_32_L2}, ${THDA_32_L3}, ${THDA_33_L1}, ${THDA_33_L2}, ${THDA_33_L3}, ${THDA_34_L1}, ${THDA_34_L2}, ${THDA_34_L3}, ${THDA_35_L1}, ${THDA_35_L2}, ${THDA_35_L3}, ${THDA_36_L1}, ${THDA_36_L2}, ${THDA_36_L3} )`;\n\nnewMsg.topic = `INSERT INTO Harmonics (dt, ${THDV_keys}, ${THDA_keys}) VALUES (datetime('now', 'localtime'), ${THDV_values}, ${THDA_values})`;\n\nreturn newMsg;\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":490,"y":2120,"wires":[["f77916c8.cb92b"]]},{"id":"c2cbe6f2.91eb88","type":"function","z":"89e2edc2.2ff858","name":"insert Energy","func":"let modbus = global.get('Modbus')\n\n// let EI_31_L1 = modbus['EI_31_L1'] \n// let EI_31_L2 = modbus['EI_31_L2'] \n// let EI_31_L3 = modbus['EI_31_L3'] \n// let EI_31_T = modbus['EI_31_T'] \n// let EI_32_L1 = modbus['EI_32_L1'] \n// let EI_32_L2 = modbus['EI_32_L2'] \n// let EI_32_L3 = modbus['EI_32_L3'] \n// let EI_32_T = modbus['EI_32_T'] \n// let EI_33_L1 = modbus['EI_33_L1'] \n// let EI_33_L2 = modbus['EI_33_L2'] \n// let EI_33_L3 = modbus['EI_33_L3'] \n// let EI_33_T = modbus['EI_33_T'] \n// let EI_34_L1 = modbus['EI_34_L1'] \n// let EI_34_L2 = modbus['EI_34_L2'] \n// let EI_34_L3 = modbus['EI_34_L3'] \n// let EI_34_T = modbus['EI_34_T'] \n// let EI_35_L1 = modbus['EI_35_L1'] \n// let EI_35_L2 = modbus['EI_35_L2'] \n// let EI_35_L3 = modbus['EI_35_L3'] \n// let EI_35_T = modbus['EI_35_T'] \n// let EI_36_L1 = modbus['EI_36_L1']\n// let EI_36_L2 = modbus['EI_36_L2'] \n// let EI_36_L3 = modbus['EI_36_L3'] \n// let EI_36_T = modbus['EI_36_T'] \n\nlet entries = Object.entries(modbus) \nentries = entries.filter( el => el[0].match(/^EI_/)) // filter Energy\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 Energy (dt, 'EI_31_L1', 'EI_31_L2', 'EI_31_L3', 'EI_31_T', 'EI_32_L1', 'EI_32_L2', 'EI_32_L3', 'EI_32_T', 'EI_33_L1', 'EI_33_L2', 'EI_33_L3', 'EI_33_T', 'EI_34_L1', 'EI_34_L2', 'EI_34_L3', 'EI_34_T', 'EI_35_L1', 'EI_35_L2', 'EI_35_L3', 'EI_35_T', 'EI_36_L1', 'EI_36_L2', 'EI_36_L3', 'EI_36_T') \n// VALUES (datetime('now', 'localtime'), ${EI_31_L1}, ${EI_31_L2}, ${EI_31_L3}, ${EI_31_T}, ${EI_32_L1}, ${EI_32_L2}, ${EI_32_L3}, ${EI_32_T}, ${EI_33_L1}, ${EI_33_L2}, ${EI_33_L3}, ${EI_33_T}, ${EI_34_L1}, ${EI_34_L2}, ${EI_34_L3}, ${EI_34_T}, ${EI_35_L1}, ${EI_35_L2}, ${EI_35_L3}, ${EI_35_T}, ${EI_36_L1}, ${EI_36_L2}, ${EI_36_L3}, ${EI_36_T})`;\n\nnewMsg.topic = `INSERT INTO Energy (dt, ${keys}) VALUES (datetime('now', 'localtime'), ${values})`;\n\nreturn newMsg;\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":480,"y":1880,"wires":[["f77916c8.cb92b"]]},{"id":"f92fd46e.6ee0f8","type":"function","z":"89e2edc2.2ff858","name":"insert Power","func":"let modbus = global.get('Modbus')\n\n// let P_31_L1 = modbus['P_31_L1'] \n// let P_31_L2 = modbus['P_31_L2'] \n// let P_31_L3 = modbus['P_31_L3'] \n// let P_31_T = modbus['P_31_T'] \n// let Q_31_T = modbus['Q_31_T'] \n// let S_31_T = modbus['S_31_T'] \n// let P_32_L1 = modbus['P_32_L1'] \n// let P_32_L2 = modbus['P_32_L2'] \n// let P_32_L3 = modbus['P_32_L3'] \n// let P_32_T = modbus['P_32_T'] \n// let Q_32_T = modbus['Q_32_T'] \n// let S_32_T = modbus['S_32_T'] \n// let P_33_L1 = modbus['P_33_L1'] \n// let P_33_L2 = modbus['P_33_L2'] \n// let P_33_L3 = modbus['P_33_L3'] \n// let P_33_T = modbus['P_33_T'] \n// let Q_33_T = modbus['Q_33_T'] \n// let S_33_T = modbus['S_33_T'] \n// let P_34_L1 = modbus['P_34_L1'] \n// let P_34_L2 = modbus['P_34_L2'] \n// let P_34_L3 = modbus['P_34_L3'] \n// let P_34_T = modbus['P_34_T'] \n// let Q_34_T = modbus['Q_34_T']\n// let S_34_T = modbus['S_34_T'] \n// let P_35_L1 = modbus['P_35_L1'] \n// let P_35_L2 = modbus['P_35_L2'] \n// let P_35_L3 = modbus['P_35_L3'] \n// let P_35_T = modbus['P_35_T'] \n// let Q_35_T = modbus['Q_35_T']\n// let S_35_T = modbus['S_35_T'] \n// let P_36_L1 = modbus['P_36_L1'] \n// let P_36_L2 = modbus['P_36_L2']\n// let P_36_L3 = modbus['P_36_L3'] \n// let P_36_T = modbus['P_36_T'] \n// let Q_36_T = modbus['Q_36_T'] \n// let S_36_T = modbus['S_36_T'] \n\nlet entries = Object.entries(modbus) \n\nlet P_entries = entries.filter( el => el[0].match(/^P_/)) // filter Power\nlet Q_entries = entries.filter( el => el[0].match(/^Q_/)) // filter Power\nlet S_entries = entries.filter( el => el[0].match(/^S_/)) // filter Power\n\nlet P_keys = P_entries.map( el => el[0]).join(', ')\nlet P_values = P_entries.map( el => el[1] ? el[1] : 'null' ).join(', ')\n\nlet Q_keys = Q_entries.map( el => el[0]).join(', ')\nlet Q_values = Q_entries.map( el => el[1] ? el[1] : 'null' ).join(', ')\n\nlet S_keys = S_entries.map( el => el[0]).join(', ')\nlet S_values = S_entries.map( el => el[1] ? el[1] : 'null' ).join(', ')\n\n\n\nlet newMsg = {};\n\n\n\n// newMsg.topic = `INSERT INTO Power (dt, 'P_31_L1', 'P_31_L2', 'P_31_L3', 'P_31_T', 'Q_31_T', 'S_31_T', 'P_32_L1', 'P_32_L2', 'P_32_L3', 'P_32_T', 'Q_32_T', 'S_32_T', 'P_33_L1', 'P_33_L2', 'P_33_L3', 'P_33_T', 'Q_33_T', 'S_33_T', 'P_34_L1', 'P_34_L2', 'P_34_L3', 'P_34_T', 'Q_34_T', 'S_34_T', 'P_35_L1', 'P_35_L2', 'P_35_L3', 'P_35_T', 'Q_35_T', 'S_35_T', 'P_36_L1', 'P_36_L2', 'P_36_L3', 'P_36_T', 'Q_36_T', 'S_36_T') \n// VALUES (datetime('now', 'localtime'), ${P_31_L1}, ${P_31_L2}, ${P_31_L3}, ${P_31_T}, ${Q_31_T}, ${S_31_T}, ${P_32_L1}, ${P_32_L2}, ${P_32_L3}, ${P_32_T}, ${Q_32_T}, ${S_32_T}, ${P_33_L1}, ${P_33_L2}, ${P_33_L3}, ${P_33_T}, ${Q_33_T}, ${S_33_T}, ${P_34_L1}, ${P_34_L2}, ${P_34_L3}, ${P_34_T}, ${Q_34_T}, ${S_34_T}, ${P_35_L1}, ${P_35_L2}, ${P_35_L3}, ${P_35_T}, ${Q_35_T}, ${S_35_T}, ${P_36_L1}, ${P_36_L2}, ${P_36_L3}, ${P_36_T}, ${Q_36_T}, ${S_36_T})`;\n\nnewMsg.topic = `INSERT INTO Power (dt, ${P_keys}, ${Q_keys}, ${S_keys}) VALUES (datetime('now', 'localtime'), ${P_values}, ${Q_values}, ${S_values})`;\n\nreturn newMsg;\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":470,"y":1940,"wires":[["f77916c8.cb92b"]]},{"id":"e8dc045b.48c8c8","type":"function","z":"89e2edc2.2ff858","name":"","func":"msg.payload = { \n value: msg.payload, \n 'fc': 4, \n 'unitid': 31, \n 'address': 1, \n 'quantity': 64 \n} \n\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","x":145,"y":120,"wires":[["4e1b9529.80c94c"]],"l":false},{"id":"8404bc9.cd00f4","type":"function","z":"89e2edc2.2ff858","name":"","func":"msg.payload = { \n value: msg.payload, \n 'fc': 4, \n 'unitid': 31, \n 'address': 105, \n 'quantity': 12\n} \n\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","x":145,"y":180,"wires":[["6d63b87d.1b20d"]],"l":false},{"id":"f41281dd.2bfbb","type":"function","z":"89e2edc2.2ff858","name":"","func":"msg.payload = { \n value: msg.payload, \n 'fc': 4, \n 'unitid': 31, \n 'address': 6799, \n 'quantity': 12 \n} \n\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","x":145,"y":240,"wires":[["b352a18a.8bb0e8"]],"l":false},{"id":"20e0a1d5.fbc25e","type":"function","z":"89e2edc2.2ff858","name":"","func":"msg.payload = { \n value: msg.payload, \n 'fc': 4, \n 'unitid': 32, \n 'address': 1, \n 'quantity': 64 \n} \n\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","x":145,"y":360,"wires":[["68188035.9eb0e"]],"l":false},{"id":"fc4f97d0.fdb048","type":"function","z":"89e2edc2.2ff858","name":"","func":"msg.payload = { \n value: msg.payload, \n 'fc': 4, \n 'unitid': 32, \n 'address': 105, \n 'quantity': 12 \n} \n\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","x":145,"y":420,"wires":[["f1b770aa.92a628"]],"l":false},{"id":"f810939b.fdc52","type":"function","z":"89e2edc2.2ff858","name":"","func":"msg.payload = { \n value: msg.payload, \n 'fc': 4, \n 'unitid': 32, \n 'address': 6799, \n 'quantity': 12 \n} \n\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","x":145,"y":480,"wires":[["65faae05.ef349"]],"l":false},{"id":"251cd14d.06b146","type":"function","z":"89e2edc2.2ff858","name":"","func":"msg.payload = { \n value: msg.payload, \n 'fc': 4, \n 'unitid': 33, \n 'address': 1, \n 'quantity': 64 \n} \n\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","x":145,"y":620,"wires":[["b926b16.574cd5"]],"l":false},{"id":"5904dcfc.2ccfdc","type":"function","z":"89e2edc2.2ff858","name":"","func":"msg.payload = { \n value: msg.payload, \n 'fc': 4, \n 'unitid': 33, \n 'address': 105, \n 'quantity': 12 \n} \n\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","x":145,"y":680,"wires":[["a9dfbef4.ac598"]],"l":false},{"id":"dff7be18.b3176","type":"function","z":"89e2edc2.2ff858","name":"","func":"msg.payload = { \n value: msg.payload, \n 'fc': 4, \n 'unitid': 33, \n 'address': 6799, \n 'quantity': 12 \n} \n\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","x":145,"y":740,"wires":[["f27adbea.37d148"]],"l":false},{"id":"a82ce65.823ad18","type":"function","z":"89e2edc2.2ff858","name":"","func":"msg.payload = { \n value: msg.payload, \n 'fc': 4, \n 'unitid': 34, \n 'address': 1, \n 'quantity': 64 \n} \n\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","x":145,"y":880,"wires":[["ce104073.f804b8"]],"l":false},{"id":"f6fb6a27.402cc","type":"function","z":"89e2edc2.2ff858","name":"","func":"msg.payload = { \n value: msg.payload, \n 'fc': 4, \n 'unitid': 34, \n 'address': 105, \n 'quantity': 12 \n} \n\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","x":145,"y":940,"wires":[["d00efe7d.465fa"]],"l":false},{"id":"a5da1256.b33fd","type":"function","z":"89e2edc2.2ff858","name":"","func":"msg.payload = { \n value: msg.payload, \n 'fc': 4, \n 'unitid': 34, \n 'address': 6799, \n 'quantity': 12 \n} \n\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","x":145,"y":1020,"wires":[["49a2b36a.e7fe0c"]],"l":false},{"id":"8af713d4.c96e7","type":"function","z":"89e2edc2.2ff858","name":"","func":"msg.payload = { \n value: msg.payload, \n 'fc': 4, \n 'unitid': 35, \n 'address': 1, \n 'quantity': 64 \n} \n\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","x":145,"y":1140,"wires":[["b8df5cae.e42db8"]],"l":false},{"id":"fae5c25.49125c","type":"function","z":"89e2edc2.2ff858","name":"","func":"msg.payload = { \n value: msg.payload, \n 'fc': 4, \n 'unitid': 35, \n 'address': 105, \n 'quantity': 12 \n} \n\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","x":145,"y":1200,"wires":[["380180b8.fa9998"]],"l":false},{"id":"75a7794c.f0a9f8","type":"function","z":"89e2edc2.2ff858","name":"","func":"msg.payload = { \n value: msg.payload, \n 'fc': 4, \n 'unitid': 35, \n 'address': 6799, \n 'quantity': 12 \n} \n\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","x":145,"y":1260,"wires":[["349ea810.eb6f7"]],"l":false},{"id":"425ac0a6.643c68","type":"function","z":"89e2edc2.2ff858","name":"","func":"msg.payload = { \n value: msg.payload, \n 'fc': 4, \n 'unitid': 36, \n 'address': 1, \n 'quantity': 64 \n} \n\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","x":145,"y":1380,"wires":[["593c4ba4.d2e574"]],"l":false},{"id":"249c4ba6.121424","type":"function","z":"89e2edc2.2ff858","name":"","func":"msg.payload = { \n value: msg.payload, \n 'fc': 4, \n 'unitid': 36, \n 'address': 105, \n 'quantity': 12 \n} \n\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","x":145,"y":1440,"wires":[["2efad507.da8b6a"]],"l":false},{"id":"150278b1.cbf227","type":"function","z":"89e2edc2.2ff858","name":"","func":"msg.payload = { \n value: msg.payload, \n 'fc': 4, \n 'unitid': 36, \n 'address': 6799, \n 'quantity': 12 \n} \n\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","x":145,"y":1500,"wires":[["a52c1951.9c6c7"]],"l":false},{"id":"c607a64f.18067","type":"change","z":"89e2edc2.2ff858","name":"csvData","rules":[{"t":"set","p":"payload","pt":"msg","to":"$append([], payload.{\t\t \"dt\": dt,\t \t \"Meter A L1\" : P_31_L1,\t \"Meter A L2\" : P_31_L2,\t \"Meter A L3\" : P_31_L3,\t \"Meter A T\" : P_31_T,\t \t \"Meter B L1\" : P_32_L1,\t \"Meter B L2\" : P_32_L2,\t \"Meter B L3\" : P_32_L3,\t \"Meter B T\" : P_32_T,\t \"Meter C L1\" : P_33_L1,\t \"Meter C L2\" : P_33_L2,\t \"Meter C L3\" : P_33_L3,\t \"Meter C T\" : P_33_T\t /*,\t \"Heat Pump Hot Water 2 L1\" : P_34_L1,\t \"Heat Pump Hot Water 2 L2\" : P_34_L2,\t \"Heat Pump Hot Water 2 L3\" : P_34_L3,\t \"Heat Pump Hot Water 2 T\" : P_34_T,\t\t \"Heat Pump Cold Water 1 L1\" : P_35_L1,\t \"Heat Pump Cold Water 1 L2\" : P_35_L2,\t \"Heat Pump Cold Water 1 L3\" : P_35_L3,\t \"Heat Pump Cold Water 1 T\" : P_35_T,\t \"Heat Pump Cold Water 2 L1\" : P_36_L1,\t \"Heat Pump Cold Water 2 L2\" : P_36_L2,\t \"Heat Pump Cold Water 2 L3\" : P_36_L3,\t \"Heat Pump Cold Water 2 T\" : P_36_T\t */\t})","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1066,"y":3119,"wires":[["65cf4d3c.6a7704"]]},{"id":"d91e6128.28f31","type":"change","z":"89e2edc2.2ff858","name":"csvData","rules":[{"t":"set","p":"payload","pt":"msg","to":"$append([], payload.{\t \"dt\": dt,\t \"Meter A L1\" : EI_31_L1,\t \"Meter A L2\" : EI_31_L2,\t \"Meter A L3\" : EI_31_L3,\t \"Meter A T\" : EI_31_T,\t \"Meter B L1\" : EI_32_L1,\t \"Meter B L2\" : EI_32_L2,\t \"Meter B L3\" : EI_32_L3,\t \"Meter B T\" : EI_32_T,\t \"Meter C L1\" : EI_33_L1,\t \"Meter C L2\" : EI_33_L2,\t \"Meter C L3\" : EI_33_L3,\t \"Meter C T\" : EI_33_T\t /*,\t \"Heat Pump Hot Water 2 L1\" : EI_34_L1,\t \"Heat Pump Hot Water 2 L2\" : EI_34_L2,\t \"Heat Pump Hot Water 2 L3\" : EI_34_L3,\t \"Heat Pump Hot Water 2 T\" : EI_34_T,\t\t \"Heat Pump Cold Water 1 L1\" : EI_35_L1,\t \"Heat Pump Cold Water 1 L2\" : EI_35_L2,\t \"Heat Pump Cold Water 1 L3\" : EI_35_L3,\t \"Heat Pump Cold Water 1 T\" : EI_35_T,\t \"Heat Pump Cold Water 2 L1\" : EI_36_L1,\t \"Heat Pump Cold Water 2 L2\" : EI_36_L2,\t \"Heat Pump Cold Water 2 L3\" : EI_36_L3,\t \"Heat Pump Cold Water 2 T\" : EI_36_T\t */\t})","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1066,"y":2639,"wires":[["a97f831.70039"]]},{"id":"3cb9772e.377208","type":"change","z":"89e2edc2.2ff858","name":"csvData","rules":[{"t":"set","p":"payload","pt":"msg","to":"$append([], payload.{\t \"dt\": dt,\t \"Meter A L1\" : EI_31_L1,\t \"Meter A L2\" : EI_31_L2,\t \"Meter A L3\" : EI_31_L3,\t \"Meter A T\" : EI_31_T,\t \"Meter B L1\" : EI_32_L1,\t \"Meter B L2\" : EI_32_L2,\t \"Meter B L3\" : EI_32_L3,\t \"Meter B T\" : EI_32_T,\t \"Meter C L1\" : EI_33_L1,\t \"Meter C L2\" : EI_33_L2,\t \"Meter C L3\" : EI_33_L3,\t \"Meter C T\" : EI_33_T\t /*\t ,\t \"Heat Pump Hot Water 2 L1\" : EI_34_L1,\t \"Heat Pump Hot Water 2 L2\" : EI_34_L2,\t \"Heat Pump Hot Water 2 L3\" : EI_34_L3,\t \"Heat Pump Hot Water 2 T\" : EI_34_T,\t\t \"Heat Pump Cold Water 1 L1\" : EI_35_L1,\t \"Heat Pump Cold Water 1 L2\" : EI_35_L2,\t \"Heat Pump Cold Water 1 L3\" : EI_35_L3,\t \"Heat Pump Cold Water 1 T\" : EI_35_T,\t \"Heat Pump Cold Water 2 L1\" : EI_36_L1,\t \"Heat Pump Cold Water 2 L2\" : EI_36_L2,\t \"Heat Pump Cold Water 2 L3\" : EI_36_L3,\t \"Heat Pump Cold Water 2 T\" : EI_36_T\t */\t})","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1066,"y":2799,"wires":[["308fd335.9768e4"]]},{"id":"570698c4.b7903","type":"change","z":"89e2edc2.2ff858","name":"csvData","rules":[{"t":"set","p":"payload","pt":"msg","to":"$append([], payload.{\t \"dt\": dt,\t \"Meter A L1\" : EI_31_L1,\t \"Meter A L2\" : EI_31_L2,\t \"Meter A L3\" : EI_31_L3,\t \"Meter A T\" : EI_31_T,\t \"Meter B L1\" : EI_32_L1,\t \"Meter B L2\" : EI_32_L2,\t \"Meter B L3\" : EI_32_L3,\t \"Meter B T\" : EI_32_T,\t \"Meter C L1\" : EI_33_L1,\t \"Meter C L2\" : EI_33_L2,\t \"Meter C L3\" : EI_33_L3,\t \"Meter C T\" : EI_33_T\t /*\t ,\t \"Heat Pump Hot Water 2 L1\" : EI_34_L1,\t \"Heat Pump Hot Water 2 L2\" : EI_34_L2,\t \"Heat Pump Hot Water 2 L3\" : EI_34_L3,\t \"Heat Pump Hot Water 2 T\" : EI_34_T,\t\t \"Heat Pump Cold Water 1 L1\" : EI_35_L1,\t \"Heat Pump Cold Water 1 L2\" : EI_35_L2,\t \"Heat Pump Cold Water 1 L3\" : EI_35_L3,\t \"Heat Pump Cold Water 1 T\" : EI_35_T,\t \"Heat Pump Cold Water 2 L1\" : EI_36_L1,\t \"Heat Pump Cold Water 2 L2\" : EI_36_L2,\t \"Heat Pump Cold Water 2 L3\" : EI_36_L3,\t \"Heat Pump Cold Water 2 T\" : EI_36_T\t */\t})","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1066,"y":2959,"wires":[["cdad4c4b.74c738"]]},{"id":"c5283616.c1b568","type":"debug","z":"89e2edc2.2ff858","name":"2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1010,"y":2320,"wires":[]},{"id":"1060ac83.97c9ab","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))`\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[{"var":"moment","module":"moment"}],"x":376,"y":2479,"wires":[["d28c34a0.4256a8"]]},{"id":"5daedf51.fa11a8","type":"comment","z":"89e2edc2.2ff858","name":"acc Monthly Energy","info":"","x":376,"y":2419,"wires":[]},{"id":"91510832.36da78","type":"function","z":"89e2edc2.2ff858","name":"Calculate Accumulative","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":"","libs":[],"x":736,"y":2479,"wires":[["7e9810db.541cf"],["27a0d31f.1bd6bc"]]},{"id":"adb86811.8eb1","type":"link out","z":"89e2edc2.2ff858","name":"from sql","links":["8448e455.51aa1"],"x":1181,"y":2419,"wires":[]},{"id":"c49a60c2.81ff58","type":"change","z":"89e2edc2.2ff858","name":"chartData","rules":[{"t":"set","p":"cmd","pt":"msg","to":"chartEnergyAccMonthly","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 {\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}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1066,"y":2419,"wires":[["adb86811.8eb1"]]},{"id":"7e9810db.541cf","type":"switch","z":"89e2edc2.2ff858","name":"","property":"cmd","propertyType":"msg","rules":[{"t":"eq","v":"chartEnergyAccMonthly","vt":"str"},{"t":"eq","v":"csvEnergyAccMonthly","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":916,"y":2459,"wires":[["c49a60c2.81ff58"],["c0510897.56ab28"]]},{"id":"595e3357.f9b14c","type":"link out","z":"89e2edc2.2ff858","name":"data for CSV","links":["424e4ca9.28a51c"],"x":1181,"y":2479,"wires":[]},{"id":"27a0d31f.1bd6bc","type":"link out","z":"89e2edc2.2ff858","name":"from sql","links":["8448e455.51aa1"],"x":881,"y":2519,"wires":[]},{"id":"c0510897.56ab28","type":"change","z":"89e2edc2.2ff858","name":"csvData","rules":[{"t":"set","p":"payload","pt":"msg","to":"$append(\t [],\t payload.{\t \"dt\": dt,\t \"Meter A L1\" : EI_31_L1,\t \"Meter A L2\" : EI_31_L2,\t \"Meter A L3\" : EI_31_L3,\t \"Meter A T\" : EI_31_T,\t \"Meter B L1\" : EI_32_L1,\t \"Meter B L2\" : EI_32_L2,\t \"Meter B L3\" : EI_32_L3,\t \"Meter B T\" : EI_32_T,\t \"Meter C L1\" : EI_33_L1,\t \"Meter C L2\" : EI_33_L2,\t \"Meter C L3\" : EI_33_L3,\t \"Meter C T\" : EI_33_T\t /*,\t \"Heat Pump Hot Water 2 L1\" : EI_34_L1,\t \"Heat Pump Hot Water 2 L2\" : EI_34_L2,\t \"Heat Pump Hot Water 2 L3\" : EI_34_L3,\t \"Heat Pump Hot Water 2 T\" : EI_34_T,\t\t \"Heat Pump Cold Water 1 L1\" : EI_35_L1,\t \"Heat Pump Cold Water 1 L2\" : EI_35_L2,\t \"Heat Pump Cold Water 1 L3\" : EI_35_L3,\t \"Heat Pump Cold Water 1 T\" : EI_35_T,\t \"Heat Pump Cold Water 2 L1\" : EI_36_L1,\t \"Heat Pump Cold Water 2 L2\" : EI_36_L2,\t \"Heat Pump Cold Water 2 L3\" : EI_36_L3,\t \"Heat Pump Cold Water 2 T\" : EI_36_T\t */\t}\t)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1066,"y":2479,"wires":[["595e3357.f9b14c"]]},{"id":"65d93e0.a4bfd44","type":"debug","z":"89e2edc2.2ff858","name":"1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":850,"y":2320,"wires":[]},{"id":"e9b858e1.470708","type":"exec","z":"89e2edc2.2ff858","command":"sudo reboot","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"","x":410,"y":4380,"wires":[["7692b665.875b28"],[],[]]},{"id":"11400dc5.71e72a","type":"inject","z":"89e2edc2.2ff858","name":"reboot","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":250,"y":4380,"wires":[["e9b858e1.470708"]]},{"id":"7692b665.875b28","type":"debug","z":"89e2edc2.2ff858","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":590,"y":4360,"wires":[]},{"id":"7f02daf6.752c14","type":"exec","z":"89e2edc2.2ff858","command":"sudo shutdown -h now","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"","x":440,"y":4280,"wires":[["d00ee2ca.3e09e"],[],[]]},{"id":"d4cada6f.27f338","type":"inject","z":"89e2edc2.2ff858","name":"shutdown","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":240,"y":4280,"wires":[["7f02daf6.752c14"]]},{"id":"d00ee2ca.3e09e","type":"debug","z":"89e2edc2.2ff858","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":630,"y":4260,"wires":[]},{"id":"432976d9.6e39e","type":"debug","z":"89e2edc2.2ff858","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":480,"y":60,"wires":[]},{"id":"4e1b9529.80c94c","type":"modbus-flex-getter","z":"89e2edc2.2ff858","name":"ELNET31a","showStatusActivities":true,"showErrors":false,"logIOActivities":false,"server":"c6d958ad.ea6e1","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":true,"keepMsgProperties":false,"x":260,"y":120,"wires":[["50f4d5f8.e58de4","8404bc9.cd00f4","432976d9.6e39e"],[]]},{"id":"6d63b87d.1b20d","type":"modbus-flex-getter","z":"89e2edc2.2ff858","name":"ELNET31b","showStatusActivities":true,"showErrors":false,"logIOActivities":false,"server":"c6d958ad.ea6e1","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":true,"keepMsgProperties":false,"x":260,"y":180,"wires":[["12901b2f.4ba98d","f41281dd.2bfbb"],[]]},{"id":"b352a18a.8bb0e8","type":"modbus-flex-getter","z":"89e2edc2.2ff858","name":"ELNET31c","showStatusActivities":true,"showErrors":false,"logIOActivities":false,"server":"c6d958ad.ea6e1","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":true,"keepMsgProperties":false,"x":260,"y":240,"wires":[["c3916662.130968","20e0a1d5.fbc25e"],[]]},{"id":"68188035.9eb0e","type":"modbus-flex-getter","z":"89e2edc2.2ff858","name":"ELNET32a","showStatusActivities":true,"showErrors":false,"logIOActivities":false,"server":"c6d958ad.ea6e1","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":true,"keepMsgProperties":false,"x":260,"y":360,"wires":[["1b40dd10.bed813","fc4f97d0.fdb048"],[]]},{"id":"f1b770aa.92a628","type":"modbus-flex-getter","z":"89e2edc2.2ff858","name":"ELNET32b","showStatusActivities":true,"showErrors":false,"logIOActivities":false,"server":"c6d958ad.ea6e1","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":true,"keepMsgProperties":false,"x":260,"y":420,"wires":[["eaf8d07e.dce3e8","f810939b.fdc52"],[]]},{"id":"65faae05.ef349","type":"modbus-flex-getter","z":"89e2edc2.2ff858","name":"ELNET32c","showStatusActivities":true,"showErrors":false,"logIOActivities":false,"server":"c6d958ad.ea6e1","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":true,"keepMsgProperties":false,"x":260,"y":480,"wires":[["5581f5a5.422f04","251cd14d.06b146"],[]]},{"id":"b926b16.574cd5","type":"modbus-flex-getter","z":"89e2edc2.2ff858","name":"ELNET33a","showStatusActivities":true,"showErrors":false,"logIOActivities":false,"server":"c6d958ad.ea6e1","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":true,"keepMsgProperties":false,"x":260,"y":620,"wires":[["2d144bfe.bbd5ac","5904dcfc.2ccfdc"],[]]},{"id":"a9dfbef4.ac598","type":"modbus-flex-getter","z":"89e2edc2.2ff858","name":"ELNET33b","showStatusActivities":true,"showErrors":false,"logIOActivities":false,"server":"c6d958ad.ea6e1","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":true,"keepMsgProperties":false,"x":260,"y":680,"wires":[["a85e5b73.5b3a4","dff7be18.b3176"],[]]},{"id":"f27adbea.37d148","type":"modbus-flex-getter","z":"89e2edc2.2ff858","name":"ELNET33c","showStatusActivities":true,"showErrors":false,"logIOActivities":false,"server":"c6d958ad.ea6e1","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":true,"keepMsgProperties":false,"x":260,"y":740,"wires":[["6f4dc409.834864","a82ce65.823ad18"],[]]},{"id":"ce104073.f804b8","type":"modbus-flex-getter","z":"89e2edc2.2ff858","name":"ELNET34a","showStatusActivities":true,"showErrors":false,"logIOActivities":false,"server":"c6d958ad.ea6e1","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":true,"keepMsgProperties":false,"x":260,"y":880,"wires":[["f34e1dc.c7ba3e","f6fb6a27.402cc"],[]]},{"id":"d00efe7d.465fa","type":"modbus-flex-getter","z":"89e2edc2.2ff858","name":"ELNET34b","showStatusActivities":true,"showErrors":false,"logIOActivities":false,"server":"c6d958ad.ea6e1","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":true,"keepMsgProperties":false,"x":260,"y":940,"wires":[["3a7ca906.1381ae","a5da1256.b33fd"],[]]},{"id":"49a2b36a.e7fe0c","type":"modbus-flex-getter","z":"89e2edc2.2ff858","name":"ELNET34c","showStatusActivities":true,"showErrors":false,"logIOActivities":false,"server":"c6d958ad.ea6e1","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":true,"keepMsgProperties":false,"x":260,"y":1020,"wires":[["1936a42f.31da4c","8af713d4.c96e7"],[]]},{"id":"b8df5cae.e42db8","type":"modbus-flex-getter","z":"89e2edc2.2ff858","name":"ELNET35a","showStatusActivities":true,"showErrors":false,"logIOActivities":false,"server":"c6d958ad.ea6e1","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":true,"keepMsgProperties":false,"x":260,"y":1140,"wires":[["5ee79f06.e10bb8","fae5c25.49125c"],[]]},{"id":"380180b8.fa9998","type":"modbus-flex-getter","z":"89e2edc2.2ff858","name":"ELNET35b","showStatusActivities":true,"showErrors":false,"logIOActivities":false,"server":"c6d958ad.ea6e1","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":true,"keepMsgProperties":false,"x":260,"y":1200,"wires":[["392534b9.c7792c","75a7794c.f0a9f8"],[]]},{"id":"349ea810.eb6f7","type":"modbus-flex-getter","z":"89e2edc2.2ff858","name":"ELNET35c","showStatusActivities":true,"showErrors":false,"logIOActivities":false,"server":"c6d958ad.ea6e1","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":true,"keepMsgProperties":false,"x":260,"y":1260,"wires":[["5ac4412d.c6c238","425ac0a6.643c68"],[]]},{"id":"593c4ba4.d2e574","type":"modbus-flex-getter","z":"89e2edc2.2ff858","name":"ELNET36a","showStatusActivities":true,"showErrors":false,"logIOActivities":false,"server":"c6d958ad.ea6e1","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":true,"keepMsgProperties":false,"x":260,"y":1380,"wires":[["807bebf8.3e9a18","249c4ba6.121424"],[]]},{"id":"2efad507.da8b6a","type":"modbus-flex-getter","z":"89e2edc2.2ff858","name":"ELNET36b","showStatusActivities":true,"showErrors":false,"logIOActivities":false,"server":"c6d958ad.ea6e1","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":true,"keepMsgProperties":false,"x":260,"y":1440,"wires":[["8beef27c.3176","150278b1.cbf227"],[]]},{"id":"a52c1951.9c6c7","type":"modbus-flex-getter","z":"89e2edc2.2ff858","name":"ELNET36c","showStatusActivities":true,"showErrors":false,"logIOActivities":false,"server":"c6d958ad.ea6e1","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":true,"keepMsgProperties":false,"x":260,"y":1500,"wires":[["f6e1e7d9.61a3"],[]]},{"id":"f77916c8.cb92b","type":"sqlite","z":"89e2edc2.2ff858","mydb":"26cd2be8.1dfacc","sqlquery":"msg.topic","sql":"","name":"Sqlite","x":710,"y":1920,"wires":[["345d67c9.e026a"]]},{"id":"9b0ec393.5651c8","type":"sqlite","z":"89e2edc2.2ff858","mydb":"26cd2be8.1dfacc","sqlquery":"msg.topic","sql":"","name":"Sqlite","x":556,"y":2639,"wires":[["fcbce8c6.c74f"]]},{"id":"2874e962.9cb7ae","type":"sqlite","z":"89e2edc2.2ff858","mydb":"26cd2be8.1dfacc","sqlquery":"msg.topic","sql":"","name":"Sqlite","x":556,"y":3119,"wires":[["cf18cb51.528238"]]},{"id":"d57613b4.630b5","type":"sqlite","z":"89e2edc2.2ff858","mydb":"26cd2be8.1dfacc","sqlquery":"msg.topic","sql":"","name":"Sqlite","x":556,"y":2799,"wires":[["b4109b24.2ce04"]]},{"id":"7dbfa57b.d47b1c","type":"sqlite","z":"89e2edc2.2ff858","mydb":"26cd2be8.1dfacc","sqlquery":"msg.topic","sql":"","name":"Sqlite","x":556,"y":2979,"wires":[["280e676.ca86818"]]},{"id":"d28c34a0.4256a8","type":"sqlite","z":"89e2edc2.2ff858","mydb":"26cd2be8.1dfacc","sqlquery":"msg.topic","sql":"","name":"Sqlite","x":556,"y":2479,"wires":[["91510832.36da78"]]},{"id":"f81d2a7d.0b7498","type":"cronplus","z":"89e2edc2.2ff858","name":"","outputField":"payload","timeZone":"","persistDynamic":false,"commandResponseMsgOutput":"output1","outputs":1,"options":[{"name":"trigger","topic":"trigger","payloadType":"default","payload":"","expressionType":"cron","expression":"0 0,30 * * * * *","location":"","offset":"0","solarType":"all","solarEvents":"sunrise,sunset"}],"x":140,"y":1940,"wires":[["91e551de.95c41"]]},{"id":"d8789881.b3cbf","type":"cronplus","z":"89e2edc2.2ff858","name":"","outputField":"payload","timeZone":"","persistDynamic":false,"commandResponseMsgOutput":"output1","outputs":1,"options":[{"name":"trigger","topic":"trigger","payloadType":"bool","payload":"true","expressionType":"cron","expression":"0 * * * * *","location":"","offset":"0","solarType":"all","solarEvents":"sunrise,sunset"}],"x":160,"y":40,"wires":[["e8dc045b.48c8c8"]]},{"id":"92dcda2.7f34fa8","type":"buffer-parser","z":"89e2edc2.2ff858","name":"Group1","data":"responseBuffer.buffer","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"floatbe","name":"V_31_L1","offset":0,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"V_31_L2","offset":4,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"V_31_L3","offset":8,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"A_31_L1","offset":24,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"A_31_L2","offset":28,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"A_31_L3","offset":32,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"P_31_L1","offset":36,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"P_31_L2","offset":40,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"P_31_L3","offset":44,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"P_31_T","offset":48,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"S_31_T","offset":64,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"Q_31_T","offset":80,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"PF_31_L1","offset":84,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"PF_31_L2","offset":88,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"PF_31_L3","offset":92,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"F_31_L1","offset":100,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"F_31_L2","offset":104,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"F_31_L3","offset":108,"length":1,"offsetbit":0,"scale":"1","mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"output","multipleResult":false,"fanOutMultipleResult":false,"setTopic":true,"outputs":1,"x":570,"y":120,"wires":[["249147b.1d31cb8"]]},{"id":"686e6999.6ccb7","type":"buffer-parser","z":"89e2edc2.2ff858","name":"Group2","data":"responseBuffer.buffer","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"floatbe","name":"THDV_31_L1","offset":0,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"THDV_31_L2","offset":4,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"THDV_31_L3","offset":8,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"THDA_31_L1","offset":12,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"THDA_31_L2","offset":16,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"THDA_31_L3","offset":20,"length":1,"offsetbit":0,"scale":"1","mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"output","multipleResult":false,"fanOutMultipleResult":false,"setTopic":true,"outputs":1,"x":570,"y":180,"wires":[["249147b.1d31cb8"]]},{"id":"10965d7a.1396c3","type":"buffer-parser","z":"89e2edc2.2ff858","name":"Group3","data":"responseBuffer.buffer","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"floatbe","name":"EI_31_T","offset":0,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"EI_31_L1","offset":12,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"EI_31_L2","offset":16,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"EI_31_L3","offset":20,"length":1,"offsetbit":0,"scale":"1","mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"output","multipleResult":false,"fanOutMultipleResult":false,"setTopic":true,"outputs":1,"x":570,"y":240,"wires":[["249147b.1d31cb8"]]},{"id":"fc5d6700.89d99","type":"buffer-parser","z":"89e2edc2.2ff858","name":"Group1","data":"responseBuffer.buffer","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"floatbe","name":"V_32_L1","offset":0,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"V_32_L2","offset":4,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"V_32_L3","offset":8,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"A_32_L1","offset":24,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"A_32_L2","offset":28,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"A_32_L3","offset":32,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"P_32_L1","offset":36,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"P_32_L2","offset":40,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"P_32_L3","offset":44,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"P_32_T","offset":48,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"S_32_T","offset":64,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"Q_32_T","offset":80,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"PF_32_L1","offset":84,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"PF_32_L2","offset":88,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"PF_32_L3","offset":92,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"F_32_L1","offset":100,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"F_32_L2","offset":104,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"F_32_L3","offset":108,"length":1,"offsetbit":0,"scale":"1","mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"output","multipleResult":false,"fanOutMultipleResult":false,"setTopic":true,"outputs":1,"x":570,"y":360,"wires":[["249147b.1d31cb8"]]},{"id":"277fa485.07e634","type":"buffer-parser","z":"89e2edc2.2ff858","name":"Group2","data":"responseBuffer.buffer","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"floatbe","name":"THDV_32_L1","offset":0,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"THDV_32_L2","offset":4,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"THDV_32_L3","offset":8,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"THDA_32_L1","offset":12,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"THDA_32_L2","offset":16,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"THDA_32_L3","offset":20,"length":1,"offsetbit":0,"scale":"1","mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"output","multipleResult":false,"fanOutMultipleResult":false,"setTopic":true,"outputs":1,"x":570,"y":420,"wires":[["249147b.1d31cb8"]]},{"id":"ad315052.ff68a","type":"buffer-parser","z":"89e2edc2.2ff858","name":"Group3","data":"responseBuffer.buffer","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"floatbe","name":"EI_32_T","offset":0,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"EI_32_L1","offset":12,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"EI_32_L2","offset":16,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"EI_32_L3","offset":20,"length":1,"offsetbit":0,"scale":"1","mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"output","multipleResult":false,"fanOutMultipleResult":false,"setTopic":true,"outputs":1,"x":570,"y":480,"wires":[["249147b.1d31cb8"]]},{"id":"c52f0cd1.308308","type":"buffer-parser","z":"89e2edc2.2ff858","name":"Group1","data":"responseBuffer.buffer","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"floatbe","name":"V_33_L1","offset":0,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"V_33_L2","offset":4,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"V_33_L3","offset":8,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"A_33_L1","offset":24,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"A_33_L2","offset":28,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"A_33_L3","offset":32,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"P_33_L1","offset":36,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"P_33_L2","offset":40,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"P_33_L3","offset":44,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"P_33_T","offset":48,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"S_33_T","offset":64,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"Q_33_T","offset":80,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"PF_33_L1","offset":84,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"PF_33_L2","offset":88,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"PF_33_L3","offset":92,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"F_33_L1","offset":100,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"F_33_L2","offset":104,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"F_33_L3","offset":108,"length":1,"offsetbit":0,"scale":"1","mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"output","multipleResult":false,"fanOutMultipleResult":false,"setTopic":true,"outputs":1,"x":570,"y":600,"wires":[["249147b.1d31cb8"]]},{"id":"605cc4f9.0ee4f4","type":"buffer-parser","z":"89e2edc2.2ff858","name":"Group2","data":"responseBuffer.buffer","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"floatbe","name":"THDV_33_L1","offset":0,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"THDV_33_L2","offset":4,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"THDV_33_L3","offset":8,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"THDA_33_L1","offset":12,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"THDA_33_L2","offset":16,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"THDA_33_L3","offset":20,"length":1,"offsetbit":0,"scale":"1","mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"output","multipleResult":false,"fanOutMultipleResult":false,"setTopic":true,"outputs":1,"x":570,"y":660,"wires":[["249147b.1d31cb8"]]},{"id":"329e1be2.2b1234","type":"buffer-parser","z":"89e2edc2.2ff858","name":"Group3","data":"responseBuffer.buffer","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"floatbe","name":"EI_33_T","offset":0,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"EI_33_L1","offset":12,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"EI_33_L2","offset":16,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"EI_33_L3","offset":20,"length":1,"offsetbit":0,"scale":"1","mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"output","multipleResult":false,"fanOutMultipleResult":false,"setTopic":true,"outputs":1,"x":570,"y":740,"wires":[["249147b.1d31cb8"]]},{"id":"4e1757c2.34e64","type":"buffer-parser","z":"89e2edc2.2ff858","name":"Group1","data":"responseBuffer.buffer","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"floatbe","name":"V_34_L1","offset":0,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"V_34_L2","offset":4,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"V_34_L3","offset":8,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"A_34_L1","offset":24,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"A_34_L2","offset":28,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"A_34_L3","offset":32,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"P_34_L1","offset":36,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"P_34_L2","offset":40,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"P_34_L3","offset":44,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"P_34_T","offset":48,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"S_34_T","offset":64,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"Q_34_T","offset":80,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"PF_34_L1","offset":84,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"PF_34_L2","offset":88,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"PF_34_L3","offset":92,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"F_34_L1","offset":100,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"F_34_L2","offset":104,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"F_34_L3","offset":108,"length":1,"offsetbit":0,"scale":"1","mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"output","multipleResult":false,"fanOutMultipleResult":false,"setTopic":true,"outputs":1,"x":570,"y":860,"wires":[["249147b.1d31cb8"]]},{"id":"4c887dc9.dc973c","type":"buffer-parser","z":"89e2edc2.2ff858","name":"Group2","data":"responseBuffer.buffer","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"floatbe","name":"THDV_34_L1","offset":0,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"THDV_34_L2","offset":4,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"THDV_34_L3","offset":8,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"THDA_34_L1","offset":12,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"THDA_34_L2","offset":16,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"THDA_34_L3","offset":20,"length":1,"offsetbit":0,"scale":"1","mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"output","multipleResult":false,"fanOutMultipleResult":false,"setTopic":true,"outputs":1,"x":570,"y":920,"wires":[["249147b.1d31cb8"]]},{"id":"1b9659be.7ba1ce","type":"buffer-parser","z":"89e2edc2.2ff858","name":"Group3","data":"responseBuffer.buffer","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"floatbe","name":"EI_34_T","offset":0,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"EI_34_L1","offset":12,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"EI_34_L2","offset":16,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"EI_34_L3","offset":20,"length":1,"offsetbit":0,"scale":"1","mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"output","multipleResult":false,"fanOutMultipleResult":false,"setTopic":true,"outputs":1,"x":570,"y":1000,"wires":[["249147b.1d31cb8"]]},{"id":"a0f5e338.d2e648","type":"buffer-parser","z":"89e2edc2.2ff858","name":"Group1","data":"responseBuffer.buffer","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"floatbe","name":"V_35_L1","offset":0,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"V_35_L2","offset":4,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"V_35_L3","offset":8,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"A_35_L1","offset":24,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"A_35_L2","offset":28,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"A_35_L3","offset":32,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"P_35_L1","offset":36,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"P_35_L2","offset":40,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"P_35_L3","offset":44,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"P_35_T","offset":48,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"S_35_T","offset":64,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"Q_35_T","offset":80,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"PF_35_L1","offset":84,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"PF_35_L2","offset":88,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"PF_35_L3","offset":92,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"F_35_L1","offset":100,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"F_35_L2","offset":104,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"F_35_L3","offset":108,"length":1,"offsetbit":0,"scale":"1","mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"output","multipleResult":false,"fanOutMultipleResult":false,"setTopic":true,"outputs":1,"x":570,"y":1120,"wires":[["249147b.1d31cb8"]]},{"id":"a496298f.d24928","type":"buffer-parser","z":"89e2edc2.2ff858","name":"Group2","data":"responseBuffer.buffer","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"floatbe","name":"THDV_35_L1","offset":0,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"THDV_35_L2","offset":4,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"THDV_35_L3","offset":8,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"THDA_35_L1","offset":12,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"THDA_35_L2","offset":16,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"THDA_35_L3","offset":20,"length":1,"offsetbit":0,"scale":"1","mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"output","multipleResult":false,"fanOutMultipleResult":false,"setTopic":true,"outputs":1,"x":570,"y":1180,"wires":[["249147b.1d31cb8"]]},{"id":"d8644f57.fd0618","type":"buffer-parser","z":"89e2edc2.2ff858","name":"Group3","data":"responseBuffer.buffer","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"floatbe","name":"EI_35_T","offset":0,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"EI_35_L1","offset":12,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"EI_35_L2","offset":16,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"EI_35_L3","offset":20,"length":1,"offsetbit":0,"scale":"1","mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"output","multipleResult":false,"fanOutMultipleResult":false,"setTopic":true,"outputs":1,"x":570,"y":1260,"wires":[["249147b.1d31cb8"]]},{"id":"eca16e8e.c04dc8","type":"buffer-parser","z":"89e2edc2.2ff858","name":"Group1","data":"responseBuffer.buffer","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"floatbe","name":"V_36_L1","offset":0,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"V_36_L2","offset":4,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"V_36_L3","offset":8,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"A_36_L1","offset":24,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"A_36_L2","offset":28,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"A_36_L3","offset":32,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"P_36_L1","offset":36,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"P_36_L2","offset":40,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"P_36_L3","offset":44,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"P_36_T","offset":48,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"S_36_T","offset":64,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"Q_36_T","offset":80,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"PF_36_L1","offset":84,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"PF_36_L2","offset":88,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"PF_36_L3","offset":92,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"F_36_L1","offset":100,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"F_36_L2","offset":104,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"F_36_L3","offset":108,"length":1,"offsetbit":0,"scale":"1","mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"output","multipleResult":false,"fanOutMultipleResult":false,"setTopic":true,"outputs":1,"x":570,"y":1360,"wires":[["249147b.1d31cb8"]]},{"id":"b08a7e0c.ac8cf","type":"buffer-parser","z":"89e2edc2.2ff858","name":"Group2","data":"responseBuffer.buffer","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"floatbe","name":"THDV_36_L1","offset":0,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"THDV_36_L2","offset":4,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"THDV_36_L3","offset":8,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"THDA_36_L1","offset":12,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"THDA_36_L2","offset":16,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"THDA_36_L3","offset":20,"length":1,"offsetbit":0,"scale":"1","mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"output","multipleResult":false,"fanOutMultipleResult":false,"setTopic":true,"outputs":1,"x":570,"y":1420,"wires":[["249147b.1d31cb8"]]},{"id":"7ee667ea.2f2a98","type":"buffer-parser","z":"89e2edc2.2ff858","name":"Group3","data":"responseBuffer.buffer","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"floatbe","name":"EI_36_T","offset":0,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"EI_36_L1","offset":12,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"EI_36_L2","offset":16,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"floatbe","name":"EI_36_L3","offset":20,"length":1,"offsetbit":0,"scale":"1","mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"output","multipleResult":false,"fanOutMultipleResult":false,"setTopic":true,"outputs":1,"x":570,"y":1500,"wires":[["249147b.1d31cb8"]]},{"id":"cfadb312.4b1608","type":"inject","z":"89e2edc2.2ff858","d":true,"name":"free space","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"00 12 * * 0","once":false,"onceDelay":0.1,"topic":"","payloadType":"date","x":230,"y":4500,"wires":[["c099a47b.f6a148"]]},{"id":"c099a47b.f6a148","type":"exec","z":"89e2edc2.2ff858","command":"df -h / --output=avail","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"free space","x":410,"y":4480,"wires":[["db129000.c5b5e"],[],[]]},{"id":"691b041a.2dabc4","type":"debug","z":"89e2edc2.2ff858","name":"","active":false,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload[0].col14","statusType":"auto","x":770,"y":4460,"wires":[]},{"id":"db129000.c5b5e","type":"function","z":"89e2edc2.2ff858","name":"","func":"let freeSpace = msg.payload.split(\"\\n\")[1].trim() + \"b\"\n\nglobal.set(\"Status.freeSpace\", freeSpace)\n\nmsg.payload = freeSpace\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":600,"y":4460,"wires":[["691b041a.2dabc4"]]},{"id":"7109c409.85dd4c","type":"function","z":"89e2edc2.2ff858","name":"Daily Frequency","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":366,"y":3279,"wires":[["b365028.1ee748"]]},{"id":"96cba27b.cbbfc8","type":"comment","z":"89e2edc2.2ff858","name":"Daily Frequency","info":"","x":366,"y":3219,"wires":[]},{"id":"38c7346f.c5bd74","type":"link out","z":"89e2edc2.2ff858","name":"from sql","links":["8448e455.51aa1"],"x":1181,"y":3199,"wires":[]},{"id":"e8b53ab3.6f5a3","type":"change","z":"89e2edc2.2ff858","name":"chartData","rules":[{"t":"set","p":"cmd","pt":"msg","to":"chartFrequency","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.F_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.F_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.F_31_L3],\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.F_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.F_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.F_32_L3],\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.F_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.F_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.F_33_L3],\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.F_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.F_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.F_34_L3],\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.F_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.F_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.F_35_L3],\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.F_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.F_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.F_36_L3],\t 'fill': false,\t \"hidden\": false\t }\t */\t ]\t}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1066,"y":3199,"wires":[["38c7346f.c5bd74"]]},{"id":"ca7db40f.95de48","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":3279,"wires":[["139e1229.b548de"],["d2afe165.4d3b88"]]},{"id":"139e1229.b548de","type":"switch","z":"89e2edc2.2ff858","name":"","property":"cmd","propertyType":"msg","rules":[{"t":"eq","v":"chartFrequency","vt":"str"},{"t":"eq","v":"csvFrequency","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":916,"y":3239,"wires":[["e8b53ab3.6f5a3"],["2e54eadc.b27ac6"]]},{"id":"50e3605c.70da58","type":"link out","z":"89e2edc2.2ff858","name":"data for CSV","links":["424e4ca9.28a51c"],"x":1181,"y":3279,"wires":[]},{"id":"d2afe165.4d3b88","type":"link out","z":"89e2edc2.2ff858","name":"from sql","links":["8448e455.51aa1"],"x":821,"y":3299,"wires":[]},{"id":"2e54eadc.b27ac6","type":"change","z":"89e2edc2.2ff858","name":"csvData","rules":[{"t":"set","p":"payload","pt":"msg","to":"$append(\t [],\t payload.{\t \"dt\": dt,\t \t \"Meter A L1\" : F_31_L1,\t \"Meter A L2\" : F_31_L2,\t \"Meter A L3\" : F_31_L3,\t \t \"Meter B L1\" : F_32_L1,\t \"Meter B L2\" : F_32_L2,\t \"Meter B L3\" : F_32_L3,\t\t \"Meter C L1\" : F_33_L1,\t \"Meter C L2\" : F_33_L2,\t \"Meter C L3\" : F_33_L3\t /*,\t \t \"Heat Pump Hot Water 2 L1\" : F_34_L1,\t \"Heat Pump Hot Water 2 L2\" : F_34_L2,\t \"Heat Pump Hot Water 2 L3\" : F_34_L3,\t \t \"Heat Pump Cold Water 1 L1\" : F_35_L1,\t \"Heat Pump Cold Water 1 L2\" : F_35_L2,\t \"Heat Pump Cold Water 1 L3\" : F_35_L3,\t \t \"Heat Pump Cold Water 2 L1\" : F_36_L1,\t \"Heat Pump Cold Water 2 L2\" : F_36_L2,\t \"Heat Pump Cold Water 2 L3\" : F_36_L3\t */\t }\t)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1066,"y":3279,"wires":[["50e3605c.70da58"]]},{"id":"b365028.1ee748","type":"sqlite","z":"89e2edc2.2ff858","mydb":"26cd2be8.1dfacc","sqlquery":"msg.topic","sql":"","name":"Sqlite","x":556,"y":3279,"wires":[["ca7db40f.95de48"]]},{"id":"40776913.afd758","type":"function","z":"89e2edc2.2ff858","name":"Daily Current","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":3439,"wires":[["27e431c3.b7b2de"]]},{"id":"22c9b1f1.7250e6","type":"comment","z":"89e2edc2.2ff858","name":"Daily Current","info":"","x":356,"y":3379,"wires":[]},{"id":"4fb58145.cd55f","type":"link out","z":"89e2edc2.2ff858","name":"from sql","links":["8448e455.51aa1"],"x":1181,"y":3359,"wires":[]},{"id":"32ece02b.efc4d","type":"change","z":"89e2edc2.2ff858","name":"chartData","rules":[{"t":"set","p":"cmd","pt":"msg","to":"chartCurrent","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.A_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.A_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.A_31_L3],\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.A_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.A_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.A_32_L3],\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.A_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.A_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.A_33_L3],\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.A_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.A_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.A_34_L3],\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.A_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.A_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.A_35_L3],\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.A_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.A_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.A_36_L3],\t 'fill': false,\t \"hidden\": false\t }\t */\t ]\t}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1066,"y":3359,"wires":[["4fb58145.cd55f"]]},{"id":"430fad24.fcce6c","type":"function","z":"89e2edc2.2ff858","name":"No data filter","func":"\nif (msg.payload.length > 0) {\n\n return [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":"","libs":[],"x":696,"y":3439,"wires":[["5f1bec0.8eb2c94"],["4c5770c2.1e8118"]]},{"id":"5f1bec0.8eb2c94","type":"switch","z":"89e2edc2.2ff858","name":"","property":"cmd","propertyType":"msg","rules":[{"t":"eq","v":"chartCurrent","vt":"str"},{"t":"eq","v":"csvCurrent","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":916,"y":3399,"wires":[["32ece02b.efc4d"],["13317280.e05e36"]]},{"id":"31f3f9d0.744c06","type":"link out","z":"89e2edc2.2ff858","name":"data for CSV","links":["424e4ca9.28a51c"],"x":1181,"y":3439,"wires":[]},{"id":"4c5770c2.1e8118","type":"link out","z":"89e2edc2.2ff858","name":"from sql","links":["8448e455.51aa1"],"x":821,"y":3459,"wires":[]},{"id":"13317280.e05e36","type":"change","z":"89e2edc2.2ff858","name":"csvData","rules":[{"t":"set","p":"payload","pt":"msg","to":"$append(\t [],\t payload.{\t \"dt\": dt,\t \t \"Meter A L1\" : A_31_L1,\t \"Meter A L2\" : A_31_L2,\t \"Meter A L3\" : A_31_L3,\t \t \"Meter B L1\" : A_32_L1,\t \"Meter B L2\" : A_32_L2,\t \"Meter B L3\" : A_32_L3,\t \t \"Meter C L1\" : A_33_L1,\t \"Meter C L2\" : A_33_L2,\t \"Meter C L3\" : A_33_L3\t /*,\t \t \"Heat Pump Hot Water 2 L1\" : A_34_L1,\t \"Heat Pump Hot Water 2 L2\" : A_34_L2,\t \"Heat Pump Hot Water 2 L3\" : A_34_L3,\t \t \"Heat Pump Cold Water 1 L1\" : A_35_L1,\t \"Heat Pump Cold Water 1 L2\" : A_35_L2,\t \"Heat Pump Cold Water 1 L3\" : A_35_L3,\t \t \"Heat Pump Cold Water 2 L1\" : A_36_L1,\t \"Heat Pump Cold Water 2 L2\" : A_36_L2,\t \"Heat Pump Cold Water 2 L3\" : A_36_L3\t */\t }\t)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1066,"y":3439,"wires":[["31f3f9d0.744c06"]]},{"id":"27e431c3.b7b2de","type":"sqlite","z":"89e2edc2.2ff858","mydb":"26cd2be8.1dfacc","sqlquery":"msg.topic","sql":"","name":"Sqlite","x":556,"y":3439,"wires":[["430fad24.fcce6c"]]},{"id":"53e37469.d47a5c","type":"function","z":"89e2edc2.2ff858","name":"Daily Volts","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":3599,"wires":[["1f869171.906e3f"]]},{"id":"cc21c8ca.e37","type":"comment","z":"89e2edc2.2ff858","name":"Daily Volts","info":"","x":346,"y":3539,"wires":[]},{"id":"6c1f1ef8.5a3ef","type":"link out","z":"89e2edc2.2ff858","name":"from sql","links":["8448e455.51aa1"],"x":1181,"y":3519,"wires":[]},{"id":"81653039.8f03f8","type":"change","z":"89e2edc2.2ff858","name":"chartData","rules":[{"t":"set","p":"cmd","pt":"msg","to":"chartVolts","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.V_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.V_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.V_31_L3],\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.V_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.V_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.V_32_L3],\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.V_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.V_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.V_33_L3],\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.V_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.V_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.V_34_L3],\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.V_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.V_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.V_35_L3],\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.V_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.V_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.V_36_L3],\t 'fill': false,\t \"hidden\": false\t }\t */\t ]\t}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1066,"y":3519,"wires":[["6c1f1ef8.5a3ef"]]},{"id":"a3798020.f9453","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":3599,"wires":[["cecabf2a.6a9208"],["6e8bea.33b92c18"]]},{"id":"cecabf2a.6a9208","type":"switch","z":"89e2edc2.2ff858","name":"","property":"cmd","propertyType":"msg","rules":[{"t":"eq","v":"chartVolts","vt":"str"},{"t":"eq","v":"csvVolts","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":916,"y":3559,"wires":[["81653039.8f03f8"],["575f055e.efff54"]]},{"id":"782c5895.831f8","type":"link out","z":"89e2edc2.2ff858","name":"data for CSV","links":["424e4ca9.28a51c"],"x":1181,"y":3599,"wires":[]},{"id":"6e8bea.33b92c18","type":"link out","z":"89e2edc2.2ff858","name":"from sql","links":["8448e455.51aa1"],"x":821,"y":3619,"wires":[]},{"id":"575f055e.efff54","type":"change","z":"89e2edc2.2ff858","name":"csvData","rules":[{"t":"set","p":"payload","pt":"msg","to":"$append(\t [],\t payload.{\t \"dt\": dt,\t \t \"Meter A L1\" : V_31_L1,\t \"Meter A L2\" : V_31_L2,\t \"Meter A L3\" : V_31_L3,\t \t \"Meter B L1\" : V_32_L1,\t \"Meter B L2\" : V_32_L2,\t \"Meter B L3\" : V_32_L3,\t \t \"Meter C L1\" : V_33_L1,\t \"Meter C L2\" : V_33_L2,\t \"Meter C L3\" : V_33_L3\t /*,\t \t \"Heat Pump Hot Water 2 L1\" : V_34_L1,\t \"Heat Pump Hot Water 2 L2\" : V_34_L2,\t \"Heat Pump Hot Water 2 L3\" : V_34_L3,\t \t \"Heat Pump Cold Water 1 L1\" : V_35_L1,\t \"Heat Pump Cold Water 1 L2\" : V_35_L2,\t \"Heat Pump Cold Water 1 L3\" : V_35_L3,\t \t \"Heat Pump Cold Water 2 L1\" : V_36_L1,\t \"Heat Pump Cold Water 2 L2\" : V_36_L2,\t \"Heat Pump Cold Water 2 L3\" : V_36_L3\t */\t }\t)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1066,"y":3599,"wires":[["782c5895.831f8"]]},{"id":"1f869171.906e3f","type":"sqlite","z":"89e2edc2.2ff858","mydb":"26cd2be8.1dfacc","sqlquery":"msg.topic","sql":"","name":"Sqlite","x":556,"y":3599,"wires":[["a3798020.f9453"]]},{"id":"58258855.415ce","type":"function","z":"89e2edc2.2ff858","name":"Daily Powerfactor","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":376,"y":3759,"wires":[["d784ff38.fd0a88"]]},{"id":"ff22c1be.260928","type":"comment","z":"89e2edc2.2ff858","name":"Daily Powerfactor","info":"","x":366,"y":3699,"wires":[]},{"id":"50179bc0.175984","type":"link out","z":"89e2edc2.2ff858","name":"from sql","links":["8448e455.51aa1"],"x":1181,"y":3679,"wires":[]},{"id":"b3744c9b.6a934","type":"change","z":"89e2edc2.2ff858","name":"chartData","rules":[{"t":"set","p":"cmd","pt":"msg","to":"chartPowerfactor","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.PF_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.PF_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.PF_31_L3],\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.PF_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.PF_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.PF_32_L3],\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.PF_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.PF_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.PF_33_L3],\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.PF_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.PF_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.PF_34_L3],\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.PF_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.PF_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.PF_35_L3],\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.PF_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.PF_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.PF_36_L3],\t 'fill': false,\t \"hidden\": false\t }\t */\t ]\t}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1066,"y":3679,"wires":[["50179bc0.175984"]]},{"id":"53dba5d.899b65c","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":3759,"wires":[["daecf1b0.0b3778"],["a26718d5.f3a7e"]]},{"id":"daecf1b0.0b3778","type":"switch","z":"89e2edc2.2ff858","name":"","property":"cmd","propertyType":"msg","rules":[{"t":"eq","v":"chartPowerfactor","vt":"str"},{"t":"eq","v":"csvPowerfactor","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":916,"y":3719,"wires":[["b3744c9b.6a934"],["f10714a.0fc55e8"]]},{"id":"a332d85f.1f64c8","type":"link out","z":"89e2edc2.2ff858","name":"data for CSV","links":["424e4ca9.28a51c"],"x":1181,"y":3759,"wires":[]},{"id":"a26718d5.f3a7e","type":"link out","z":"89e2edc2.2ff858","name":"from sql","links":["8448e455.51aa1"],"x":821,"y":3779,"wires":[]},{"id":"f10714a.0fc55e8","type":"change","z":"89e2edc2.2ff858","name":"csvData","rules":[{"t":"set","p":"payload","pt":"msg","to":"$append(\t [],\t payload.{\t \"dt\": dt,\t \t \"Meter A L1\" : PF_31_L1,\t \"Meter A L2\" : PF_31_L2,\t \"Meter A L3\" : PF_31_L3,\t \t \"Meter B L1\" : PF_32_L1,\t \"Meter B L2\" : PF_32_L2,\t \"Meter B L3\" : PF_32_L3,\t\t \"Meter C L1\" : PF_33_L1,\t \"Meter C L2\" : PF_33_L2,\t \"Meter C L3\" : PF_33_L3\t /*,\t \t \"Heat Pump Hot Water 2 L1\" : PF_34_L1,\t \"Heat Pump Hot Water 2 L2\" : PF_34_L2,\t \"Heat Pump Hot Water 2 L3\" : PF_34_L3,\t \t \"Heat Pump Cold Water 1 L1\" : PF_35_L1,\t \"Heat Pump Cold Water 1 L2\" : PF_35_L2,\t \"Heat Pump Cold Water 1 L3\" : PF_35_L3,\t \t \"Heat Pump Cold Water 2 L1\" : PF_36_L1,\t \"Heat Pump Cold Water 2 L2\" : PF_36_L2,\t \"Heat Pump Cold Water 2 L3\" : PF_36_L3\t */\t }\t)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1066,"y":3759,"wires":[["a332d85f.1f64c8"]]},{"id":"d784ff38.fd0a88","type":"sqlite","z":"89e2edc2.2ff858","mydb":"26cd2be8.1dfacc","sqlquery":"msg.topic","sql":"","name":"Sqlite","x":556,"y":3759,"wires":[["53dba5d.899b65c"]]},{"id":"ee9c5824.dedc6","type":"function","z":"89e2edc2.2ff858","name":"Daily Harmonics V","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 dt, THDV_31_L1, THDV_31_L2, THDV_31_L3, THDV_32_L1, THDV_32_L2, THDV_32_L3, THDV_33_L1, THDV_33_L2, THDV_33_L3, THDV_34_L1, THDV_34_L2, THDV_34_L3, THDV_35_L1, THDV_35_L2, THDV_35_L3, THDV_36_L1, THDV_36_L2, THDV_36_L3 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":376,"y":3919,"wires":[["b5b2c59f.de34f"]]},{"id":"33ebe651.f090da","type":"comment","z":"89e2edc2.2ff858","name":"Daily Harmonics Voltage","info":"","x":396,"y":3859,"wires":[]},{"id":"58e8c531.b9741c","type":"link out","z":"89e2edc2.2ff858","name":"from sql","links":["8448e455.51aa1"],"x":1181,"y":3839,"wires":[]},{"id":"ce57b177.146ca","type":"change","z":"89e2edc2.2ff858","name":"chartData","rules":[{"t":"set","p":"cmd","pt":"msg","to":"chartHarmonicsVoltage","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.THDV_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.THDV_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.THDV_31_L3],\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.THDV_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.THDV_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.THDV_32_L3],\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.THDV_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.THDV_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.THDV_33_L3],\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.THDV_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.THDV_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.THDV_34_L3],\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.THDV_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.THDV_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.THDV_35_L3],\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.THDV_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.THDV_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.THDV_36_L3],\t 'fill': false,\t \"hidden\": false\t }\t */\t ]\t}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1066,"y":3839,"wires":[["58e8c531.b9741c"]]},{"id":"fc101a00.039fa8","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":3919,"wires":[["6b2b250f.df26d4"],["7b10f5e4.f96d34"]]},{"id":"6b2b250f.df26d4","type":"switch","z":"89e2edc2.2ff858","name":"","property":"cmd","propertyType":"msg","rules":[{"t":"eq","v":"chartHarmonicsVoltage","vt":"str"},{"t":"eq","v":"csvHarmonicsVoltage","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":916,"y":3879,"wires":[["ce57b177.146ca"],["1ec30138.1769a7"]]},{"id":"6dd385dc.b29614","type":"link out","z":"89e2edc2.2ff858","name":"data for CSV","links":["424e4ca9.28a51c"],"x":1181,"y":3919,"wires":[]},{"id":"7b10f5e4.f96d34","type":"link out","z":"89e2edc2.2ff858","name":"from sql","links":["8448e455.51aa1"],"x":821,"y":3939,"wires":[]},{"id":"1ec30138.1769a7","type":"change","z":"89e2edc2.2ff858","name":"csvData","rules":[{"t":"set","p":"payload","pt":"msg","to":"$append(\t [],\t payload.{\t \"dt\": dt,\t \t \"Meter A L1\" : THDV_31_L1,\t \"Meter A L2\" : THDV_31_L2,\t \"Meter A L3\" : THDV_31_L3,\t \t \"Meter B L1\" : THDV_32_L1,\t \"Meter B L2\" : THDV_32_L2,\t \"Meter B L3\" : THDV_32_L3,\t\t \"Meter C L1\" : THDV_33_L1,\t \"Meter C L2\" : THDV_33_L2,\t \"Meter C L3\" : THDV_33_L3\t /*,\t \t \"Heat Pump Hot Water 2 L1\" : THDV_34_L1,\t \"Heat Pump Hot Water 2 L2\" : THDV_34_L2,\t \"Heat Pump Hot Water 2 L3\" : THDV_34_L3,\t \t \"Heat Pump Cold Water 1 L1\" : THDV_35_L1,\t \"Heat Pump Cold Water 1 L2\" : THDV_35_L2,\t \"Heat Pump Cold Water 1 L3\" : THDV_35_L3,\t \t \"Heat Pump Cold Water 2 L1\" : THDV_36_L1,\t \"Heat Pump Cold Water 2 L2\" : THDV_36_L2,\t \"Heat Pump Cold Water 2 L3\" : THDV_36_L3\t */\t }\t)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1066,"y":3919,"wires":[["6dd385dc.b29614"]]},{"id":"b5b2c59f.de34f","type":"sqlite","z":"89e2edc2.2ff858","mydb":"26cd2be8.1dfacc","sqlquery":"msg.topic","sql":"","name":"Sqlite","x":556,"y":3919,"wires":[["fc101a00.039fa8"]]},{"id":"24bc3e8e.b7d1ca","type":"function","z":"89e2edc2.2ff858","name":"Daily Harmonics A","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 dt, THDA_31_L1, THDA_31_L2, THDA_31_L3, THDA_32_L1, THDA_32_L2, THDA_32_L3, THDA_33_L1, THDA_33_L2, THDA_33_L3, THDA_34_L1, THDA_34_L2, THDA_34_L3, THDA_35_L1, THDA_35_L2, THDA_35_L3, THDA_36_L1, THDA_36_L2, THDA_36_L3 \nFROM ${table} WHERE datetime(dt) BETWEEN datetime('${startDate}') AND datetime('${endDate}')`\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[{"var":"moment","module":"moment"}],"x":376,"y":4059,"wires":[["f4f476e1.f5e7c8"]]},{"id":"623687b5.ba1f58","type":"comment","z":"89e2edc2.2ff858","name":"Daily Harmonics Current","info":"","x":396,"y":3999,"wires":[]},{"id":"b3d38554.25a6c8","type":"link out","z":"89e2edc2.2ff858","name":"from sql","links":["8448e455.51aa1"],"x":1181,"y":3979,"wires":[]},{"id":"2dab4162.5df45e","type":"change","z":"89e2edc2.2ff858","name":"chartData","rules":[{"t":"set","p":"cmd","pt":"msg","to":"chartHarmonicsCurrent","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.THDA_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.THDA_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.THDA_31_L3],\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.THDA_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.THDA_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.THDA_32_L3],\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.THDA_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.THDA_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.THDA_33_L3],\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.THDA_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.THDA_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.THDA_34_L3],\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.THDA_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.THDA_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.THDA_35_L3],\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.THDA_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.THDA_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.THDA_36_L3],\t 'fill': false,\t \"hidden\": false\t }\t */\t ]\t}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1066,"y":3979,"wires":[["b3d38554.25a6c8"]]},{"id":"2ed3f1e3.1dd56e","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":4059,"wires":[["b0050d0c.a12f88"],["57c9689f.80a8"]]},{"id":"b0050d0c.a12f88","type":"switch","z":"89e2edc2.2ff858","name":"","property":"cmd","propertyType":"msg","rules":[{"t":"eq","v":"chartHarmonicsCurrent","vt":"str"},{"t":"eq","v":"csvHarmonicsCurrent","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":916,"y":4019,"wires":[["2dab4162.5df45e"],["fc9258ed.2c2408"]]},{"id":"70b95811.66afe8","type":"link out","z":"89e2edc2.2ff858","name":"data for CSV","links":["424e4ca9.28a51c"],"x":1181,"y":4059,"wires":[]},{"id":"57c9689f.80a8","type":"link out","z":"89e2edc2.2ff858","name":"from sql","links":["8448e455.51aa1"],"x":821,"y":4079,"wires":[]},{"id":"fc9258ed.2c2408","type":"change","z":"89e2edc2.2ff858","name":"csvData","rules":[{"t":"set","p":"payload","pt":"msg","to":"$append(\t [],\t payload.{\t \"dt\": dt,\t \t \"Meter A L1\" : THDA_31_L1,\t \"Meter A L2\" : THDA_31_L2,\t \"Meter A L3\" : THDA_31_L3,\t \t \"Meter B L1\" : THDA_32_L1,\t \"Meter B L2\" : THDA_32_L2,\t \"Meter B L3\" : THDA_32_L3,\t \t \"Meter C L1\" : THDA_33_L1,\t \"Meter C L2\" : THDA_33_L2,\t \"Meter C L3\" : THDA_33_L3\t /*,\t \t \"Heat Pump Hot Water 2 L1\" : THDA_34_L1,\t \"Heat Pump Hot Water 2 L2\" : THDA_34_L2,\t \"Heat Pump Hot Water 2 L3\" : THDA_34_L3,\t \t \"Heat Pump Cold Water 1 L1\" : THDA_35_L1,\t \"Heat Pump Cold Water 1 L2\" : THDA_35_L2,\t \"Heat Pump Cold Water 1 L3\" : THDA_35_L3,\t \t \"Heat Pump Cold Water 2 L1\" : THDA_36_L1,\t \"Heat Pump Cold Water 2 L2\" : THDA_36_L2,\t \"Heat Pump Cold Water 2 L3\" : THDA_36_L3\t */\t }\t)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1066,"y":4059,"wires":[["70b95811.66afe8"]]},{"id":"f4f476e1.f5e7c8","type":"sqlite","z":"89e2edc2.2ff858","mydb":"26cd2be8.1dfacc","sqlquery":"msg.topic","sql":"","name":"Sqlite","x":556,"y":4059,"wires":[["2ed3f1e3.1dd56e"]]},{"id":"9007a77c.33c578","type":"inject","z":"89e2edc2.2ff858","d":true,"name":"free space","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payloadType":"date","x":230,"y":4460,"wires":[["c099a47b.f6a148"]]},{"id":"91e551de.95c41","type":"function","z":"89e2edc2.2ff858","name":"","func":"\nconst status = Object.values(global.get(\"Status\"));\n\nlet anyConnected = status.some(el => el === \"Connected\");\n\nif (anyConnected) {\n return msg\n}\nelse {\n return null\n}\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":255,"y":1940,"wires":[["1c22e49c.2eee1b","d73de77.1bac698","c2cbe6f2.91eb88","f92fd46e.6ee0f8","41fb8c1d.91dabc","def70402.898f08","ccb4d3fa.d4fa78"]],"l":false},{"id":"c6d958ad.ea6e1","type":"modbus-client","name":"","clienttype":"serial","bufferCommands":true,"stateLogEnabled":false,"queueLogEnabled":false,"tcpHost":"127.0.0.1","tcpPort":"502","tcpType":"DEFAULT","serialPort":"/dev/ttyUSB0","serialType":"RTU-BUFFERD","serialBaudrate":"38400","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","unit_id":31,"commandDelay":200,"clientTimeout":1000,"reconnectOnTimeout":true,"reconnectTimeout":2000,"parallelUnitIdsAllowed":false},{"id":"26cd2be8.1dfacc","type":"sqlitedb","db":"c:\\Users\\User\\.node-red\\EnergyMeters.db","mode":"RWC"}]
uibuilder Flow that links requests to and from the modbus flow
[{"id":"32293768.683cd8","type":"debug","z":"affcf244.5a4cd","name":"2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":590,"y":260,"wires":[]},{"id":"1df62ef8.d642e9","type":"link out","z":"affcf244.5a4cd","name":"from uibuilder","links":["68a4aec7.1924b8"],"x":555,"y":180,"wires":[]},{"id":"8448e455.51aa1","type":"link in","z":"affcf244.5a4cd","name":"to uibuilder","links":["5132a6b1.df3ab","69dbe4b3.af5694","96a4fa16.c820d8","5595f693.db8b6","1225d28c.64d165","ffda6487.1307","a6dc1db6.c9fdc8","594d389b.51528","6f9d9a76.996294","937b00f2.4d99b","adb86811.8eb1","27a0d31f.1bd6bc","38c7346f.c5bd74","d2afe165.4d3b88","4fb58145.cd55f","4c5770c2.1e8118","6c1f1ef8.5a3ef","6e8bea.33b92c18","50179bc0.175984","a26718d5.f3a7e","58e8c531.b9741c","7b10f5e4.f96d34","b3d38554.25a6c8","57c9689f.80a8"],"x":255,"y":180,"wires":[["a23f8a07.5c2d9"]]},{"id":"a23f8a07.5c2d9","type":"uibuilder","z":"affcf244.5a4cd","name":"","topic":"","url":"monitor","fwdInMessages":false,"allowScripts":false,"allowStyles":false,"copyIndex":false,"templateFolder":"blank","extTemplate":"","showfolder":false,"reload":false,"sourceFolder":"dist","deployedVersion":"5.0.0-dev","credentials":{},"x":400,"y":200,"wires":[["1df62ef8.d642e9","c2a2bdb2d5fdc055"],["32293768.683cd8"]]},{"id":"70f97297bd668907","type":"inject","z":"affcf244.5a4cd","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":220,"y":260,"wires":[["a23f8a07.5c2d9"]]},{"id":"c2a2bdb2d5fdc055","type":"debug","z":"affcf244.5a4cd","name":"1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":590,"y":120,"wires":[]}]
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
If you imported the second flow that i shared and Deployed, that would have created a folder under uibuilder folder called monitor
because
so all the files from the github Energy-Monitor repo should be extracted in there.
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.
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
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.
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 https://github.com/unborn-andy/uib-template-vue-navbar/issues/1#issuecomment-1140526113, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALR6FSM4VPBTBURY7OPDOKLVMPNGJANCNFSM5RFJ7DFQ. You are receiving this because you were mentioned.
parcel: not found
i know whats the problem .. in the Monitor project i had the parcel-bundler installed globally while in uib-template-vue-navbar i had Parcel bundler as a Dev dependancy
You can see this by comparing the two package.json files of the two projects
To solve this add "parcel-bundler": "^1.12.5",
to the devDependencies section of the Monitor app package.json and
run npm install
again
,
"devDependencies": {
"@vue/component-compiler-utils": "^3.2.2",
"cssnano": "^4.1.10",
"parcel-bundler": "^1.12.5",
"sass": "^1.32.5",
"vue-template-compiler": "^2.6.14"
}
ps. that project wasnt really intended for public view
Still no success. npm install runs ok, but npm run build fails.
odroid@Datadroid:~/.node-red/uibuilder/monitor$ npm run build
src@1.0.0 build parcel build ./src/index.html --public-url ./ --no-cache --out-dir ./dist/ --detailed-report error: unknown option `--detailed-report'
When I remove the option I get an error because parcel-bundler is deprecated?
i pushed some updates to the Monitor repository (which i hadn't touched for months) to match the more recent and updated navbar repo. that was compatible with uibuilder 5 Did a test build and it should be ok now if you re-download .. or make the changes manually.
Thanks for the updated version. I cleared up, removed the flow in Node Red and installed fresh this morning, but alas. Here is the output from the fresh install
The npm run build still fails. First with the unknown parcel-bundler option, after removing that from package.json with numerous errors (more of the same not in screenshot) and an empty dist-directory.
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";
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 https://github.com/unborn-andy/uib-template-vue-navbar/issues/1#issuecomment-1141978817, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALR6FSPLTK26XB3V7IFWYCDVMXVS5ANCNFSM5RFJ7DFQ. You are receiving this because you were mentioned.
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
Two questions.
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.
Then yes, it can be ignored. Are there any others ?
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 https://github.com/unborn-andy/uib-template-vue-navbar/issues/1#issuecomment-1143390077, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALR6FSP55QB3UEMFCCTYEJ3VM4XZHANCNFSM5RFJ7DFQ. 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.
sorry .. i dont see a screenshot with the errors attached in your post.
Ah, left out when you reply to a post in your mail program. Here they are
I have no idea what those errors mean .. i tried to look on the internet but with no conclusive results
Unfortunately, these errors are in the main .js file and the script fails. This is what my directory /monitor looks like. (I have no idee where the long names comes from)
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 the strange thing is on my Windows system it builds and the app runs without issues (and the hash tags are much shorter .. dont know if its OS dependent)
\dist
folder and build again--no-content-hash
Parcel script option
What that option does is Disable content hashing (no many details in the docs but worth trying)This was a steep learning curve, but now it works. Thanks for the advice. The --no-content-hash option was an unknown option. After comparing my working "navbar" to this project I went back to Parcel Builder 1.12.5. Npm run build throwed an error almost immediately: undefined: plugin is not a function. After some Google searches I found this: https://stackoverflow.com/questions/67069266/parcel-build-error-plugin-is-not-a-function I added the --no-minify option and got this working result. Also look at the difference in my /dist directory:
Thanks for the help. (And now the work starts for connecting the data sources) Below Package.json.
{
"name": "src",
"version": "1.0.0",
"description": "",
"main": "app.js",
"scripts": {
"dev": "parcel watch ./src/index.html --no-source-maps --public-url ./ --no-cache --out-dir ./dist/",
"build": "rm -rf ./dist/* && parcel build --no-minify ./src/index.html --public-url ./ --no-cache --out-dir ./dist/ --detailed-report"
},
"author": "",
"license": "ISC",
"dependencies": {
"bootstrap-vue": "^2.21.2",
"chart.js": "^2.9.4",
"moment": "^2.29.1",
"vue": "^2.6.14",
"vue-chartjs": "^3.5.1",
"vue-hot-reload-api": "^2.3.4",
"vue-router": "^3.5.2",
"vue2-datepicker": "^3.9.1"
},
"devDependencies": {
"@vue/component-compiler-utils": "^3.2.2",
"cssnano": "^5.1.10",
"parcel-bundler": "^1.12.5",
"sass": "^1.32.5",
"vue-template-compiler": "^2.6.14"
}
}
Wow .. you got it working :+1:
I went back to Parcel Builder 1.12.5
.. what version did you have .. the newer Parcel version 2 ? That wouldnt work since its more written for Vue 3 and that would explain the errors and because bootstrap-vue is still stuck with Vue 2 i had to use the original parcel-bundler Nice research with the stackoverflow article
Now you know why i thought of sharing a sh1tty little navbar header ;) .. that may not look like much .. but the months of studying to achieve that made me think its worth sharing
And now the work starts for connecting the data sources
Indeed thats gonna take a bit to modify. Let me know how it goes .. send me a private message on the Node-red forum
Wow .. you got it working 👍
I went back to Parcel Builder 1.12.5
.. what version did you have .. the newer Parcel version 2 ? That wouldnt work since its more written for Vue 3 and that would explain the errors and because bootstrap-vue is still stuck with Vue 2 i had to use the original parcel-bundler Nice research with the stackoverflow article
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.
Now you know why i thought of sharing a sh1tty little navbar header ;) .. that may not look like much .. but the months of studying to achieve that made me think its worth sharing
For now I find it very attractive, especially the interaction between dashboard and Node Red
And now the work starts for connecting the data sources
Indeed thats gonna take a bit to modify. Let me know how it goes .. send me a private message on the Node-red forum
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