Plotting in a chart

Hi everyone,

I'm making a script in which I want to process data in a chart. I've already read on the forum that if you want to plot something over a specific time base you should pass it in the form below.

However, I can't figure out how to do this. I would like to plot L1 over the corresponding time in this script.

Someone who can help me please? (If it is easier, L1 and L2 and L3 can be in 1 chart to)

this is how i tried to do it:

image

[{"id":"ad5f5108bd9a4703","type":"debug","z":"47e39c5606fd1f5d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1490,"y":20,"wires":[]},{"id":"52f9b3a010207d61","type":"http request","z":"47e39c5606fd1f5d","name":"Elektriciteitsverbruik","method":"GET","ret":"obj","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","authType":"","senderr":false,"x":1060,"y":100,"wires":[["dfab314e74299946","a4df6aa45a1ab3fe"]]},{"id":"dfab314e74299946","type":"function","z":"47e39c5606fd1f5d","name":"Spanning","func":"\n\n\nconst rotated = {\n    Tijd:[],\n    L1: [],\n    L2: [],\n    L3: [],\n\n}\n\n\nconst APIdata = msg.payload.consumptions;\nfor (var i = 0; i < APIdata.length; i++) {\n rotated.Tijd[i] = APIdata[i].timestamp\n rotated.L1[i] = APIdata[i].voltages[0]\n rotated.L2[i] = APIdata[i].voltages[1]\n rotated.L3[i] = APIdata[i].voltages[2]\n\n\nmsg.payload = rotated;\nvar msg0 = { payload: rotated.Tijd[i]};\nvar msg1 = { payload: rotated.L1[i]};\nvar msg2 = { payload: rotated.L2[i]};\nvar msg3 = { payload: rotated.L3[i]};\n\n}\nglobal.set('Spanningen',rotated)\nvar msg4 = { payload: \"De gegevens zijn ingeladen!\" };\n\n\nreturn [msg,msg0,msg1,msg2,msg3,msg4];\n\n\n","outputs":6,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1260,"y":100,"wires":[["ad5f5108bd9a4703"],[],["ef64ef40c027fc90"],["c49059aa6a161929"],["901d1af483acba53"],["e3c710df5b112bc6"]]},{"id":"ef64ef40c027fc90","type":"ui_chart","z":"47e39c5606fd1f5d","name":"","group":"b9fbdeb2691cbabc","order":1,"width":0,"height":0,"label":"Spanning L1","chartType":"line","legend":"false","xformat":"auto","interpolate":"linear","nodata":"","dot":true,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":1490,"y":80,"wires":[[]]},{"id":"e3c710df5b112bc6","type":"ui_toast","z":"47e39c5606fd1f5d","position":"top left","displayTime":"3","highlight":"","sendall":true,"outputs":0,"ok":"OK","cancel":"","raw":false,"className":"","topic":"","name":"","x":1510,"y":200,"wires":[]},{"id":"c49059aa6a161929","type":"ui_chart","z":"47e39c5606fd1f5d","name":"","group":"b9fbdeb2691cbabc","order":3,"width":0,"height":0,"label":"Spanning L2","chartType":"line","legend":"false","xformat":"auto","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":1490,"y":120,"wires":[[]]},{"id":"901d1af483acba53","type":"ui_chart","z":"47e39c5606fd1f5d","name":"","group":"b9fbdeb2691cbabc","order":5,"width":0,"height":0,"label":"Spanning L3","chartType":"line","legend":"false","xformat":"auto","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":1490,"y":160,"wires":[[]]},{"id":"a4df6aa45a1ab3fe","type":"debug","z":"47e39c5606fd1f5d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1270,"y":180,"wires":[]},{"id":"b9fbdeb2691cbabc","type":"ui_group","name":"Meetgegevens:","tab":"a67420ad81558175","order":2,"disp":true,"width":"6","collapse":false,"className":""},{"id":"a67420ad81558175","type":"ui_tab","name":"Spanning","icon":"dashboard","order":7,"disabled":false,"hidden":true}]

Below this picture youll find the outcomming data from this payload

image

{"serviceLocationId":59792,"consumptions":[{"timestamp":1643756400000,"consumption":35748.435,"solar":9275.865,"alwaysOn":7047.642,"gridImport":28772.671,"gridExport":2294.7,"selfConsumption":75.26,"selfSufficiency":19.51,"active":[14041.9,7428.8,5007.4,1885.8,2171.8,2133.7,3084.9,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"reactive":[-5319.4,71.2,-4817.3,1654.8,1648.7,1570.8,1058.2,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"voltages":[239.7,239.8,239.9],"phaseVoltages":[239.7,239.8,239.9],"currentHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],"voltageHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{"timestamp":1643842800000,"consumption":102286.026,"solar":5749.865,"alwaysOn":7027.204,"gridImport":96543.662,"gridExport":0,"selfConsumption":100,"selfSufficiency":5.61,"active":[30349.3,36055.6,30137.9,1100.6,1408.2,1361.5,1880.8,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"reactive":[-5356.8,-660.5,-5557.4,1813.1,1802.4,1717.3,1447,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"voltages":[240.3,240.1,240.4],"phaseVoltages":[240.3,240.1,240.4],"currentHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],"voltageHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{"timestamp":1643929200000,"consumption":22114.28,"solar":8538.567,"alwaysOn":7048.804,"gridImport":15357.514,"gridExport":1775.9,"selfConsumption":79.2,"selfSufficiency":30.55,"active":[10271.4,2790,520.7,1714.7,2014.4,1977.9,2831.5,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"reactive":[-5936.4,-305.4,-4983.5,1848.2,1838.4,1761.9,1420.5,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"voltages":[240.7,240.6,241.5],"phaseVoltages":[240.7,240.6,241.5],"currentHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],"voltageHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{"timestamp":1644015600000,"consumption":9328.966,"solar":22238.967,"alwaysOn":6803.979,"gridImport":6396.401,"gridExport":19299.7,"selfConsumption":13.22,"selfSufficiency":31.44,"active":[-1265.9,-2248.4,-9390.9,4707.4,5010.2,4983.3,7538.3,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"reactive":[-3591.2,603.1,-3735.8,1383.9,1365.9,1342.8,273.9,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"voltages":[240.9,241,242.3],"phaseVoltages":[240.9,241,242.3],"currentHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],"voltageHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{"timestamp":1644102000000,"consumption":8163.497,"solar":7667.664,"alwaysOn":6624.003,"gridImport":6509.234,"gridExport":6008.5,"selfConsumption":21.64,"selfSufficiency":20.26,"active":[1366.1,666.2,-1529.6,1503.7,1814.8,1773.9,2575.3,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"reactive":[-3904.3,-8.4,-4398.2,1694.1,1685.6,1600.8,1182.1,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"voltages":[241.7,241.5,242.8],"phaseVoltages":[241.7,241.5,242.8],"currentHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],"voltageHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{"timestamp":1644188400000,"consumption":48208.342,"solar":26604.468,"alwaysOn":6595.226,"gridImport":37612.875,"gridExport":16005.9,"selfConsumption":39.84,"selfSufficiency":21.98,"active":[9992.6,10138.9,1475.2,5640.9,5978.9,5920.9,9063.8,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"reactive":[-3737.2,1481,-3280.2,1387.7,1371.3,1327.4,504.8,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"voltages":[240.6,240.5,241.4],"phaseVoltages":[240.6,240.5,241.4],"currentHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],"voltageHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{"timestamp":1644274800000,"consumption":26531.901,"solar":9259.367,"alwaysOn":6656.426,"gridImport":20559.835,"gridExport":3281.5,"selfConsumption":64.56,"selfSufficiency":22.51,"active":[10349.4,4537.5,2390.9,1861.4,2181.3,2135.3,3081.8,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"reactive":[-6009.3,-197.1,-5033.4,1774.7,1771,1670.6,1389.9,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"voltages":[240.2,240.7,241.1],"phaseVoltages":[240.2,240.7,241.1],"currentHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],"voltageHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{"timestamp":1644361200000,"consumption":29412.634,"solar":14275.364,"alwaysOn":6981.616,"gridImport":18733.371,"gridExport":3591.6,"selfConsumption":74.84,"selfSufficiency":36.31,"active":[9967.5,4020.6,1154.1,2953.3,3274.1,3224.5,4824.3,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"reactive":[-5921,-71.7,-4664.9,1627,1633.4,1556.6,787.2,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"voltages":[240.5,241.1,241.5],"phaseVoltages":[240.5,241.1,241.5],"currentHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],"voltageHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{"timestamp":1644447600000,"consumption":68395.546,"solar":9538.468,"alwaysOn":8050.78,"gridImport":59079.079,"gridExport":228.1,"selfConsumption":97.61,"selfSufficiency":13.62,"active":[21834.4,19303.2,17715.2,1949.1,2236.4,2191.7,3178.1,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"reactive":[-5514.3,306.9,-5133.9,1668.3,1661.1,1591,986.1,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"voltages":[240.7,241,241.2],"phaseVoltages":[240.7,241,241.2],"currentHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],"voltageHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{"timestamp":1644534000000,"consumption":34328.291,"solar":28989.736,"alwaysOn":8841.598,"gridImport":20976.056,"gridExport":15638,"selfConsumption":46.06,"selfSufficiency":38.9,"active":[10036.8,1536.5,-6234.9,6180.3,6522.8,6479.7,9815.2,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"reactive":[-5643.5,871.4,-2463.6,1506.3,1492.2,1435.8,993.6,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"voltages":[240.4,240.6,241.2],"phaseVoltages":[240.4,240.6,241.2],"currentHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],"voltageHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{"timestamp":1644620400000,"consumption":26999.4,"solar":30103.068,"alwaysOn":7927.171,"gridImport":13951.034,"gridExport":17048.8,"selfConsumption":43.37,"selfSufficiency":48.33,"active":[2737,1520.4,-7353.2,6426.3,6742.8,6706,10227.2,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"reactive":[-4061.3,-171.8,-3164.7,1337.5,1307.8,1271.4,129.8,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"voltages":[240.9,241.3,242.2],"phaseVoltages":[240.9,241.3,242.2],"currentHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],"voltageHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{"timestamp":1644706800000,"consumption":9194.886,"solar":21581.264,"alwaysOn":7660.781,"gridImport":6164.223,"gridExport":18545.4,"selfConsumption":14.07,"selfSufficiency":32.96,"active":[-1616,-2426.4,-8338.9,4570.4,4877.9,4839.7,7292.9,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"reactive":[-3403.6,570.3,-2424.1,1439.9,1428.1,1405.1,167.9,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"voltages":[241.6,242,242.9],"phaseVoltages":[241.6,242,242.9],"currentHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],"voltageHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{"timestamp":1644793200000,"consumption":69640.101,"solar":21507.063,"alwaysOn":7627.156,"gridImport":55617.239,"gridExport":7477.9,"selfConsumption":65.23,"selfSufficiency":20.14,"active":[23400.5,15441.5,9296.4,4530.7,4856.8,4808.5,7310.9,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"reactive":[-5792.9,1163.4,-2993.1,1583,1584.8,1472.6,842.6,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"voltages":[239.9,240.4,240.9],"phaseVoltages":[239.9,240.4,240.9],"currentHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],"voltageHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{"timestamp":1644879600000,"consumption":36244.027,"solar":19223.561,"alwaysOn":7516.771,"gridImport":25542.367,"gridExport":8514.9,"selfConsumption":55.71,"selfSufficiency":29.53,"active":[13930.8,4728.1,-1630.8,4051.4,4372.2,4327.2,6473.3,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"reactive":[-6001,516.4,-3231.5,1587.4,1593.2,1523.2,1000.2,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"voltages":[239.5,239.8,240],"phaseVoltages":[239.5,239.8,240],"currentHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],"voltageHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{"timestamp":1644966000000,"consumption":85259.102,"solar":10836.264,"alwaysOn":7372.671,"gridImport":74806.539,"gridExport":380.3,"selfConsumption":96.49,"selfSufficiency":12.26,"active":[31887,24016.5,18523.7,2223.7,2513.3,2477,3624.6,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"reactive":[-6358.2,453,-3835.7,1689.3,1687.6,1630.3,1034.4,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"voltages":[239.4,239.3,240],"phaseVoltages":[239.4,239.3,240],"currentHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],"voltageHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{"timestamp":1645052400000,"consumption":62707.468,"solar":25522.268,"alwaysOn":6940.758,"gridImport":43515.601,"gridExport":6326.7,"selfConsumption":75.21,"selfSufficiency":30.61,"active":[17523.8,13335.1,6330.2,5414.1,5753.9,5699.1,8655.6,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"reactive":[-4828.9,781.1,-2753.5,1456.2,1472.7,1148.8,673.4,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"voltages":[238.2,238.1,238.9],"phaseVoltages":[238.2,238.1,238.9],"currentHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],"voltageHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{"timestamp":1645138800000,"consumption":42588.795,"solar":14926.665,"alwaysOn":6887.958,"gridImport":36598.53,"gridExport":8931.3,"selfConsumption":40.17,"selfSufficiency":14.07,"active":[13909,8941.7,4817.1,3073.6,3391.4,3339.7,5121.7,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"reactive":[-4797.4,-31,-3497.5,1636.7,1618.7,1507.8,670.5,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"voltages":[237.5,237.4,237.9],"phaseVoltages":[237.5,237.4,237.9],"currentHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],"voltageHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{"timestamp":1645225200000,"consumption":9367.212,"solar":21046.866,"alwaysOn":6609.45,"gridImport":6243.547,"gridExport":17918.3,"selfConsumption":14.86,"selfSufficiency":33.35,"active":[-988.3,-1914.2,-8770.6,4470.8,4760.1,4726.8,7089.2,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"reactive":[-3363.3,436.8,-2473.5,1452.6,1427,1336.2,485.3,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"voltages":[238.9,238.6,239.8],"phaseVoltages":[238.9,238.6,239.8],"currentHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],"voltageHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{"timestamp":1645311600000,"consumption":8600.461,"solar":5637.565,"alwaysOn":6480.023,"gridImport":6292.597,"gridExport":3325.8,"selfConsumption":41.01,"selfSufficiency":26.83,"active":[1919,1289.5,-242.4,1088.8,1378,1340.2,1830.7,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"reactive":[-3809,-347.1,-3803.8,1862.2,1831.8,1774.1,1138.8,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"voltages":[240.3,240.2,241.4],"phaseVoltages":[240.3,240.2,241.4],"currentHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],"voltageHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{"timestamp":1645398000000,"consumption":45459.602,"solar":11135.369,"alwaysOn":6498.023,"gridImport":34828.834,"gridExport":498.8,"selfConsumption":95.52,"selfSufficiency":23.39,"active":[16297,10835,7198.5,2267.5,2572.7,2534.2,3762.1,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"reactive":[-5844.2,-246.3,-3733,1854.6,1855,1778.7,1070.7,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"voltages":[238.9,238.4,239.7],"phaseVoltages":[238.9,238.4,239.7],"currentHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],"voltageHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{"timestamp":1645484400000,"consumption":60092.049,"solar":13202.869,"alwaysOn":6560.353,"gridImport":47294.881,"gridExport":401.3,"selfConsumption":96.96,"selfSufficiency":21.3,"active":[19049.5,16070.8,11774.3,2740.5,3033.9,2998.2,4429.6,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"reactive":[-5556.1,263.8,-3964.4,1614.4,1617.2,1554.9,433.5,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"voltages":[237.8,237.8,238.8],"phaseVoltages":[237.8,237.8,238.8],"currentHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],"voltageHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{"timestamp":1645570800000,"consumption":56437.499,"solar":32457.067,"alwaysOn":6595.189,"gridImport":38616.332,"gridExport":14631.3,"selfConsumption":54.92,"selfSufficiency":31.58,"active":[14769.2,10071,-854.8,6940.3,7286.3,7237.9,10992.6,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"reactive":[-5485.6,876,-3095.2,1410.5,1416.8,1059.4,456.1,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"voltages":[238.5,238.9,239.4],"phaseVoltages":[238.5,238.9,239.4],"currentHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],"voltageHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{"timestamp":1645657200000,"consumption":97661.618,"solar":20035.166,"alwaysOn":6638.389,"gridImport":79845.853,"gridExport":2214.6,"selfConsumption":88.95,"selfSufficiency":18.24,"active":[30463.9,27221.6,19946.9,4208.3,4540.4,4496.8,6789.1,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"reactive":[-5419.8,722.8,-3736.4,1591,1598.6,1515.5,596,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"voltages":[238.5,238.9,239.4],"phaseVoltages":[238.5,238.9,239.4],"currentHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],"voltageHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{"timestamp":1645743600000,"consumption":30621.484,"solar":28097.468,"alwaysOn":6780.001,"gridImport":13514.217,"gridExport":10984.9,"selfConsumption":60.9,"selfSufficiency":55.87,"active":[6081.4,3235.1,-6786.9,5965.6,6307.4,6258.3,9567.8,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"reactive":[-5472.9,285.6,-4076.7,1594.4,1595.6,1342.4,657.3,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"voltages":[238.5,238.8,239.4],"phaseVoltages":[238.5,238.8,239.4],"currentHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],"voltageHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{"timestamp":1645830000000,"consumption":24344.755,"solar":40177.364,"alwaysOn":6526.662,"gridImport":9954.492,"gridExport":25782.4,"selfConsumption":35.83,"selfSufficiency":59.11,"active":[104.8,-1107.2,-14824.6,8601.3,8946,8909.8,13721.4,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"reactive":[-3498,1291,-1251.2,1367.8,1345.7,1053.3,230.6,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"voltages":[241.2,241.6,242.6],"phaseVoltages":[241.2,241.6,242.6],"currentHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],"voltageHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{"timestamp":1645916400000,"consumption":38663.772,"solar":42488.861,"alwaysOn":6364.799,"gridImport":8377.912,"gridExport":12196.7,"selfConsumption":71.29,"selfSufficiency":78.33,"active":[-3413.4,6983.6,-7389,9141.1,9459.9,9426.3,14461.8,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"reactive":[-3745.7,1964,-320.5,1368.6,1341.9,944.9,63.5,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"voltages":[240.6,240.6,241.4],"phaseVoltages":[240.6,240.6,241.4],"currentHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],"voltageHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{"timestamp":1646002800000,"consumption":36852.209,"solar":41696.564,"alwaysOn":6418.799,"gridImport":18185.846,"gridExport":23023.6,"selfConsumption":44.78,"selfSufficiency":50.65,"active":[7065.7,469.8,-12372.5,8951.4,9306.3,9248.5,14190.8,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"reactive":[-5469.3,1187.9,-2515.5,1514.5,1454.9,1219.5,1076.2,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"voltages":[240.6,240.4,241.2],"phaseVoltages":[240.6,240.4,241.2],"currentHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],"voltageHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]}]}

And this is what we made from it when it passes the function

{"Tijd":[1643756400000,1643842800000,1643929200000,1644015600000,1644102000000,1644188400000,1644274800000,1644361200000,1644447600000,1644534000000,1644620400000,1644706800000,1644793200000,1644879600000,1644966000000,1645052400000,1645138800000,1645225200000,1645311600000,1645398000000,1645484400000,1645570800000,1645657200000,1645743600000,1645830000000,1645916400000,1646002800000],"L1":[239.7,240.3,240.7,240.9,241.7,240.6,240.2,240.5,240.7,240.4,240.9,241.6,239.9,239.5,239.4,238.2,237.5,238.9,240.3,238.9,237.8,238.5,238.5,238.5,241.2,240.6,240.6],"L2":[239.8,240.1,240.6,241,241.5,240.5,240.7,241.1,241,240.6,241.3,242,240.4,239.8,239.3,238.1,237.4,238.6,240.2,238.4,237.8,238.9,238.9,238.8,241.6,240.6,240.4],"L3":[239.9,240.4,241.5,242.3,242.8,241.4,241.1,241.5,241.2,241.2,242.2,242.9,240.9,240,240,238.9,237.9,239.8,241.4,239.7,238.8,239.4,239.4,239.4,242.6,241.4,241.2]}

and lastly, I was also wondering if there is a fixed range on the Y axis. eg 0 - 250.

Thanks in advance !
Olivia

Hi Olivia, there are lots of examples around this forum of transforming a dataset to send to a chart.

Your task is just a JavaScript or JSONata transformation from

to this format..

1 Like

Hi @Steve-Mcl , When i change it to that format, i think i get the correct outcome but the chart isnt what it should be...

Do you see what i did wrong ?

[{"id":"dfab314e74299946","type":"function","z":"47e39c5606fd1f5d","name":"Spanning","func":"const rotated = {\n    Tijd:[],\n    L1: [],\n    L2: [],\n    L3: [],\n\n}\n\n\nconst APIdata = msg.payload.consumptions;\nfor (var i = 0; i < APIdata.length; i++) {\n\n rotated.Tijd[i] = APIdata[i].timestamp\n rotated.L1[i] = APIdata[i].voltages[0]\n rotated.L2[i] = APIdata[i].voltages[1]\n rotated.L3[i] = APIdata[i].voltages[2]\n\n\nconst test =  [{\n    \"series\": [\"L1\", \"L2\", \"L3\"],\n    \"data\": [\n    [{ \"x\":  rotated.Tijd, \"y\": rotated.L1 },\n     { \"x\":  rotated.Tijd, \"y\": rotated.L2 },\n     { \"x\":  rotated.Tijd, \"y\": rotated.L3 },\n     ]\n],\n\"labels\": [\"\"]\n}]\n\n\n\nmsg.payload = test;\nglobal.set('Spanningen',test)\n\n/*\nvar msg0 = { payload: rotated.Tijd[i]};\nvar msg1 = { payload: rotated.L1[i]};\nvar msg2 = { payload: rotated.L2[i]};\nvar msg3 = { payload: rotated.L3[i]};\n*/\n}\n\n\n\n\nreturn [msg];\n\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1260,"y":100,"wires":[["ad5f5108bd9a4703","ef64ef40c027fc90"]]}]

Chart config:

[{"id":"ef64ef40c027fc90","type":"ui_chart","z":"47e39c5606fd1f5d","name":"","group":"b9fbdeb2691cbabc","order":1,"width":0,"height":0,"label":"Spanning L1","chartType":"line","legend":"false","xformat":"Y-M-D","interpolate":"linear","nodata":"","dot":true,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":1470,"y":100,"wires":[[]]},{"id":"b9fbdeb2691cbabc","type":"ui_group","name":"Meetgegevens:","tab":"a67420ad81558175","order":2,"disp":true,"width":"6","collapse":false,"className":""},{"id":"a67420ad81558175","type":"ui_tab","name":"Spanning","icon":"dashboard","order":7,"disabled":false,"hidden":true}]

outcome:

Difficult to test without sample data but this should get you closer...

const rotated = {
    Tijd:[],
    L1: [],
    L2: [],
    L3: [],

}

const chartData = [{
    "series": ["L1", "L2", "L3"],
    "data": [ ],
    "labels": [""]
}]

const APIdata = msg.payload.consumptions;
for (var i = 0; i < APIdata.length; i++) {

    rotated.Tijd[i] = APIdata[i].timestamp
    rotated.L1[i] = APIdata[i].voltages[0]
    rotated.L2[i] = APIdata[i].voltages[1]
    rotated.L3[i] = APIdata[i].voltages[2]

    chartData[0].data.push([
        { "x": rotated.Tijd[i], "y": rotated.L1[i] },
        { "x": rotated.Tijd[i], "y": rotated.L2[i] },
        { "x": rotated.Tijd[i], "y": rotated.L3[i] },
    ])
}

msg.rotatedData = rotated;
msg.payload = chartData;

return msg;

1 Like

There is sampledata in the first mesage

No, the first export is a function only. The 2nd is a chart only.

Try the function i wrote - does it work?

PS: I just corrected a typo 10 secs ago (you might need to copy the function again)

1 Like

It kinda works... The timestamp does work but i should get 3 lines, 1 for L1 1for L2 and 1 for L3 and now it gives met 19 different lines.

This is the data comming from the API:

{"serviceLocationId":59792,"consumptions":[{"timestamp":1643842800000,"consumption":102286.026,"solar":5749.865,"alwaysOn":7027.204,"gridImport":96543.662,"gridExport":0,"selfConsumption":100,"selfSufficiency":5.61,"active":[30349.3,36055.6,30137.9,1100.6,1408.2,1361.5,1880.8,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"reactive":[-5356.8,-660.5,-5557.4,1813.1,1802.4,1717.3,1447,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"voltages":[240.3,240.1,240.4],"phaseVoltages":[240.3,240.1,240.4],"currentHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],"voltageHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{"timestamp":1643929200000,"consumption":22114.28,"solar":8538.567,"alwaysOn":7048.804,"gridImport":15357.514,"gridExport":1775.9,"selfConsumption":79.2,"selfSufficiency":30.55,"active":[10271.4,2790,520.7,1714.7,2014.4,1977.9,2831.5,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"reactive":[-5936.4,-305.4,-4983.5,1848.2,1838.4,1761.9,1420.5,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"voltages":[240.7,240.6,241.5],"phaseVoltages":[240.7,240.6,241.5],"currentHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],"voltageHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{"timestamp":1644015600000,"consumption":9328.966,"solar":22238.967,"alwaysOn":6803.979,"gridImport":6396.401,"gridExport":19299.7,"selfConsumption":13.22,"selfSufficiency":31.44,"active":[-1265.9,-2248.4,-9390.9,4707.4,5010.2,4983.3,7538.3,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"reactive":[-3591.2,603.1,-3735.8,1383.9,1365.9,1342.8,273.9,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"voltages":[240.9,241,242.3],"phaseVoltages":[240.9,241,242.3],"currentHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],"voltageHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{"timestamp":1644102000000,"consumption":8163.497,"solar":7667.664,"alwaysOn":6624.003,"gridImport":6509.234,"gridExport":6008.5,"selfConsumption":21.64,"selfSufficiency":20.26,"active":[1366.1,666.2,-1529.6,1503.7,1814.8,1773.9,2575.3,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"reactive":[-3904.3,-8.4,-4398.2,1694.1,1685.6,1600.8,1182.1,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"voltages":[241.7,241.5,242.8],"phaseVoltages":[241.7,241.5,242.8],"currentHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],"voltageHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{"timestamp":1644188400000,"consumption":48208.342,"solar":26604.468,"alwaysOn":6595.226,"gridImport":37612.875,"gridExport":16005.9,"selfConsumption":39.84,"selfSufficiency":21.98,"active":[9992.6,10138.9,1475.2,5640.9,5978.9,5920.9,9063.8,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"reactive":[-3737.2,1481,-3280.2,1387.7,1371.3,1327.4,504.8,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"voltages":[240.6,240.5,241.4],"phaseVoltages":[240.6,240.5,241.4],"currentHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],"voltageHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{"timestamp":1644274800000,"consumption":26531.901,"solar":9259.367,"alwaysOn":6656.426,"gridImport":20559.835,"gridExport":3281.5,"selfConsumption":64.56,"selfSufficiency":22.51,"active":[10349.4,4537.5,2390.9,1861.4,2181.3,2135.3,3081.8,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"reactive":[-6009.3,-197.1,-5033.4,1774.7,1771,1670.6,1389.9,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"voltages":[240.2,240.7,241.1],"phaseVoltages":[240.2,240.7,241.1],"currentHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],"voltageHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{"timestamp":1644361200000,"consumption":29412.634,"solar":14275.364,"alwaysOn":6981.616,"gridImport":18733.371,"gridExport":3591.6,"selfConsumption":74.84,"selfSufficiency":36.31,"active":[9967.5,4020.6,1154.1,2953.3,3274.1,3224.5,4824.3,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"reactive":[-5921,-71.7,-4664.9,1627,1633.4,1556.6,787.2,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"voltages":[240.5,241.1,241.5],"phaseVoltages":[240.5,241.1,241.5],"currentHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],"voltageHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{"timestamp":1644447600000,"consumption":68395.546,"solar":9538.468,"alwaysOn":8050.78,"gridImport":59079.079,"gridExport":228.1,"selfConsumption":97.61,"selfSufficiency":13.62,"active":[21834.4,19303.2,17715.2,1949.1,2236.4,2191.7,3178.1,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"reactive":[-5514.3,306.9,-5133.9,1668.3,1661.1,1591,986.1,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"voltages":[240.7,241,241.2],"phaseVoltages":[240.7,241,241.2],"currentHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],"voltageHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{"timestamp":1644534000000,"consumption":34328.291,"solar":28989.736,"alwaysOn":8841.598,"gridImport":20976.056,"gridExport":15638,"selfConsumption":46.06,"selfSufficiency":38.9,"active":[10036.8,1536.5,-6234.9,6180.3,6522.8,6479.7,9815.2,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"reactive":[-5643.5,871.4,-2463.6,1506.3,1492.2,1435.8,993.6,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"voltages":[240.4,240.6,241.2],"phaseVoltages":[240.4,240.6,241.2],"currentHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],"voltageHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{"timestamp":1644620400000,"consumption":26999.4,"solar":30103.068,"alwaysOn":7927.171,"gridImport":13951.034,"gridExport":17048.8,"selfConsumption":43.37,"selfSufficiency":48.33,"active":[2737,1520.4,-7353.2,6426.3,6742.8,6706,10227.2,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"reactive":[-4061.3,-171.8,-3164.7,1337.5,1307.8,1271.4,129.8,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"voltages":[240.9,241.3,242.2],"phaseVoltages":[240.9,241.3,242.2],"currentHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],"voltageHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{"timestamp":1644706800000,"consumption":9194.886,"solar":21581.264,"alwaysOn":7660.781,"gridImport":6164.223,"gridExport":18545.4,"selfConsumption":14.07,"selfSufficiency":32.96,"active":[-1616,-2426.4,-8338.9,4570.4,4877.9,4839.7,7292.9,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"reactive":[-3403.6,570.3,-2424.1,1439.9,1428.1,1405.1,167.9,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"voltages":[241.6,242,242.9],"phaseVoltages":[241.6,242,242.9],"currentHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],"voltageHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{"timestamp":1644793200000,"consumption":69640.101,"solar":21507.063,"alwaysOn":7627.156,"gridImport":55617.239,"gridExport":7477.9,"selfConsumption":65.23,"selfSufficiency":20.14,"active":[23400.5,15441.5,9296.4,4530.7,4856.8,4808.5,7310.9,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"reactive":[-5792.9,1163.4,-2993.1,1583,1584.8,1472.6,842.6,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"voltages":[239.9,240.4,240.9],"phaseVoltages":[239.9,240.4,240.9],"currentHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],"voltageHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{"timestamp":1644879600000,"consumption":36244.027,"solar":19223.561,"alwaysOn":7516.771,"gridImport":25542.367,"gridExport":8514.9,"selfConsumption":55.71,"selfSufficiency":29.53,"active":[13930.8,4728.1,-1630.8,4051.4,4372.2,4327.2,6473.3,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"reactive":[-6001,516.4,-3231.5,1587.4,1593.2,1523.2,1000.2,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"voltages":[239.5,239.8,240],"phaseVoltages":[239.5,239.8,240],"currentHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],"voltageHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{"timestamp":1644966000000,"consumption":85259.102,"solar":10836.264,"alwaysOn":7372.671,"gridImport":74806.539,"gridExport":380.3,"selfConsumption":96.49,"selfSufficiency":12.26,"active":[31887,24016.5,18523.7,2223.7,2513.3,2477,3624.6,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"reactive":[-6358.2,453,-3835.7,1689.3,1687.6,1630.3,1034.4,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"voltages":[239.4,239.3,240],"phaseVoltages":[239.4,239.3,240],"currentHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],"voltageHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{"timestamp":1645052400000,"consumption":62707.468,"solar":25522.268,"alwaysOn":6940.758,"gridImport":43515.601,"gridExport":6326.7,"selfConsumption":75.21,"selfSufficiency":30.61,"active":[17523.8,13335.1,6330.2,5414.1,5753.9,5699.1,8655.6,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"reactive":[-4828.9,781.1,-2753.5,1456.2,1472.7,1148.8,673.4,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"voltages":[238.2,238.1,238.9],"phaseVoltages":[238.2,238.1,238.9],"currentHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],"voltageHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{"timestamp":1645138800000,"consumption":42588.795,"solar":14926.665,"alwaysOn":6887.958,"gridImport":36598.53,"gridExport":8931.3,"selfConsumption":40.17,"selfSufficiency":14.07,"active":[13909,8941.7,4817.1,3073.6,3391.4,3339.7,5121.7,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"reactive":[-4797.4,-31,-3497.5,1636.7,1618.7,1507.8,670.5,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"voltages":[237.5,237.4,237.9],"phaseVoltages":[237.5,237.4,237.9],"currentHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],"voltageHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{"timestamp":1645225200000,"consumption":9367.212,"solar":21046.866,"alwaysOn":6609.45,"gridImport":6243.547,"gridExport":17918.3,"selfConsumption":14.86,"selfSufficiency":33.35,"active":[-988.3,-1914.2,-8770.6,4470.8,4760.1,4726.8,7089.2,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"reactive":[-3363.3,436.8,-2473.5,1452.6,1427,1336.2,485.3,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"voltages":[238.9,238.6,239.8],"phaseVoltages":[238.9,238.6,239.8],"currentHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],"voltageHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{"timestamp":1645311600000,"consumption":8600.461,"solar":5637.565,"alwaysOn":6480.023,"gridImport":6292.597,"gridExport":3325.8,"selfConsumption":41.01,"selfSufficiency":26.83,"active":[1919,1289.5,-242.4,1088.8,1378,1340.2,1830.7,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"reactive":[-3809,-347.1,-3803.8,1862.2,1831.8,1774.1,1138.8,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"voltages":[240.3,240.2,241.4],"phaseVoltages":[240.3,240.2,241.4],"currentHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],"voltageHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{"timestamp":1645398000000,"consumption":45459.602,"solar":11135.369,"alwaysOn":6498.023,"gridImport":34828.834,"gridExport":498.8,"selfConsumption":95.52,"selfSufficiency":23.39,"active":[16297,10835,7198.5,2267.5,2572.7,2534.2,3762.1,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"reactive":[-5844.2,-246.3,-3733,1854.6,1855,1778.7,1070.7,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],"voltages":[238.9,238.4,239.7],"phaseVoltages":[238.9,238.4,239.7],"currentHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],"voltageHarmonics":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]}]}

and this is the outcome of the debug console:

[{"series":["L1","L2","L3"],"data":[[{"x":1643842800000,"y":240.3},{"x":1643842800000,"y":240.1},{"x":1643842800000,"y":240.4}],[{"x":1643929200000,"y":240.7},{"x":1643929200000,"y":240.6},{"x":1643929200000,"y":241.5}],[{"x":1644015600000,"y":240.9},{"x":1644015600000,"y":241},{"x":1644015600000,"y":242.3}],[{"x":1644102000000,"y":241.7},{"x":1644102000000,"y":241.5},{"x":1644102000000,"y":242.8}],[{"x":1644188400000,"y":240.6},{"x":1644188400000,"y":240.5},{"x":1644188400000,"y":241.4}],[{"x":1644274800000,"y":240.2},{"x":1644274800000,"y":240.7},{"x":1644274800000,"y":241.1}],[{"x":1644361200000,"y":240.5},{"x":1644361200000,"y":241.1},{"x":1644361200000,"y":241.5}],[{"x":1644447600000,"y":240.7},{"x":1644447600000,"y":241},{"x":1644447600000,"y":241.2}],[{"x":1644534000000,"y":240.4},{"x":1644534000000,"y":240.6},{"x":1644534000000,"y":241.2}],[{"x":1644620400000,"y":240.9},{"x":1644620400000,"y":241.3},{"x":1644620400000,"y":242.2}],[{"x":1644706800000,"y":241.6},{"x":1644706800000,"y":242},{"x":1644706800000,"y":242.9}],[{"x":1644793200000,"y":239.9},{"x":1644793200000,"y":240.4},{"x":1644793200000,"y":240.9}],[{"x":1644879600000,"y":239.5},{"x":1644879600000,"y":239.8},{"x":1644879600000,"y":240}],[{"x":1644966000000,"y":239.4},{"x":1644966000000,"y":239.3},{"x":1644966000000,"y":240}],[{"x":1645052400000,"y":238.2},{"x":1645052400000,"y":238.1},{"x":1645052400000,"y":238.9}],[{"x":1645138800000,"y":237.5},{"x":1645138800000,"y":237.4},{"x":1645138800000,"y":237.9}],[{"x":1645225200000,"y":238.9},{"x":1645225200000,"y":238.6},{"x":1645225200000,"y":239.8}],[{"x":1645311600000,"y":240.3},{"x":1645311600000,"y":240.2},{"x":1645311600000,"y":241.4}],[{"x":1645398000000,"y":238.9},{"x":1645398000000,"y":238.4},{"x":1645398000000,"y":239.7}]],"labels":[""]}]

Here you go...
image

[{"id":"f08826975f141c38","type":"debug","z":"c1ebfd3083f3904f","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1570,"y":320,"wires":[]},{"id":"d6bc5bfcb1ab6402","type":"ui_chart","z":"c1ebfd3083f3904f","name":"","group":"a9db9cfd51218421","order":1,"width":0,"height":0,"label":"Spanning L1","chartType":"line","legend":"false","xformat":"Y-M-D","interpolate":"linear","nodata":"","dot":true,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":1570,"y":360,"wires":[[]]},{"id":"27a06f2a32831cb8","type":"function","z":"c1ebfd3083f3904f","name":"","func":"const rotated = {\n    Tijd: [],\n    L1: [],\n    L2: [],\n    L3: [],\n\n}\n\nconst chartData = [{\n    \"series\": [\"L1\", \"L2\", \"L3\"],\n    \"data\": [\n        [],\n        [],\n        []\n    ],\n    \"labels\": [\"\"]\n}]\n\nconst APIdata = msg.payload.consumptions;\nfor (var i = 0; i < APIdata.length; i++) {\n\n    rotated.Tijd[i] = APIdata[i].timestamp\n    rotated.L1[i] = APIdata[i].voltages[0]\n    rotated.L2[i] = APIdata[i].voltages[1]\n    rotated.L3[i] = APIdata[i].voltages[2]\n    \n    chartData[0].data[i] = chartData[0].data[i] || [];\n    chartData[0].data[0].push({ \"x\": rotated.Tijd[i], \"y\": rotated.L1[i] })\n    chartData[0].data[1].push({ \"x\": rotated.Tijd[i], \"y\": rotated.L2[i] })\n    chartData[0].data[2].push({ \"x\": rotated.Tijd[i], \"y\": rotated.L3[i] })\n}\n\nmsg.rotatedData = rotated;\nmsg.payload = chartData;\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1350,"y":320,"wires":[["f08826975f141c38","d6bc5bfcb1ab6402"]]},{"id":"7d85db00e2267b97","type":"function","z":"c1ebfd3083f3904f","name":"sample data","func":"msg.payload = { \"serviceLocationId\": 59792, \"consumptions\": [{ \"timestamp\": 1643842800000, \"consumption\": 102286.026, \"solar\": 5749.865, \"alwaysOn\": 7027.204, \"gridImport\": 96543.662, \"gridExport\": 0, \"selfConsumption\": 100, \"selfSufficiency\": 5.61, \"active\": [30349.3, 36055.6, 30137.9, 1100.6, 1408.2, 1361.5, 1880.8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null], \"reactive\": [-5356.8, -660.5, -5557.4, 1813.1, 1802.4, 1717.3, 1447, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null], \"voltages\": [240.3, 240.1, 240.4], \"phaseVoltages\": [240.3, 240.1, 240.4], \"currentHarmonics\": [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []], \"voltageHarmonics\": [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []] }, { \"timestamp\": 1643929200000, \"consumption\": 22114.28, \"solar\": 8538.567, \"alwaysOn\": 7048.804, \"gridImport\": 15357.514, \"gridExport\": 1775.9, \"selfConsumption\": 79.2, \"selfSufficiency\": 30.55, \"active\": [10271.4, 2790, 520.7, 1714.7, 2014.4, 1977.9, 2831.5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null], \"reactive\": [-5936.4, -305.4, -4983.5, 1848.2, 1838.4, 1761.9, 1420.5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null], \"voltages\": [240.7, 240.6, 241.5], \"phaseVoltages\": [240.7, 240.6, 241.5], \"currentHarmonics\": [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []], \"voltageHarmonics\": [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []] }, { \"timestamp\": 1644015600000, \"consumption\": 9328.966, \"solar\": 22238.967, \"alwaysOn\": 6803.979, \"gridImport\": 6396.401, \"gridExport\": 19299.7, \"selfConsumption\": 13.22, \"selfSufficiency\": 31.44, \"active\": [-1265.9, -2248.4, -9390.9, 4707.4, 5010.2, 4983.3, 7538.3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null], \"reactive\": [-3591.2, 603.1, -3735.8, 1383.9, 1365.9, 1342.8, 273.9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null], \"voltages\": [240.9, 241, 242.3], \"phaseVoltages\": [240.9, 241, 242.3], \"currentHarmonics\": [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []], \"voltageHarmonics\": [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []] }, { \"timestamp\": 1644102000000, \"consumption\": 8163.497, \"solar\": 7667.664, \"alwaysOn\": 6624.003, \"gridImport\": 6509.234, \"gridExport\": 6008.5, \"selfConsumption\": 21.64, \"selfSufficiency\": 20.26, \"active\": [1366.1, 666.2, -1529.6, 1503.7, 1814.8, 1773.9, 2575.3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null], \"reactive\": [-3904.3, -8.4, -4398.2, 1694.1, 1685.6, 1600.8, 1182.1, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null], \"voltages\": [241.7, 241.5, 242.8], \"phaseVoltages\": [241.7, 241.5, 242.8], \"currentHarmonics\": [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []], \"voltageHarmonics\": [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []] }, { \"timestamp\": 1644188400000, \"consumption\": 48208.342, \"solar\": 26604.468, \"alwaysOn\": 6595.226, \"gridImport\": 37612.875, \"gridExport\": 16005.9, \"selfConsumption\": 39.84, \"selfSufficiency\": 21.98, \"active\": [9992.6, 10138.9, 1475.2, 5640.9, 5978.9, 5920.9, 9063.8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null], \"reactive\": [-3737.2, 1481, -3280.2, 1387.7, 1371.3, 1327.4, 504.8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null], \"voltages\": [240.6, 240.5, 241.4], \"phaseVoltages\": [240.6, 240.5, 241.4], \"currentHarmonics\": [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []], \"voltageHarmonics\": [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []] }, { \"timestamp\": 1644274800000, \"consumption\": 26531.901, \"solar\": 9259.367, \"alwaysOn\": 6656.426, \"gridImport\": 20559.835, \"gridExport\": 3281.5, \"selfConsumption\": 64.56, \"selfSufficiency\": 22.51, \"active\": [10349.4, 4537.5, 2390.9, 1861.4, 2181.3, 2135.3, 3081.8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null], \"reactive\": [-6009.3, -197.1, -5033.4, 1774.7, 1771, 1670.6, 1389.9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null], \"voltages\": [240.2, 240.7, 241.1], \"phaseVoltages\": [240.2, 240.7, 241.1], \"currentHarmonics\": [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []], \"voltageHarmonics\": [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []] }, { \"timestamp\": 1644361200000, \"consumption\": 29412.634, \"solar\": 14275.364, \"alwaysOn\": 6981.616, \"gridImport\": 18733.371, \"gridExport\": 3591.6, \"selfConsumption\": 74.84, \"selfSufficiency\": 36.31, \"active\": [9967.5, 4020.6, 1154.1, 2953.3, 3274.1, 3224.5, 4824.3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null], \"reactive\": [-5921, -71.7, -4664.9, 1627, 1633.4, 1556.6, 787.2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null], \"voltages\": [240.5, 241.1, 241.5], \"phaseVoltages\": [240.5, 241.1, 241.5], \"currentHarmonics\": [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []], \"voltageHarmonics\": [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []] }, { \"timestamp\": 1644447600000, \"consumption\": 68395.546, \"solar\": 9538.468, \"alwaysOn\": 8050.78, \"gridImport\": 59079.079, \"gridExport\": 228.1, \"selfConsumption\": 97.61, \"selfSufficiency\": 13.62, \"active\": [21834.4, 19303.2, 17715.2, 1949.1, 2236.4, 2191.7, 3178.1, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null], \"reactive\": [-5514.3, 306.9, -5133.9, 1668.3, 1661.1, 1591, 986.1, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null], \"voltages\": [240.7, 241, 241.2], \"phaseVoltages\": [240.7, 241, 241.2], \"currentHarmonics\": [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []], \"voltageHarmonics\": [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []] }, { \"timestamp\": 1644534000000, \"consumption\": 34328.291, \"solar\": 28989.736, \"alwaysOn\": 8841.598, \"gridImport\": 20976.056, \"gridExport\": 15638, \"selfConsumption\": 46.06, \"selfSufficiency\": 38.9, \"active\": [10036.8, 1536.5, -6234.9, 6180.3, 6522.8, 6479.7, 9815.2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null], \"reactive\": [-5643.5, 871.4, -2463.6, 1506.3, 1492.2, 1435.8, 993.6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null], \"voltages\": [240.4, 240.6, 241.2], \"phaseVoltages\": [240.4, 240.6, 241.2], \"currentHarmonics\": [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []], \"voltageHarmonics\": [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []] }, { \"timestamp\": 1644620400000, \"consumption\": 26999.4, \"solar\": 30103.068, \"alwaysOn\": 7927.171, \"gridImport\": 13951.034, \"gridExport\": 17048.8, \"selfConsumption\": 43.37, \"selfSufficiency\": 48.33, \"active\": [2737, 1520.4, -7353.2, 6426.3, 6742.8, 6706, 10227.2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null], \"reactive\": [-4061.3, -171.8, -3164.7, 1337.5, 1307.8, 1271.4, 129.8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null], \"voltages\": [240.9, 241.3, 242.2], \"phaseVoltages\": [240.9, 241.3, 242.2], \"currentHarmonics\": [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []], \"voltageHarmonics\": [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []] }, { \"timestamp\": 1644706800000, \"consumption\": 9194.886, \"solar\": 21581.264, \"alwaysOn\": 7660.781, \"gridImport\": 6164.223, \"gridExport\": 18545.4, \"selfConsumption\": 14.07, \"selfSufficiency\": 32.96, \"active\": [-1616, -2426.4, -8338.9, 4570.4, 4877.9, 4839.7, 7292.9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null], \"reactive\": [-3403.6, 570.3, -2424.1, 1439.9, 1428.1, 1405.1, 167.9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null], \"voltages\": [241.6, 242, 242.9], \"phaseVoltages\": [241.6, 242, 242.9], \"currentHarmonics\": [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []], \"voltageHarmonics\": [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []] }, { \"timestamp\": 1644793200000, \"consumption\": 69640.101, \"solar\": 21507.063, \"alwaysOn\": 7627.156, \"gridImport\": 55617.239, \"gridExport\": 7477.9, \"selfConsumption\": 65.23, \"selfSufficiency\": 20.14, \"active\": [23400.5, 15441.5, 9296.4, 4530.7, 4856.8, 4808.5, 7310.9, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null], \"reactive\": [-5792.9, 1163.4, -2993.1, 1583, 1584.8, 1472.6, 842.6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null], \"voltages\": [239.9, 240.4, 240.9], \"phaseVoltages\": [239.9, 240.4, 240.9], \"currentHarmonics\": [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []], \"voltageHarmonics\": [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []] }, { \"timestamp\": 1644879600000, \"consumption\": 36244.027, \"solar\": 19223.561, \"alwaysOn\": 7516.771, \"gridImport\": 25542.367, \"gridExport\": 8514.9, \"selfConsumption\": 55.71, \"selfSufficiency\": 29.53, \"active\": [13930.8, 4728.1, -1630.8, 4051.4, 4372.2, 4327.2, 6473.3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null], \"reactive\": [-6001, 516.4, -3231.5, 1587.4, 1593.2, 1523.2, 1000.2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null], \"voltages\": [239.5, 239.8, 240], \"phaseVoltages\": [239.5, 239.8, 240], \"currentHarmonics\": [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []], \"voltageHarmonics\": [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []] }, { \"timestamp\": 1644966000000, \"consumption\": 85259.102, \"solar\": 10836.264, \"alwaysOn\": 7372.671, \"gridImport\": 74806.539, \"gridExport\": 380.3, \"selfConsumption\": 96.49, \"selfSufficiency\": 12.26, \"active\": [31887, 24016.5, 18523.7, 2223.7, 2513.3, 2477, 3624.6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null], \"reactive\": [-6358.2, 453, -3835.7, 1689.3, 1687.6, 1630.3, 1034.4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null], \"voltages\": [239.4, 239.3, 240], \"phaseVoltages\": [239.4, 239.3, 240], \"currentHarmonics\": [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []], \"voltageHarmonics\": [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []] }, { \"timestamp\": 1645052400000, \"consumption\": 62707.468, \"solar\": 25522.268, \"alwaysOn\": 6940.758, \"gridImport\": 43515.601, \"gridExport\": 6326.7, \"selfConsumption\": 75.21, \"selfSufficiency\": 30.61, \"active\": [17523.8, 13335.1, 6330.2, 5414.1, 5753.9, 5699.1, 8655.6, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null], \"reactive\": [-4828.9, 781.1, -2753.5, 1456.2, 1472.7, 1148.8, 673.4, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null], \"voltages\": [238.2, 238.1, 238.9], \"phaseVoltages\": [238.2, 238.1, 238.9], \"currentHarmonics\": [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []], \"voltageHarmonics\": [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []] }, { \"timestamp\": 1645138800000, \"consumption\": 42588.795, \"solar\": 14926.665, \"alwaysOn\": 6887.958, \"gridImport\": 36598.53, \"gridExport\": 8931.3, \"selfConsumption\": 40.17, \"selfSufficiency\": 14.07, \"active\": [13909, 8941.7, 4817.1, 3073.6, 3391.4, 3339.7, 5121.7, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null], \"reactive\": [-4797.4, -31, -3497.5, 1636.7, 1618.7, 1507.8, 670.5, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null], \"voltages\": [237.5, 237.4, 237.9], \"phaseVoltages\": [237.5, 237.4, 237.9], \"currentHarmonics\": [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []], \"voltageHarmonics\": [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []] }, { \"timestamp\": 1645225200000, \"consumption\": 9367.212, \"solar\": 21046.866, \"alwaysOn\": 6609.45, \"gridImport\": 6243.547, \"gridExport\": 17918.3, \"selfConsumption\": 14.86, \"selfSufficiency\": 33.35, \"active\": [-988.3, -1914.2, -8770.6, 4470.8, 4760.1, 4726.8, 7089.2, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null], \"reactive\": [-3363.3, 436.8, -2473.5, 1452.6, 1427, 1336.2, 485.3, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null], \"voltages\": [238.9, 238.6, 239.8], \"phaseVoltages\": [238.9, 238.6, 239.8], \"currentHarmonics\": [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []], \"voltageHarmonics\": [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []] }, { \"timestamp\": 1645311600000, \"consumption\": 8600.461, \"solar\": 5637.565, \"alwaysOn\": 6480.023, \"gridImport\": 6292.597, \"gridExport\": 3325.8, \"selfConsumption\": 41.01, \"selfSufficiency\": 26.83, \"active\": [1919, 1289.5, -242.4, 1088.8, 1378, 1340.2, 1830.7, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null], \"reactive\": [-3809, -347.1, -3803.8, 1862.2, 1831.8, 1774.1, 1138.8, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null], \"voltages\": [240.3, 240.2, 241.4], \"phaseVoltages\": [240.3, 240.2, 241.4], \"currentHarmonics\": [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []], \"voltageHarmonics\": [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []] }, { \"timestamp\": 1645398000000, \"consumption\": 45459.602, \"solar\": 11135.369, \"alwaysOn\": 6498.023, \"gridImport\": 34828.834, \"gridExport\": 498.8, \"selfConsumption\": 95.52, \"selfSufficiency\": 23.39, \"active\": [16297, 10835, 7198.5, 2267.5, 2572.7, 2534.2, 3762.1, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null], \"reactive\": [-5844.2, -246.3, -3733, 1854.6, 1855, 1778.7, 1070.7, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null], \"voltages\": [238.9, 238.4, 239.7], \"phaseVoltages\": [238.9, 238.4, 239.7], \"currentHarmonics\": [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []], \"voltageHarmonics\": [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []] }] }\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1350,"y":280,"wires":[["27a06f2a32831cb8"]]},{"id":"2caa93b332923a45","type":"inject","z":"c1ebfd3083f3904f","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":1300,"y":240,"wires":[["7d85db00e2267b97"]]},{"id":"a9db9cfd51218421","type":"ui_group","name":"Meetgegevens:","tab":"a67420ad81558175","order":2,"disp":true,"width":"6","collapse":false,"className":""},{"id":"a67420ad81558175","type":"ui_tab","name":"Spanning","icon":"dashboard","order":7,"disabled":false,"hidden":true}]
1 Like

Hi @Steve-Mcl , one more question, do you know what all those undefined labels are ?

Not without seeing your final flow.

Can you capture the payload, add it to an inject and re-create this consistently as a demo flow?

If so, share that demo flow & I will have a look.

[{"id":"e5ccc2ef62733c43","type":"debug","z":"47e39c5606fd1f5d","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1490,"y":300,"wires":[]},{"id":"e1248a68d050078d","type":"ui_chart","z":"47e39c5606fd1f5d","name":"","group":"b9fbdeb2691cbabc","order":1,"width":"6","height":"7","label":"Spanningen","chartType":"line","legend":"true","xformat":"auto","interpolate":"linear","nodata":"","dot":false,"ymin":"210","ymax":"250","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":1490,"y":340,"wires":[[]]},{"id":"3d9d1185162fb347","type":"function","z":"47e39c5606fd1f5d","name":"","func":"const rotated = {\n    Tijd: [],\n    L1: [],\n    L2: [],\n    L3: [],\n\n}\n\nconst chartData = [{\n    \"series\": [\"L1\", \"L2\", \"L3\"],\n    \"data\": [\n        [],\n        [],\n        []\n    ],\n    \"labels\": [\"\"]\n}]\n\nconst APIdata = msg.payload.consumptions;\nfor (var i = 0; i < APIdata.length; i++) {\n\n    rotated.Tijd[i] = APIdata[i].timestamp\n    rotated.L1[i] = APIdata[i].voltages[0]\n    rotated.L2[i] = APIdata[i].voltages[1]\n    rotated.L3[i] = APIdata[i].voltages[2]\n    \n    chartData[0].data[i] = chartData[0].data[i] || [];\n    chartData[0].data[0].push({ \"x\": rotated.Tijd[i], \"y\": rotated.L1[i] })\n    chartData[0].data[1].push({ \"x\": rotated.Tijd[i], \"y\": rotated.L2[i] })\n    chartData[0].data[2].push({ \"x\": rotated.Tijd[i], \"y\": rotated.L3[i] })\n}\n\nmsg.rotatedData = rotated;\nmsg.payload = chartData;\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1270,"y":300,"wires":[["e5ccc2ef62733c43","e1248a68d050078d"]]},{"id":"67b0f6dde881d202","type":"function","z":"47e39c5606fd1f5d","name":"sample data","func":"msg.payload = {\"serviceLocationId\":59792,\"consumptions\":[{\"timestamp\":1643756400000,\"consumption\":35748.435,\"solar\":9275.865,\"alwaysOn\":7047.642,\"gridImport\":28772.671,\"gridExport\":2294.7,\"selfConsumption\":75.26,\"selfSufficiency\":19.51,\"active\":[14041.9,7428.8,5007.4,1885.8,2171.8,2133.7,3084.9,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],\"reactive\":[-5319.4,71.2,-4817.3,1654.8,1648.7,1570.8,1058.2,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],\"voltages\":[239.7,239.8,239.9],\"phaseVoltages\":[239.7,239.8,239.9],\"currentHarmonics\":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],\"voltageHarmonics\":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{\"timestamp\":1643842800000,\"consumption\":102286.026,\"solar\":5749.865,\"alwaysOn\":7027.204,\"gridImport\":96543.662,\"gridExport\":0,\"selfConsumption\":100,\"selfSufficiency\":5.61,\"active\":[30349.3,36055.6,30137.9,1100.6,1408.2,1361.5,1880.8,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],\"reactive\":[-5356.8,-660.5,-5557.4,1813.1,1802.4,1717.3,1447,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],\"voltages\":[240.3,240.1,240.4],\"phaseVoltages\":[240.3,240.1,240.4],\"currentHarmonics\":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],\"voltageHarmonics\":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{\"timestamp\":1643929200000,\"consumption\":22114.28,\"solar\":8538.567,\"alwaysOn\":7048.804,\"gridImport\":15357.514,\"gridExport\":1775.9,\"selfConsumption\":79.2,\"selfSufficiency\":30.55,\"active\":[10271.4,2790,520.7,1714.7,2014.4,1977.9,2831.5,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],\"reactive\":[-5936.4,-305.4,-4983.5,1848.2,1838.4,1761.9,1420.5,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],\"voltages\":[240.7,240.6,241.5],\"phaseVoltages\":[240.7,240.6,241.5],\"currentHarmonics\":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],\"voltageHarmonics\":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{\"timestamp\":1644015600000,\"consumption\":9328.966,\"solar\":22238.967,\"alwaysOn\":6803.979,\"gridImport\":6396.401,\"gridExport\":19299.7,\"selfConsumption\":13.22,\"selfSufficiency\":31.44,\"active\":[-1265.9,-2248.4,-9390.9,4707.4,5010.2,4983.3,7538.3,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],\"reactive\":[-3591.2,603.1,-3735.8,1383.9,1365.9,1342.8,273.9,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],\"voltages\":[240.9,241,242.3],\"phaseVoltages\":[240.9,241,242.3],\"currentHarmonics\":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],\"voltageHarmonics\":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{\"timestamp\":1644102000000,\"consumption\":8163.497,\"solar\":7667.664,\"alwaysOn\":6624.003,\"gridImport\":6509.234,\"gridExport\":6008.5,\"selfConsumption\":21.64,\"selfSufficiency\":20.26,\"active\":[1366.1,666.2,-1529.6,1503.7,1814.8,1773.9,2575.3,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],\"reactive\":[-3904.3,-8.4,-4398.2,1694.1,1685.6,1600.8,1182.1,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],\"voltages\":[241.7,241.5,242.8],\"phaseVoltages\":[241.7,241.5,242.8],\"currentHarmonics\":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],\"voltageHarmonics\":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{\"timestamp\":1644188400000,\"consumption\":48208.342,\"solar\":26604.468,\"alwaysOn\":6595.226,\"gridImport\":37612.875,\"gridExport\":16005.9,\"selfConsumption\":39.84,\"selfSufficiency\":21.98,\"active\":[9992.6,10138.9,1475.2,5640.9,5978.9,5920.9,9063.8,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],\"reactive\":[-3737.2,1481,-3280.2,1387.7,1371.3,1327.4,504.8,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],\"voltages\":[240.6,240.5,241.4],\"phaseVoltages\":[240.6,240.5,241.4],\"currentHarmonics\":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],\"voltageHarmonics\":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{\"timestamp\":1644274800000,\"consumption\":26531.901,\"solar\":9259.367,\"alwaysOn\":6656.426,\"gridImport\":20559.835,\"gridExport\":3281.5,\"selfConsumption\":64.56,\"selfSufficiency\":22.51,\"active\":[10349.4,4537.5,2390.9,1861.4,2181.3,2135.3,3081.8,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],\"reactive\":[-6009.3,-197.1,-5033.4,1774.7,1771,1670.6,1389.9,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],\"voltages\":[240.2,240.7,241.1],\"phaseVoltages\":[240.2,240.7,241.1],\"currentHarmonics\":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],\"voltageHarmonics\":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{\"timestamp\":1644361200000,\"consumption\":29412.634,\"solar\":14275.364,\"alwaysOn\":6981.616,\"gridImport\":18733.371,\"gridExport\":3591.6,\"selfConsumption\":74.84,\"selfSufficiency\":36.31,\"active\":[9967.5,4020.6,1154.1,2953.3,3274.1,3224.5,4824.3,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],\"reactive\":[-5921,-71.7,-4664.9,1627,1633.4,1556.6,787.2,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],\"voltages\":[240.5,241.1,241.5],\"phaseVoltages\":[240.5,241.1,241.5],\"currentHarmonics\":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],\"voltageHarmonics\":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{\"timestamp\":1644447600000,\"consumption\":68395.546,\"solar\":9538.468,\"alwaysOn\":8050.78,\"gridImport\":59079.079,\"gridExport\":228.1,\"selfConsumption\":97.61,\"selfSufficiency\":13.62,\"active\":[21834.4,19303.2,17715.2,1949.1,2236.4,2191.7,3178.1,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],\"reactive\":[-5514.3,306.9,-5133.9,1668.3,1661.1,1591,986.1,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],\"voltages\":[240.7,241,241.2],\"phaseVoltages\":[240.7,241,241.2],\"currentHarmonics\":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],\"voltageHarmonics\":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{\"timestamp\":1644534000000,\"consumption\":34328.291,\"solar\":28989.736,\"alwaysOn\":8841.598,\"gridImport\":20976.056,\"gridExport\":15638,\"selfConsumption\":46.06,\"selfSufficiency\":38.9,\"active\":[10036.8,1536.5,-6234.9,6180.3,6522.8,6479.7,9815.2,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],\"reactive\":[-5643.5,871.4,-2463.6,1506.3,1492.2,1435.8,993.6,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],\"voltages\":[240.4,240.6,241.2],\"phaseVoltages\":[240.4,240.6,241.2],\"currentHarmonics\":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],\"voltageHarmonics\":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{\"timestamp\":1644620400000,\"consumption\":26999.4,\"solar\":30103.068,\"alwaysOn\":7927.171,\"gridImport\":13951.034,\"gridExport\":17048.8,\"selfConsumption\":43.37,\"selfSufficiency\":48.33,\"active\":[2737,1520.4,-7353.2,6426.3,6742.8,6706,10227.2,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],\"reactive\":[-4061.3,-171.8,-3164.7,1337.5,1307.8,1271.4,129.8,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],\"voltages\":[240.9,241.3,242.2],\"phaseVoltages\":[240.9,241.3,242.2],\"currentHarmonics\":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],\"voltageHarmonics\":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{\"timestamp\":1644706800000,\"consumption\":9194.886,\"solar\":21581.264,\"alwaysOn\":7660.781,\"gridImport\":6164.223,\"gridExport\":18545.4,\"selfConsumption\":14.07,\"selfSufficiency\":32.96,\"active\":[-1616,-2426.4,-8338.9,4570.4,4877.9,4839.7,7292.9,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],\"reactive\":[-3403.6,570.3,-2424.1,1439.9,1428.1,1405.1,167.9,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],\"voltages\":[241.6,242,242.9],\"phaseVoltages\":[241.6,242,242.9],\"currentHarmonics\":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],\"voltageHarmonics\":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{\"timestamp\":1644793200000,\"consumption\":69640.101,\"solar\":21507.063,\"alwaysOn\":7627.156,\"gridImport\":55617.239,\"gridExport\":7477.9,\"selfConsumption\":65.23,\"selfSufficiency\":20.14,\"active\":[23400.5,15441.5,9296.4,4530.7,4856.8,4808.5,7310.9,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],\"reactive\":[-5792.9,1163.4,-2993.1,1583,1584.8,1472.6,842.6,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],\"voltages\":[239.9,240.4,240.9],\"phaseVoltages\":[239.9,240.4,240.9],\"currentHarmonics\":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],\"voltageHarmonics\":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{\"timestamp\":1644879600000,\"consumption\":36244.027,\"solar\":19223.561,\"alwaysOn\":7516.771,\"gridImport\":25542.367,\"gridExport\":8514.9,\"selfConsumption\":55.71,\"selfSufficiency\":29.53,\"active\":[13930.8,4728.1,-1630.8,4051.4,4372.2,4327.2,6473.3,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],\"reactive\":[-6001,516.4,-3231.5,1587.4,1593.2,1523.2,1000.2,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],\"voltages\":[239.5,239.8,240],\"phaseVoltages\":[239.5,239.8,240],\"currentHarmonics\":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],\"voltageHarmonics\":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{\"timestamp\":1644966000000,\"consumption\":85259.102,\"solar\":10836.264,\"alwaysOn\":7372.671,\"gridImport\":74806.539,\"gridExport\":380.3,\"selfConsumption\":96.49,\"selfSufficiency\":12.26,\"active\":[31887,24016.5,18523.7,2223.7,2513.3,2477,3624.6,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],\"reactive\":[-6358.2,453,-3835.7,1689.3,1687.6,1630.3,1034.4,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],\"voltages\":[239.4,239.3,240],\"phaseVoltages\":[239.4,239.3,240],\"currentHarmonics\":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],\"voltageHarmonics\":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{\"timestamp\":1645052400000,\"consumption\":62707.468,\"solar\":25522.268,\"alwaysOn\":6940.758,\"gridImport\":43515.601,\"gridExport\":6326.7,\"selfConsumption\":75.21,\"selfSufficiency\":30.61,\"active\":[17523.8,13335.1,6330.2,5414.1,5753.9,5699.1,8655.6,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],\"reactive\":[-4828.9,781.1,-2753.5,1456.2,1472.7,1148.8,673.4,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],\"voltages\":[238.2,238.1,238.9],\"phaseVoltages\":[238.2,238.1,238.9],\"currentHarmonics\":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],\"voltageHarmonics\":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{\"timestamp\":1645138800000,\"consumption\":42588.795,\"solar\":14926.665,\"alwaysOn\":6887.958,\"gridImport\":36598.53,\"gridExport\":8931.3,\"selfConsumption\":40.17,\"selfSufficiency\":14.07,\"active\":[13909,8941.7,4817.1,3073.6,3391.4,3339.7,5121.7,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],\"reactive\":[-4797.4,-31,-3497.5,1636.7,1618.7,1507.8,670.5,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],\"voltages\":[237.5,237.4,237.9],\"phaseVoltages\":[237.5,237.4,237.9],\"currentHarmonics\":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],\"voltageHarmonics\":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{\"timestamp\":1645225200000,\"consumption\":9367.212,\"solar\":21046.866,\"alwaysOn\":6609.45,\"gridImport\":6243.547,\"gridExport\":17918.3,\"selfConsumption\":14.86,\"selfSufficiency\":33.35,\"active\":[-988.3,-1914.2,-8770.6,4470.8,4760.1,4726.8,7089.2,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],\"reactive\":[-3363.3,436.8,-2473.5,1452.6,1427,1336.2,485.3,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],\"voltages\":[238.9,238.6,239.8],\"phaseVoltages\":[238.9,238.6,239.8],\"currentHarmonics\":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],\"voltageHarmonics\":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{\"timestamp\":1645311600000,\"consumption\":8600.461,\"solar\":5637.565,\"alwaysOn\":6480.023,\"gridImport\":6292.597,\"gridExport\":3325.8,\"selfConsumption\":41.01,\"selfSufficiency\":26.83,\"active\":[1919,1289.5,-242.4,1088.8,1378,1340.2,1830.7,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],\"reactive\":[-3809,-347.1,-3803.8,1862.2,1831.8,1774.1,1138.8,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],\"voltages\":[240.3,240.2,241.4],\"phaseVoltages\":[240.3,240.2,241.4],\"currentHarmonics\":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],\"voltageHarmonics\":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{\"timestamp\":1645398000000,\"consumption\":45459.602,\"solar\":11135.369,\"alwaysOn\":6498.023,\"gridImport\":34828.834,\"gridExport\":498.8,\"selfConsumption\":95.52,\"selfSufficiency\":23.39,\"active\":[16297,10835,7198.5,2267.5,2572.7,2534.2,3762.1,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],\"reactive\":[-5844.2,-246.3,-3733,1854.6,1855,1778.7,1070.7,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],\"voltages\":[238.9,238.4,239.7],\"phaseVoltages\":[238.9,238.4,239.7],\"currentHarmonics\":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],\"voltageHarmonics\":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{\"timestamp\":1645484400000,\"consumption\":60092.049,\"solar\":13202.869,\"alwaysOn\":6560.353,\"gridImport\":47294.881,\"gridExport\":401.3,\"selfConsumption\":96.96,\"selfSufficiency\":21.3,\"active\":[19049.5,16070.8,11774.3,2740.5,3033.9,2998.2,4429.6,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],\"reactive\":[-5556.1,263.8,-3964.4,1614.4,1617.2,1554.9,433.5,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],\"voltages\":[237.8,237.8,238.8],\"phaseVoltages\":[237.8,237.8,238.8],\"currentHarmonics\":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],\"voltageHarmonics\":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{\"timestamp\":1645570800000,\"consumption\":56437.499,\"solar\":32457.067,\"alwaysOn\":6595.189,\"gridImport\":38616.332,\"gridExport\":14631.3,\"selfConsumption\":54.92,\"selfSufficiency\":31.58,\"active\":[14769.2,10071,-854.8,6940.3,7286.3,7237.9,10992.6,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],\"reactive\":[-5485.6,876,-3095.2,1410.5,1416.8,1059.4,456.1,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],\"voltages\":[238.5,238.9,239.4],\"phaseVoltages\":[238.5,238.9,239.4],\"currentHarmonics\":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],\"voltageHarmonics\":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{\"timestamp\":1645657200000,\"consumption\":97661.618,\"solar\":20035.166,\"alwaysOn\":6638.389,\"gridImport\":79845.853,\"gridExport\":2214.6,\"selfConsumption\":88.95,\"selfSufficiency\":18.24,\"active\":[30463.9,27221.6,19946.9,4208.3,4540.4,4496.8,6789.1,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],\"reactive\":[-5419.8,722.8,-3736.4,1591,1598.6,1515.5,596,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],\"voltages\":[238.5,238.9,239.4],\"phaseVoltages\":[238.5,238.9,239.4],\"currentHarmonics\":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],\"voltageHarmonics\":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{\"timestamp\":1645743600000,\"consumption\":30621.484,\"solar\":28097.468,\"alwaysOn\":6780.001,\"gridImport\":13514.217,\"gridExport\":10984.9,\"selfConsumption\":60.9,\"selfSufficiency\":55.87,\"active\":[6081.4,3235.1,-6786.9,5965.6,6307.4,6258.3,9567.8,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],\"reactive\":[-5472.9,285.6,-4076.7,1594.4,1595.6,1342.4,657.3,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],\"voltages\":[238.5,238.8,239.4],\"phaseVoltages\":[238.5,238.8,239.4],\"currentHarmonics\":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],\"voltageHarmonics\":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{\"timestamp\":1645830000000,\"consumption\":24344.755,\"solar\":40177.364,\"alwaysOn\":6526.662,\"gridImport\":9954.492,\"gridExport\":25782.4,\"selfConsumption\":35.83,\"selfSufficiency\":59.11,\"active\":[104.8,-1107.2,-14824.6,8601.3,8946,8909.8,13721.4,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],\"reactive\":[-3498,1291,-1251.2,1367.8,1345.7,1053.3,230.6,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],\"voltages\":[241.2,241.6,242.6],\"phaseVoltages\":[241.2,241.6,242.6],\"currentHarmonics\":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],\"voltageHarmonics\":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{\"timestamp\":1645916400000,\"consumption\":38663.772,\"solar\":42488.861,\"alwaysOn\":6364.799,\"gridImport\":8377.912,\"gridExport\":12196.7,\"selfConsumption\":71.29,\"selfSufficiency\":78.33,\"active\":[-3413.4,6983.6,-7389,9141.1,9459.9,9426.3,14461.8,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],\"reactive\":[-3745.7,1964,-320.5,1368.6,1341.9,944.9,63.5,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],\"voltages\":[240.6,240.6,241.4],\"phaseVoltages\":[240.6,240.6,241.4],\"currentHarmonics\":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],\"voltageHarmonics\":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]},{\"timestamp\":1646002800000,\"consumption\":36852.209,\"solar\":41696.564,\"alwaysOn\":6418.799,\"gridImport\":18185.846,\"gridExport\":23023.6,\"selfConsumption\":44.78,\"selfSufficiency\":50.65,\"active\":[7065.7,469.8,-12372.5,8951.4,9306.3,9248.5,14190.8,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],\"reactive\":[-5469.3,1187.9,-2515.5,1514.5,1454.9,1219.5,1076.2,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null],\"voltages\":[240.6,240.4,241.2],\"phaseVoltages\":[240.6,240.4,241.2],\"currentHarmonics\":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]],\"voltageHarmonics\":[[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]]}]}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1090,"y":300,"wires":[["3d9d1185162fb347"]]},{"id":"3da8f37f485e2020","type":"inject","z":"47e39c5606fd1f5d","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":1040,"y":260,"wires":[["67b0f6dde881d202"]]},{"id":"b9fbdeb2691cbabc","type":"ui_group","name":"Meetgegevens:","tab":"a67420ad81558175","order":2,"disp":true,"width":"6","collapse":false,"className":""},{"id":"a67420ad81558175","type":"ui_tab","name":"Spanning","icon":"dashboard","order":6,"disabled":false,"hidden":true}]

Replace your function code with this...

const rotated = {
    Tijd: [],
    L1: [],
    L2: [],
    L3: [],

}

const chartData = [{
    "series": ["L1", "L2", "L3"],
    "data": [
        [],
        [],
        []
    ],
    "labels": [""]
}]

const APIdata = msg.payload.consumptions;
for (var i = 0; i < APIdata.length; i++) {

    rotated.Tijd[i] = APIdata[i].timestamp
    rotated.L1[i] = APIdata[i].voltages[0]
    rotated.L2[i] = APIdata[i].voltages[1]
    rotated.L3[i] = APIdata[i].voltages[2]

    chartData[0].data[0].push({ "x": rotated.Tijd[i], "y": rotated.L1[i] })
    chartData[0].data[1].push({ "x": rotated.Tijd[i], "y": rotated.L2[i] })
    chartData[0].data[2].push({ "x": rotated.Tijd[i], "y": rotated.L3[i] })
}

msg.rotatedData = rotated;
msg.payload = chartData;

return msg;
1 Like

Thanks @Steve-Mcl

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