Monitor your solar PV system by the energy meter of IAMMETER
IAMMETER provide the WiFi version of both single-phase energy meter and three-phase energy meter. In this flow, it is easy to monitor your solar PV system by the energy meter of IAMMETER.
Demo
Node-RED UI: http://ha.iammeter.com:11880/ui
Node-RED flow: http://ha.iammeter.com:11880/#flow/5fb9966c8a33b771
Node-RED in Homeassistant: http://ha.iammeter.com:18123/nodered user/password: iammeter/iammeter
IAMMETER energy monitor node in Node-Red
Reference
Use IAMMETER energy monitor in Node-Red
[{"id":"5fb9966c8a33b771","type":"tab","label":"solar","disabled":false,"info":"","env":[]},{"id":"8678eaf55bd1f562","type":"inject","z":"5fb9966c8a33b771","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payloadType":"date","x":722,"y":57,"wires":[["66abcc8eae679991"]]},{"id":"d52c8e481eb959b8","type":"debug","z":"5fb9966c8a33b771","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":179,"y":543,"wires":[]},{"id":"02ad8acebdd33fc7","type":"function","z":"5fb9966c8a33b771","name":"meter_a","func":"let dataArr = msg.payload[0];\n\nlet result = [];\nfor(var item in dataArr) {\n result.push({\n payload: dataArr[item]\n });\n}\n\nreturn result;\n\n//output\n/* \nVoltage\nCurrent\nPower\nImportenergy\nExportgrid\n*/","outputs":5,"noerr":0,"initialize":"","finalize":"","libs":[],"x":400,"y":220,"wires":[[],[],[],[],[]]},{"id":"6d671c77a682e9a1","type":"function","z":"5fb9966c8a33b771","name":"meter_b","func":"let dataArr = msg.payload[1];\n\nlet result = [];\nfor(var item in dataArr) {\n result.push({\n payload: dataArr[item]\n });\n}\n\nreturn result;\n\n//output\n/* \nVoltage\nCurrent\nPower\nImportenergy\nExportgrid\n*/","outputs":5,"noerr":0,"initialize":"","finalize":"","libs":[],"x":400,"y":320,"wires":[[],[],[],[],[]]},{"id":"b3f3557fd1df50f7","type":"function","z":"5fb9966c8a33b771","name":"meter_c","func":"let dataArr = msg.payload[2];\n\nlet result = [];\nfor(var item in dataArr) {\n result.push({\n payload: dataArr[item]\n });\n}\n\nreturn result;\n\n//output\n/* \nVoltage\nCurrent\nPower\nImportenergy\nExportgrid\n*/","outputs":5,"noerr":0,"initialize":"","finalize":"","libs":[],"x":400,"y":420,"wires":[[],[],[],[],[]]},{"id":"66abcc8eae679991","type":"function","z":"5fb9966c8a33b771","name":"host","func":"//iammeter IP\nmsg.host = 'https://www.iammeter.com/api/v1/site/meterdata/B384789C?token=ec0aeb9c07e24368b5fd9bb3b42a3095'\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":742,"y":137,"wires":[["1bed83dbb6ab0660"]]},{"id":"1bed83dbb6ab0660","type":"http request","z":"5fb9966c8a33b771","name":"api","method":"GET","ret":"obj","paytoqs":"ignore","url":"{{{host}}}","tls":"","persist":false,"proxy":"","authType":"","senderr":false,"x":742,"y":197,"wires":[[]]},{"id":"a5cc5d653e80f26d","type":"comment","z":"5fb9966c8a33b771","name":"output","info":"Voltage\nCurrent\nPower\nImportenergy\nExportgrid","x":390,"y":160,"wires":[]},{"id":"d730ce29db99d728","type":"function","z":"5fb9966c8a33b771","name":"meter_solar","func":"var solar_voltage_a = msg.payload[0][0]\nvar solar_current_a = msg.payload[0][1]\nvar solar_power_a = msg.payload[0][2]\nvar solar_importenergy_a = msg.payload[0][3]\nvar solar_exportgrid_a = msg.payload[0][4]\n\nvar solar_voltage_b = msg.payload[1][0]\nvar solar_current_b = msg.payload[1][1]\nvar solar_power_b = msg.payload[1][2]\nvar solar_importenergy_b = msg.payload[1][3]\nvar solar_exportgrid_b = msg.payload[1][4]\n\n/* //not use\nvar solar_voltage_c = msg.payload[2][0]\nvar solar_current_c = msg.payload[2][1]\nvar solar_power_c = msg.payload[2][2]\nvar solar_importenergy_c = msg.payload[2][3]\nvar solar_exportgrid_c = msg.payload[2][4]\n*/\n\nvar inverter_power = solar_power_a\nvar feedin_power = -solar_power_b\nvar load_power = solar_power_a + solar_power_b \n\nvar grid_consumption_energy\nvar exported_energy\nvar yield_energy\nvar selfuse_energy\nvar load_energy\n\nif(solar_importenergy_b > 0){\n grid_consumption_energy = solar_importenergy_b\n}\nif(solar_exportgrid_b > 0){\n exported_energy = solar_exportgrid_b\n}\nif(solar_importenergy_a > 0){\n yield_energy = solar_importenergy_a\n}\nif( (yield_energy - exported_energy) > 0){\n selfuse_energy = yield_energy - exported_energy\n}\nif( (grid_consumption_energy + yield_energy - exported_energy) > 0){\n load_energy = grid_consumption_energy + yield_energy - exported_energy\n}\n\nglobal.set(\"grid_consumption_energy_total\", grid_consumption_energy, \"store\");\nglobal.set(\"yield_energy_total\", yield_energy, \"store\");\nglobal.set(\"exported_energy_total\", exported_energy, \"store\");\nglobal.set(\"selfuse_energy_total\", selfuse_energy, \"store\");\nglobal.set(\"load_energy_total\", load_energy, \"store\");\n\nvar newmsg = [\n {topic:\"inverter_power\",payload:inverter_power},\n {topic:\"feedin_power\",payload:feedin_power},\n {topic:\"load_power\",payload:load_power},\n {topic:\"grid_consumption_energy\",payload:grid_consumption_energy},\n {topic:\"yield_energy\",payload:yield_energy},\n {topic:\"exported_energy\",payload:exported_energy},\n {topic:\"selfuse_energy\",payload:selfuse_energy},\n {topic:\"load_energy\",payload:load_energy}\n ];\n \nreturn newmsg;\n\n\n\n\n\n\n\n\n\n\n\n\n\n","outputs":8,"noerr":0,"initialize":"","finalize":"","libs":[],"x":410,"y":600,"wires":[["a8660ba81df4fb65"],["e5aad7b550476446"],["5bde2ce728ad1e78"],["317cc3a847e8e91c"],["39edd89b313d48b6"],["8a0ce9922e7d57c1"],["d867e7e844eac84a"],["9f738ef4c3a59443"]]},{"id":"a8660ba81df4fb65","type":"function","z":"5fb9966c8a33b771","name":"inverter_power","func":"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":660,"y":380,"wires":[["3014ea28d8d88b86","0f6bd877cd8395f0","8d6c46fdb05ca9d6"]]},{"id":"e5aad7b550476446","type":"function","z":"5fb9966c8a33b771","name":"feedin_power","func":"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":660,"y":420,"wires":[["0f6bd877cd8395f0","50e3ecce551d9973","8d6c46fdb05ca9d6"]]},{"id":"5bde2ce728ad1e78","type":"function","z":"5fb9966c8a33b771","name":"load_power","func":"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":650,"y":460,"wires":[["0f6bd877cd8395f0","5c4b5ed9a14f353d","8d6c46fdb05ca9d6"]]},{"id":"317cc3a847e8e91c","type":"function","z":"5fb9966c8a33b771","name":"grid_consumption_energy","func":"//Daily\ndaily_tmp1 = global.get(\"grid_consumption_energy_T0\", \"store\")||msg.payload;\ndaily_tmp = msg.payload - daily_tmp1;\nglobal.set(\"grid_consumption_energy_daily\",daily_tmp, \"store\");\n//Monthly\nmonthly_tmp1 = global.get(\"grid_consumption_energy_MT0\", \"store\")||msg.payload;\nmonthly_tmp = msg.payload - monthly_tmp1;\nglobal.set(\"grid_consumption_energy_monthly\",monthly_tmp, \"store\");\n\nif(flow.get(\"display_mode\")){\n msg.topic = \"grid_consumption_energy_daily\"\n msg.payload = parseFloat(daily_tmp).toFixed(2)\n}else{\n msg.topic = \"grid_consumption_energy_monthly\"\n msg.payload = parseFloat(monthly_tmp).toFixed(2) \n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":690,"y":580,"wires":[["252a4574e01f6906"]]},{"id":"4ded64235b5ee698","type":"inject","z":"5fb9966c8a33b771","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payloadType":"date","x":120,"y":60,"wires":[["9cace94d0fd39aac","b77aaa97d09c0e6a"]]},{"id":"39edd89b313d48b6","type":"function","z":"5fb9966c8a33b771","name":"yield_energy","func":"//Daily\ndaily_tmp1 = global.get(\"yield_energy_T0\", \"store\")||msg.payload;\ndaily_tmp = msg.payload - daily_tmp1;\nglobal.set(\"yield_energy_daily\",daily_tmp, \"store\");\n//Monthly\nmonthly_tmp1 = global.get(\"yield_energy_MT0\", \"store\")||msg.payload;\nmonthly_tmp = msg.payload - monthly_tmp1;\nglobal.set(\"yield_energy_monthly\",monthly_tmp, \"store\");\n\nif(flow.get(\"display_mode\")){\n msg.topic = \"yield_energy_daily\"\n msg.payload = parseFloat(daily_tmp).toFixed(2)\n}else{\n msg.topic = \"yield_energy_monthly\"\n msg.payload = parseFloat(monthly_tmp).toFixed(2) \n}\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":650,"y":620,"wires":[["211dfd9f857354de"]]},{"id":"8a0ce9922e7d57c1","type":"function","z":"5fb9966c8a33b771","name":"exported_energy","func":"//Daily\ndaily_tmp1 = global.get(\"exported_energy_T0\", \"store\")||msg.payload;\ndaily_tmp = msg.payload - daily_tmp1;\nglobal.set(\"exported_energy_daily\",daily_tmp, \"store\");\n//Monthly\nmonthly_tmp1 = global.get(\"exported_energy_MT0\", \"store\")||msg.payload;\nmonthly_tmp = msg.payload - monthly_tmp1;\nglobal.set(\"exported_energy_monthly\",monthly_tmp, \"store\");\n\nif(flow.get(\"display_mode\")){\n msg.topic = \"exported_energy_daily\"\n msg.payload = parseFloat(daily_tmp).toFixed(2)\n}else{\n msg.topic = \"exported_energy_monthly\"\n msg.payload = parseFloat(monthly_tmp).toFixed(2) \n}\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":670,"y":660,"wires":[["abd393ead8616e64","5dcda21d69b4b05f","5db20b6b73bc277a","2085d0721708278b"]]},{"id":"d867e7e844eac84a","type":"function","z":"5fb9966c8a33b771","name":"selfuse_energy","func":"//Daily\ndaily_tmp1 = global.get(\"selfuse_energy_T0\", \"store\")||msg.payload;\ndaily_tmp = msg.payload - daily_tmp1;\nglobal.set(\"selfuse_energy_daily\",daily_tmp, \"store\");\n//Monthly\nmonthly_tmp1 = global.get(\"selfuse_energy_MT0\", \"store\")||msg.payload;\nmonthly_tmp = msg.payload - monthly_tmp1;\nglobal.set(\"selfuse_energy_monthly\",monthly_tmp, \"store\");\n\nif(flow.get(\"display_mode\")){\n msg.topic = \"selfuse_energy_daily\"\n msg.payload = parseFloat(daily_tmp).toFixed(2)\n}else{\n msg.topic = \"selfuse_energy_monthly\"\n msg.payload = parseFloat(monthly_tmp).toFixed(2) \n}\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":660,"y":700,"wires":[["f96a508e972c38e9","5c6acd9c909da96f","f7559f9961f8235e","db0dda255fdddd2b"]]},{"id":"9f738ef4c3a59443","type":"function","z":"5fb9966c8a33b771","name":"load_energy","func":"//Daily\ndaily_tmp1 = global.get(\"load_energy_T0\", \"store\")||msg.payload;\ndaily_tmp = msg.payload - daily_tmp1;\nglobal.set(\"load_energy_daily\",daily_tmp, \"store\");\n//Monthly\nmonthly_tmp1 = global.get(\"load_energy_MT0\", \"store\")||msg.payload;\nmonthly_tmp = msg.payload - monthly_tmp1;\nglobal.set(\"load_energy_monthly\",monthly_tmp, \"store\");\n\nif(flow.get(\"display_mode\")){\n msg.topic = \"load_energy_daily\"\n msg.payload = parseFloat(daily_tmp).toFixed(2)\n}else{\n msg.topic = \"load_energy_monthly\"\n msg.payload = parseFloat(monthly_tmp).toFixed(2) \n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":650,"y":740,"wires":[[]]},{"id":"367fe3ef44eb1e0a","type":"comment","z":"5fb9966c8a33b771","name":"output","info":"inverter_power\nfeedin_power\nload_power\ngrid_consumption_energy\nyield_energy\nexported_energy\nselfuse_energy\nload_energy","x":390,"y":520,"wires":[]},{"id":"f96a508e972c38e9","type":"function","z":"5fb9966c8a33b771","name":"self_consumption_rate","func":"//Daily\nvar daily_tmp1 = global.get(\"selfuse_energy_daily\", \"store\");\nvar daily_tmp2 = global.get(\"yield_energy_daily\", \"store\");\nvar daily_tmp = parseFloat(daily_tmp1)*100/parseFloat(daily_tmp2)||0;\nglobal.set(\"self_consumption_rate_daily\",daily_tmp, \"store\");\n//Monthly\nvar monthly_tmp1 = global.get(\"selfuse_energy_monthly\", \"store\");\nvar monthly_tmp2 = global.get(\"yield_energy_monthly\", \"store\");\nvar monthly_tmp = parseFloat(monthly_tmp1)*100/parseFloat(monthly_tmp2)||0;\n\nglobal.set(\"self_consumption_rate_monthly\",monthly_tmp, \"store\");\n\n\nif(flow.get(\"display_mode\")){\n msg.topic = \"self_consumption_rate_daily\"\n msg.payload = parseFloat(daily_tmp).toFixed(2)\n}else{\n msg.topic = \"self_consumption_rate_monthly\"\n msg.payload = parseFloat(monthly_tmp).toFixed(2) \n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1000,"y":960,"wires":[["8cfc7efe1c0d8816"]]},{"id":"ccb48855dfb0c7e4","type":"inject","z":"5fb9966c8a33b771","name":"Start of the day","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"00 00 * * *","once":false,"onceDelay":0.1,"topic":"","payloadType":"date","x":140,"y":1260,"wires":[["1447880611d244c5"]]},{"id":"1447880611d244c5","type":"function","z":"5fb9966c8a33b771","name":"Monthly_Init","func":"\n//let day = (new Date()).getDate()\nvar d=new Date();\nvar day=d.getDate();\nvar month=d.getMonth()+1;\n//var year=d.getFullYear();\nif(day<=9)\nday=\"0\"+day;\nif(month<=9)\nmonth=\"0\"+month+1;\nvar date_out= month;\n\nif(1==day){\n global.set(\"date_out_M0\",date_out, \"store\");\n global.set(\"date_out_M11\",global.get(\"date_out_M10\", \"store\")||0, \"store\");\n global.set(\"date_out_M10\",global.get(\"date_out_M9\", \"store\")||0, \"store\");\n global.set(\"date_out_M9\",global.get(\"date_out_M8\", \"store\")||0, \"store\");\n global.set(\"date_out_M8\",global.get(\"date_out_M7\", \"store\")||0, \"store\");\n global.set(\"date_out_M7\",global.get(\"date_out_M6\", \"store\")||0, \"store\");\n global.set(\"date_out_M6\",global.get(\"date_out_M5\", \"store\")||0, \"store\");\n global.set(\"date_out_M5\",global.get(\"date_out_M4\", \"store\")||0, \"store\");\n global.set(\"date_out_M4\",global.get(\"date_out_M3\", \"store\")||0, \"store\");\n global.set(\"date_out_M3\",global.get(\"date_out_M2\", \"store\")||0, \"store\");\n global.set(\"date_out_M2\",global.get(\"date_out_M1\", \"store\")||0, \"store\");\n global.set(\"date_out_M1\",global.get(\"date_out_M0\", \"store\"), \"store\"); \n\n \n global.set(\"grid_consumption_energy_MT0\",global.get(\"grid_consumption_energy_total\", \"store\"), \"store\");\n global.set(\"yield_energy_MT0\",global.get(\"yield_energy_total\", \"store\"), \"store\");\n global.set(\"exported_energy_MT0\",global.get(\"exported_energy_total\", \"store\"), \"store\");\n global.set(\"selfuse_energy_MT0\",global.get(\"selfuse_energy_total\", \"store\"), \"store\");\n global.set(\"load_energy_MT0\",global.get(\"load_energy_total\", \"store\"), \"store\");\n \n global.set(\"yield_energy_M11\",global.get(\"yield_energy_M10\", \"store\")||0, \"store\");\n global.set(\"yield_energy_M10\",global.get(\"yield_energy_M9\", \"store\")||0, \"store\");\n global.set(\"yield_energy_M9\",global.get(\"yield_energy_M8\", \"store\")||0, \"store\");\n global.set(\"yield_energy_M8\",global.get(\"yield_energy_M7\", \"store\")||0, \"store\");\n global.set(\"yield_energy_M7\",global.get(\"yield_energy_M6\", \"store\")||0, \"store\");\n global.set(\"yield_energy_M6\",global.get(\"yield_energy_M5\", \"store\")||0, \"store\");\n global.set(\"yield_energy_M5\",global.get(\"yield_energy_M4\", \"store\")||0, \"store\");\n global.set(\"yield_energy_M4\",global.get(\"yield_energy_M3\", \"store\")||0, \"store\");\n global.set(\"yield_energy_M3\",global.get(\"yield_energy_M2\", \"store\")||0, \"store\");\n global.set(\"yield_energy_M2\",global.get(\"yield_energy_M1\", \"store\")||0, \"store\");\n global.set(\"yield_energy_M1\",global.get(\"yield_energy_monthly\", \"store\"), \"store\");\n \n global.set(\"exported_energy_M11\",global.get(\"exported_energy_M10\", \"store\")||0, \"store\");\n global.set(\"exported_energy_M10\",global.get(\"exported_energy_M9\", \"store\")||0, \"store\");\n global.set(\"exported_energy_M9\",global.get(\"exported_energy_M8\", \"store\")||0, \"store\");\n global.set(\"exported_energy_M8\",global.get(\"exported_energy_M7\", \"store\")||0, \"store\");\n global.set(\"exported_energy_M7\",global.get(\"exported_energy_M6\", \"store\")||0, \"store\");\n global.set(\"exported_energy_M6\",global.get(\"exported_energy_M5\", \"store\")||0, \"store\");\n global.set(\"exported_energy_M5\",global.get(\"exported_energy_M4\", \"store\")||0, \"store\");\n global.set(\"exported_energy_M4\",global.get(\"exported_energy_M3\", \"store\")||0, \"store\");\n global.set(\"exported_energy_M3\",global.get(\"exported_energy_M2\", \"store\")||0, \"store\");\n global.set(\"exported_energy_M2\",global.get(\"exported_energy_M1\", \"store\")||0, \"store\");\n global.set(\"exported_energy_M1\",global.get(\"exported_energy_monthly\", \"store\"), \"store\"); \n \n global.set(\"selfuse_energy_M11\",global.get(\"selfuse_energy_M10\", \"store\")||0, \"store\");\n global.set(\"selfuse_energy_M10\",global.get(\"selfuse_energy_M9\", \"store\")||0, \"store\");\n global.set(\"selfuse_energy_M9\",global.get(\"selfuse_energy_M8\", \"store\")||0, \"store\");\n global.set(\"selfuse_energy_M8\",global.get(\"selfuse_energy_M7\", \"store\")||0, \"store\");\n global.set(\"selfuse_energy_M7\",global.get(\"selfuse_energy_M6\", \"store\")||0, \"store\");\n global.set(\"selfuse_energy_M6\",global.get(\"selfuse_energy_M5\", \"store\")||0, \"store\");\n global.set(\"selfuse_energy_M5\",global.get(\"selfuse_energy_M4\", \"store\")||0, \"store\");\n global.set(\"selfuse_energy_M4\",global.get(\"selfuse_energy_M3\", \"store\")||0, \"store\");\n global.set(\"selfuse_energy_M3\",global.get(\"selfuse_energy_M2\", \"store\")||0, \"store\");\n global.set(\"selfuse_energy_M2\",global.get(\"selfuse_energy_M1\", \"store\")||0, \"store\");\n global.set(\"selfuse_energy_M1\",global.get(\"load_energy_monthly\", \"store\"), \"store\");\n\n global.set(\"grid_consumption_energy_monthly\",0, \"store\");\n global.set(\"yield_energy_monthly\",0, \"store\");\n global.set(\"exported_energy_monthly\",0, \"store\");\n global.set(\"selfuse_energy_monthly\",0, \"store\");\n global.set(\"load_energy_monthly\",0, \"store\");\n global.set(\"self_consumption_rate_monthly\",0, \"store\");\n \n}\nreturn null;\n\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":370,"y":1260,"wires":[[]]},{"id":"caccd3c6ce8c8b3f","type":"inject","z":"5fb9966c8a33b771","name":"Start of the day","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"00 00 * * *","once":false,"onceDelay":0.1,"topic":"","payloadType":"date","x":140,"y":1200,"wires":[["1e7068f30083686d"]]},{"id":"1e7068f30083686d","type":"function","z":"5fb9966c8a33b771","name":"Daily_Init","func":"\nvar d=new Date();\nvar day=d.getDate();\nvar month=d.getMonth()+1;\n//var year=d.getFullYear();\nif(day<=9)\nday=\"0\"+day;\nif(month<=9)\nmonth=\"0\"+month+1;\nvar date_out= day+\"/\"+month;\n\n global.set(\"date_out_D0\",date_out, \"store\");\n global.set(\"date_out_D7\",global.get(\"date_out_D6\", \"store\")||0, \"store\");\n global.set(\"date_out_D6\",global.get(\"date_out_D5\", \"store\")||0, \"store\");\n global.set(\"date_out_D5\",global.get(\"date_out_D4\", \"store\")||0, \"store\");\n global.set(\"date_out_D4\",global.get(\"date_out_D3\", \"store\")||0, \"store\");\n global.set(\"date_out_D3\",global.get(\"date_out_D2\", \"store\")||0, \"store\");\n global.set(\"date_out_D2\",global.get(\"date_out_D1\", \"store\")||0, \"store\");\n global.set(\"date_out_D1\",global.get(\"date_out_D0\", \"store\"), \"store\"); \n\n \n global.set(\"grid_consumption_energy_T0\",global.get(\"grid_consumption_energy_total\", \"store\"), \"store\");\n global.set(\"yield_energy_T0\",global.get(\"yield_energy_total\", \"store\"), \"store\");\n global.set(\"exported_energy_T0\",global.get(\"exported_energy_total\", \"store\"), \"store\");\n global.set(\"selfuse_energy_T0\",global.get(\"selfuse_energy_total\", \"store\"), \"store\");\n global.set(\"load_energy_T0\",global.get(\"load_energy_total\", \"store\"), \"store\");\n\n global.set(\"yield_energy_D7\",global.get(\"yield_energy_D6\", \"store\")||0, \"store\");\n global.set(\"yield_energy_D6\",global.get(\"yield_energy_D5\", \"store\")||0, \"store\");\n global.set(\"yield_energy_D5\",global.get(\"yield_energy_D4\", \"store\")||0, \"store\");\n global.set(\"yield_energy_D4\",global.get(\"yield_energy_D3\", \"store\")||0, \"store\");\n global.set(\"yield_energy_D3\",global.get(\"yield_energy_D2\", \"store\")||0, \"store\");\n global.set(\"yield_energy_D2\",global.get(\"yield_energy_D1\", \"store\")||0, \"store\");\n global.set(\"yield_energy_D1\",global.get(\"yield_energy_daily\", \"store\"), \"store\");\n \n global.set(\"exported_energy_D7\",global.get(\"exported_energy_D6\", \"store\")||0, \"store\");\n global.set(\"exported_energy_D6\",global.get(\"exported_energy_D5\", \"store\")||0, \"store\");\n global.set(\"exported_energy_D5\",global.get(\"exported_energy_D4\", \"store\")||0, \"store\");\n global.set(\"exported_energy_D4\",global.get(\"exported_energy_D3\", \"store\")||0, \"store\");\n global.set(\"exported_energy_D3\",global.get(\"exported_energy_D2\", \"store\")||0, \"store\");\n global.set(\"exported_energy_D2\",global.get(\"exported_energy_D1\", \"store\")||0, \"store\");\n global.set(\"exported_energy_D1\",global.get(\"exported_energy_daily\", \"store\"), \"store\"); \n\n global.set(\"selfuse_energy_D7\",global.get(\"selfuse_energy_D6\", \"store\")||0, \"store\");\n global.set(\"selfuse_energy_D6\",global.get(\"selfuse_energy_D5\", \"store\")||0, \"store\");\n global.set(\"selfuse_energy_D5\",global.get(\"selfuse_energy_D4\", \"store\")||0, \"store\");\n global.set(\"selfuse_energy_D4\",global.get(\"selfuse_energy_D3\", \"store\")||0, \"store\");\n global.set(\"selfuse_energy_D3\",global.get(\"selfuse_energy_D2\", \"store\")||0, \"store\");\n global.set(\"selfuse_energy_D2\",global.get(\"selfuse_energy_D1\", \"store\")||0, \"store\");\n global.set(\"selfuse_energy_D1\",global.get(\"load_energy_daily\", \"store\"), \"store\");\n\n global.set(\"grid_consumption_energy_daily\",0, \"store\");\n global.set(\"yield_energy_daily\",0, \"store\");\n global.set(\"exported_energy_daily\",0, \"store\");\n global.set(\"selfuse_energy_daily\",0, \"store\");\n global.set(\"load_energy_daily\",0, \"store\");\n global.set(\"self_consumption_rate_daily\",0, \"store\");\n \nreturn null;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":360,"y":1200,"wires":[[]]},{"id":"abd393ead8616e64","type":"function","z":"5fb9966c8a33b771","name":"Energy Display","func":"\nvar State = msg.payload;\nvar title = [];\nvar label = [];\nvar data = [];\nif(flow.get(\"display_mode\")){\n title = [\"yield_energy_Daliy\",\"exported_energy_Daily\",\"selfuse_energy_Daliy\"]\n\n energy_yield_0 = global.get(\"yield_energy_daily\", \"store\");\n energy_yield_1 = global.get(\"yield_energy_D1\", \"store\");\n energy_yield_2 = global.get(\"yield_energy_D2\", \"store\");\n energy_yield_3 = global.get(\"yield_energy_D3\", \"store\");\n energy_yield_4 = global.get(\"yield_energy_D4\", \"store\");\n energy_yield_5 = global.get(\"yield_energy_D5\", \"store\");\n energy_yield_6 = global.get(\"yield_energy_D6\", \"store\");\n energy_yield_7 = global.get(\"yield_energy_D7\", \"store\");\n data_yield = [energy_yield_7,energy_yield_6,energy_yield_5,energy_yield_4,energy_yield_3,energy_yield_2,energy_yield_1,energy_yield_0];\n\n energy_exported_0 = global.get(\"exported_energy_daily\", \"store\");\n energy_exported_1 = global.get(\"exported_energy_D1\", \"store\");\n energy_exported_2 = global.get(\"exported_energy_D2\", \"store\");\n energy_exported_3 = global.get(\"exported_energy_D3\", \"store\");\n energy_exported_4 = global.get(\"exported_energy_D4\", \"store\");\n energy_exported_5 = global.get(\"exported_energy_D5\", \"store\");\n energy_exported_6 = global.get(\"exported_energy_D6\", \"store\");\n energy_exported_7 = global.get(\"exported_energy_D7\", \"store\");\n data_exported = [energy_exported_7,energy_exported_6,energy_exported_5,energy_exported_4,energy_exported_3,energy_exported_2,energy_exported_1,energy_exported_0];\n\n energy_selfuse_0 = global.get(\"selfuse_energy_daily\", \"store\");\n energy_selfuse_1 = global.get(\"selfuse_energy_D1\", \"store\");\n energy_selfuse_2 = global.get(\"selfuse_energy_D2\", \"store\");\n energy_selfuse_3 = global.get(\"selfuse_energy_D3\", \"store\");\n energy_selfuse_4 = global.get(\"selfuse_energy_D4\", \"store\");\n energy_selfuse_5 = global.get(\"selfuse_energy_D5\", \"store\");\n energy_selfuse_6 = global.get(\"selfuse_energy_D6\", \"store\");\n energy_selfuse_7 = global.get(\"selfuse_energy_D7\", \"store\");\n data_selfuse = [energy_selfuse_7,energy_selfuse_6,energy_selfuse_5,energy_selfuse_4,energy_selfuse_3,energy_selfuse_2,energy_selfuse_1,energy_selfuse_0];\n data = [data_yield,data_exported,data_selfuse];\n \n date0 = global.get(\"date_out_D0\", \"store\");\n date1 = global.get(\"date_out_D1\", \"store\");\n date2 = global.get(\"date_out_D2\", \"store\");\n date3 = global.get(\"date_out_D3\", \"store\");\n date4 = global.get(\"date_out_D4\", \"store\");\n date5 = global.get(\"date_out_D5\", \"store\");\n date6 = global.get(\"date_out_D6\", \"store\");\n date7 = global.get(\"date_out_D7\", \"store\");\n label = [date7,date6,date5,date4,date3,date2,date1,date0];\n msg.topic = \"Energy Daily\"\n}else{\n title = [\"yield_energy_Monthly\",\"exported_energy_Monthly\",\"selfuse_energy_Monthly\"]\n \n energy_yield_0 = global.get(\"yield_energy_monthly\", \"store\");\n energy_yield_1 = global.get(\"yield_energy_M1\", \"store\");\n energy_yield_2 = global.get(\"yield_energy_M2\", \"store\");\n energy_yield_3 = global.get(\"yield_energy_M3\", \"store\");\n energy_yield_4 = global.get(\"yield_energy_M4\", \"store\");\n energy_yield_5 = global.get(\"yield_energy_M5\", \"store\");\n energy_yield_6 = global.get(\"yield_energy_M6\", \"store\");\n energy_yield_7 = global.get(\"yield_energy_M7\", \"store\");\n data_yield = [energy_yield_7,energy_yield_6,energy_yield_5,energy_yield_4,energy_yield_3,energy_yield_2,energy_yield_1,energy_yield_0];\n\n energy_exported_0 = global.get(\"exported_energy_monthly\", \"store\");\n energy_exported_1 = global.get(\"exported_energy_M1\", \"store\");\n energy_exported_2 = global.get(\"exported_energy_M2\", \"store\");\n energy_exported_3 = global.get(\"exported_energy_M3\", \"store\");\n energy_exported_4 = global.get(\"exported_energy_M4\", \"store\");\n energy_exported_5 = global.get(\"exported_energy_M5\", \"store\");\n energy_exported_6 = global.get(\"exported_energy_M6\", \"store\");\n energy_exported_7 = global.get(\"exported_energy_M7\", \"store\");\n data_exported = [energy_exported_7,energy_exported_6,energy_exported_5,energy_exported_4,energy_exported_3,energy_exported_2,energy_exported_1,energy_exported_0];\n\n energy_selfuse_0 = global.get(\"selfuse_energy_monthly\", \"store\");\n energy_selfuse_1 = global.get(\"selfuse_energy_M1\", \"store\");\n energy_selfuse_2 = global.get(\"selfuse_energy_M2\", \"store\");\n energy_selfuse_3 = global.get(\"selfuse_energy_M3\", \"store\");\n energy_selfuse_4 = global.get(\"selfuse_energy_M4\", \"store\");\n energy_selfuse_5 = global.get(\"selfuse_energy_M5\", \"store\");\n energy_selfuse_6 = global.get(\"selfuse_energy_M6\", \"store\");\n energy_selfuse_7 = global.get(\"selfuse_energy_M7\", \"store\");\n data_selfuse = [energy_selfuse_7,energy_selfuse_6,energy_selfuse_5,energy_selfuse_4,energy_selfuse_3,energy_selfuse_2,energy_selfuse_1,energy_selfuse_0];\n data = [data_yield,data_exported,data_selfuse];\n \n date0 = global.get(\"date_out_M0\", \"store\");\n date1 = global.get(\"date_out_M1\", \"store\");\n date2 = global.get(\"date_out_M2\", \"store\");\n date3 = global.get(\"date_out_M3\", \"store\");\n date4 = global.get(\"date_out_M4\", \"store\");\n date5 = global.get(\"date_out_M5\", \"store\");\n date6 = global.get(\"date_out_M6\", \"store\");\n date7 = global.get(\"date_out_M7\", \"store\");\n label = [date7,date6,date5,date4,date3,date2,date1,date0];\n msg.topic = \"Energy Monthly\"\n}\nvar payload = [{\n \"series\":title,\n \"data\":data,\n \"labels\":label,\n\n }]\nmsg.payload = payload\n\nreturn msg\n\n\n/*\nvar m={\n \"series\":[\"X\",\"Y\",\"Z\"],\n \"data\":[[5,6,9],[3,8,5],[6,7,2]],\n \"labels\":[\"Jan\",\"Feb\",\"Mar\"]\n};\nreturn {payload:[m]};\n*/\n\n\n\n\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":980,"y":1020,"wires":[["11886ac37351e3e2"]]},{"id":"60c71ef667239da7","type":"function","z":"5fb9966c8a33b771","name":"Daily_Init_Test","func":"\nvar d=new Date();\nvar day=d.getDate();\nvar month=d.getMonth()+1;\n//var year=d.getFullYear();\nif(day<=9)\nday=\"0\"+day;\nif(month<=9)\nmonth=\"0\"+month+1;\nvar date_out= day+\"/\"+month;\n \nkey1 = \"date_out_D7\"\nkey2 = \"date_out_D6\"\nkey3 = \"date_out_D5\"\nkey4 = \"date_out_D4\"\nkey5 = \"date_out_D3\"\nkey6 = \"date_out_D2\"\nkey7 = \"date_out_D1\"\nkey8 = \"date_out_D0\"\n\nvalue1 = \"29/10\"\nvalue2 = \"30/10\"\nvalue3 = \"31/10\"\nvalue4 = \"01/11\"\nvalue5 = \"02/11\"\nvalue6 = \"03/11\"\nvalue7 = \"04/11\"\nvalue8 = date_out\n\nglobal.set([key1,key2,key3,key4,key5,key6,key7,key8],[value1,value2,value3,value4,value5,value6,value7,value8],\"store\");\n\n\nkey1 = \"grid_consumption_energy_daily\"\nkey2 = \"yield_energy_daily\"\nkey3 = \"exported_energy_daily\"\nkey4 = \"selfuse_energy_daily\"\nkey5 = \"load_energy_daily\"\nkey6 = \"self_consumption_rate_daily\"\n\nvalue1 = 2\nvalue2 = 3\nvalue3 = 4\nvalue4 = 5\nvalue5 = 6\nvalue6 = 50\n\nglobal.set([key1,key2,key3,key4,key5,key6],[value1,value2,value3,value4,value5,value6],\"store\");\n\n\nkey1 = \"grid_consumption_energy_T0\"\nkey2 = \"yield_energy_T0\"\nkey3 = \"exported_energy_T0\"\nkey4 = \"selfuse_energy_T0\"\nkey5 = \"load_energy_T0\"\n\nvalue1 = global.get(\"grid_consumption_energy_total\", \"store\")-5\nvalue2 = global.get(\"yield_energy_total\", \"store\")-6\nvalue3 = global.get(\"exported_energy_total\", \"store\")-5\nvalue4 = global.get(\"selfuse_energy_total\", \"store\")-6\nvalue5 = global.get(\"load_energy_total\", \"store\")-7\n\nglobal.set([key1,key2,key3,key4,key5],[value1,value2,value3,value4,value5],\"store\");\n\n\nkey1 = \"yield_energy_D7\"\nkey2 = \"yield_energy_D6\"\nkey3 = \"yield_energy_D5\"\nkey4 = \"yield_energy_D4\"\nkey5 = \"yield_energy_D3\"\nkey6 = \"yield_energy_D2\"\nkey7 = \"yield_energy_D1\"\n\nvalue1 = 6\nvalue2 = 5\nvalue3 = 6\nvalue4 = 5.5\nvalue5 = 6.1\nvalue6 = 5.8\nvalue7 = 6.2\n\nglobal.set([key1,key2,key3,key4,key5,key6,key7],[value1,value2,value3,value4,value5,value6,value7],\"store\");\n\n\nkey1 = \"exported_energy_D7\"\nkey2 = \"exported_energy_D6\"\nkey3 = \"exported_energy_D5\"\nkey4 = \"exported_energy_D4\"\nkey5 = \"exported_energy_D3\"\nkey6 = \"exported_energy_D2\"\nkey7 = \"exported_energy_D1\"\n\nvalue1 = 5.1\nvalue2 = 5.2\nvalue3 = 5.5\nvalue4 = 6\nvalue5 = 5.8\nvalue6 = 5.6\nvalue7 = 5.5\n\nglobal.set([key1,key2,key3,key4,key5,key6,key7],[value1,value2,value3,value4,value5,value6,value7],\"store\");\n\n\nkey1 = \"selfuse_energy_D7\"\nkey2 = \"selfuse_energy_D6\"\nkey3 = \"selfuse_energy_D5\"\nkey4 = \"selfuse_energy_D4\"\nkey5 = \"selfuse_energy_D3\"\nkey6 = \"selfuse_energy_D2\"\nkey7 = \"selfuse_energy_D1\"\n\nvalue1 = 4.3\nvalue2 = 3.9\nvalue3 = 4\nvalue4 = 4.1\nvalue5 = 4.6\nvalue6 = 4.3\nvalue7 = 4.5\n\nglobal.set([key1,key2,key3,key4,key5,key6,key7],[value1,value2,value3,value4,value5,value6,value7],\"store\");\n\n\nreturn null;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":380,"y":1320,"wires":[[]]},{"id":"c91e16987de92796","type":"inject","z":"5fb9966c8a33b771","name":"Start of the first","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payloadType":"date","x":140,"y":1320,"wires":[["60c71ef667239da7"]]},{"id":"b9c7a747f0b148f4","type":"change","z":"5fb9966c8a33b771","name":"","rules":[{"t":"set","p":"#:(store)::power","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1280,"y":520,"wires":[[]]},{"id":"6571bbe3c9c9748c","type":"inject","z":"5fb9966c8a33b771","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"#:(store)::power","payloadType":"flow","x":1270,"y":480,"wires":[["0f6bd877cd8395f0"]]},{"id":"933511e098403735","type":"function","z":"5fb9966c8a33b771","name":"Monthly_Init_Test","func":"\nvar d=new Date();\nvar day=d.getDate();\nvar month=d.getMonth()+1;\nvar year=d.getFullYear();\nif(day<=9)\nday=\"0\"+day;\nif(month<=9)\nmonth=\"0\"+month+1;\nvar date_out= month+\"/\"+year;\n \nkey1 = \"date_out_M0\"\nkey2 = \"date_out_M1\"\nkey3 = \"date_out_M2\"\nkey4 = \"date_out_M3\"\nkey5 = \"date_out_M4\"\nkey6 = \"date_out_M5\"\nkey7 = \"date_out_M6\"\nkey8 = \"date_out_M7\"\nkey9 = \"date_out_M8\"\nkey10 = \"date_out_M9\"\nkey11 = \"date_out_M10\"\nkey12 = \"date_out_M11\"\n\nvalue1 = date_out\nvalue2 = \"10/2021\"\nvalue3 = \"09/2021\"\nvalue4 = \"08/2021\"\nvalue5 = \"07/2021\"\nvalue6 = \"06/2021\"\nvalue7 = \"05/2021\"\nvalue8 = \"04/2021\"\nvalue9 = \"03/2021\"\nvalue10 = \"02/2021\"\nvalue11 = \"01/2021\"\nvalue12 = \"12/2020\"\n\nglobal.set([key12,key11,key10,key9,key8,key7,key6,key5,key4,key3,key2,key1],[value12,value11,value10,value9,value8,value7,value6,value5,value4,value3,value2,value1],\"store\");\n\n\nkey1 = \"grid_consumption_energy_monthly\"\nkey2 = \"yield_energy_monthly\"\nkey3 = \"exported_energy_monthly\"\nkey4 = \"selfuse_energy_monthly\"\nkey5 = \"load_energy_monthly\"\nkey6 = \"self_consumption_rate_monthly\"\n\nvalue1 = 20\nvalue2 = 30\nvalue3 = 40\nvalue4 = 50\nvalue5 = 60\nvalue6 = 66\n\nglobal.set([key1,key2,key3,key4,key5,key6],[value1,value2,value3,value4,value5,value6],\"store\");\n\n\nkey1 = \"grid_consumption_energy_MT0\"\nkey2 = \"yield_energy_MT0\"\nkey3 = \"exported_energy_MT0\"\nkey4 = \"selfuse_energy_MT0\"\nkey5 = \"load_energy_MT0\"\n\nvalue1 = global.get(\"grid_consumption_energy_total\", \"store\")-50\nvalue2 = global.get(\"yield_energy_total\", \"store\")-60\nvalue3 = global.get(\"exported_energy_total\", \"store\")-50\nvalue4 = global.get(\"selfuse_energy_total\", \"store\")-60\nvalue5 = global.get(\"load_energy_total\", \"store\")-70\n\nglobal.set([key1,key2,key3,key4,key5],[value1,value2,value3,value4,value5],\"store\");\n\n\nkey1 = \"yield_energy_M1\"\nkey2 = \"yield_energy_M2\"\nkey3 = \"yield_energy_M3\"\nkey4 = \"yield_energy_M4\"\nkey5 = \"yield_energy_M5\"\nkey6 = \"yield_energy_M6\"\nkey7 = \"yield_energy_M7\"\nkey8 = \"yield_energy_M8\"\nkey9 = \"yield_energy_M9\"\nkey10 = \"yield_energy_M10\"\nkey11 = \"yield_energy_M11\"\n\nvalue1 = 60\nvalue2 = 50\nvalue3 = 60\nvalue4 = 55\nvalue5 = 61\nvalue6 = 58\nvalue7 = 68\nvalue8 = 62\nvalue9 = 63\nvalue10 = 62\nvalue11 = 65\n\nglobal.set([key11,key10,key9,key8,key7,key6,key5,key4,key3,key2,key1],[value11,value10,value9,value8,value7,value6,value5,value4,value3,value2,value1],\"store\");\n\n\nkey1 = \"exported_energy_M1\"\nkey2 = \"exported_energy_M2\"\nkey3 = \"exported_energy_M3\"\nkey4 = \"exported_energy_M4\"\nkey5 = \"exported_energy_M5\"\nkey6 = \"exported_energy_M6\"\nkey7 = \"exported_energy_M7\"\nkey8 = \"exported_energy_M8\"\nkey9 = \"exported_energy_M9\"\nkey10 = \"exported_energy_M10\"\nkey11 = \"exported_energy_M11\"\n\nvalue1 = 60\nvalue2 = 50\nvalue3 = 60\nvalue4 = 55\nvalue5 = 61\nvalue6 = 58\nvalue7 = 68\nvalue8 = 62\nvalue9 = 63\nvalue10 = 62\nvalue11 = 65\n\nglobal.set([key11,key10,key9,key8,key7,key6,key5,key4,key3,key2,key1],[value11,value10,value9,value8,value7,value6,value5,value4,value3,value2,value1],\"store\");\n\nkey1 = \"selfuse_energy_M1\"\nkey2 = \"selfuse_energy_M2\"\nkey3 = \"selfuse_energy_M3\"\nkey4 = \"selfuse_energy_M4\"\nkey5 = \"selfuse_energy_M5\"\nkey6 = \"selfuse_energy_M6\"\nkey7 = \"selfuse_energy_M7\"\nkey8 = \"selfuse_energy_M8\"\nkey9 = \"selfuse_energy_M9\"\nkey10 = \"selfuse_energy_M10\"\nkey11 = \"selfuse_energy_M11\"\n\nvalue1 = 60\nvalue2 = 50\nvalue3 = 60\nvalue4 = 55\nvalue5 = 61\nvalue6 = 58\nvalue7 = 68\nvalue8 = 62\nvalue9 = 63\nvalue10 = 62\nvalue11 = 65\n\nglobal.set([key11,key10,key9,key8,key7,key6,key5,key4,key3,key2,key1],[value11,value10,value9,value8,value7,value6,value5,value4,value3,value2,value1],\"store\");\n\nreturn null;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":390,"y":1380,"wires":[["0ad9ec399b951de0"]]},{"id":"327d09893e2b2d44","type":"inject","z":"5fb9966c8a33b771","name":"Start of the first","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payloadType":"date","x":140,"y":1380,"wires":[["933511e098403735"]]},{"id":"0ad9ec399b951de0","type":"debug","z":"5fb9966c8a33b771","name":"test3","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":590,"y":1380,"wires":[]},{"id":"17ece94a36dc5775","type":"inject","z":"5fb9966c8a33b771","name":"test","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payloadType":"date","x":110,"y":960,"wires":[["4eabb9444831985d"]]},{"id":"6e05129a18c09213","type":"change","z":"5fb9966c8a33b771","name":"display_mode","rules":[{"t":"set","p":"display_mode","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":660,"y":980,"wires":[["abd393ead8616e64","f96a508e972c38e9","252a4574e01f6906","211dfd9f857354de","5dcda21d69b4b05f","5c6acd9c909da96f"]]},{"id":"4a26da7043f408f5","type":"inject","z":"5fb9966c8a33b771","name":"test","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payloadType":"date","x":110,"y":1020,"wires":[["68be2cb6adf8f373"]]},{"id":"252a4574e01f6906","type":"function","z":"5fb9966c8a33b771","name":"grid_consumption_energy_display","func":"\nif(flow.get(\"display_mode\")){\n msg.topic = \"grid_consumption_energy_daily\"\n msg.payload = parseFloat(global.get(\"grid_consumption_energy_daily\", \"store\")).toFixed(2)\n msg.money = parseFloat(global.get(\"grid_consumption_energy_daily\", \"store\")*0.6).toFixed(2)\n}else{\n msg.topic = \"grid_consumption_energy_monthly\"\n msg.payload = parseFloat(global.get(\"grid_consumption_energy_monthly\", \"store\")).toFixed(2) \n msg.money = parseFloat(global.get(\"grid_consumption_energy_monthly\", \"store\")*0.6).toFixed(2)\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1040,"y":580,"wires":[["ead64aa70c385da1"]]},{"id":"211dfd9f857354de","type":"function","z":"5fb9966c8a33b771","name":"yield_energy_display","func":"\nif(flow.get(\"display_mode\")){\n msg.topic = \"yield_energy_daily\"\n msg.payload = parseFloat(global.get(\"yield_energy_daily\", \"store\")).toFixed(2)\n msg.money = parseFloat(global.get(\"yield_energy_daily\", \"store\")*0.6).toFixed(2)\n}else{\n msg.topic = \"yield_energy_monthly\"\n msg.payload = parseFloat(global.get(\"yield_energy_monthly\", \"store\")).toFixed(2) \n msg.money = parseFloat(global.get(\"yield_energy_monthly\", \"store\")*0.6).toFixed(2)\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1000,"y":620,"wires":[["b3b37cdcd7518020"]]},{"id":"5dcda21d69b4b05f","type":"function","z":"5fb9966c8a33b771","name":"exported_energy_display","func":"\nif(flow.get(\"display_mode\")){\n msg.topic = \"exported_energy_daily\"\n msg.payload = parseFloat(global.get(\"exported_energy_daily\", \"store\")).toFixed(2)\n msg.money = parseFloat(global.get(\"exported_energy_daily\", \"store\")*0.6).toFixed(2)\n}else{\n msg.topic = \"exported_energy_monthly\"\n msg.payload = parseFloat(global.get(\"exported_energy_monthly\", \"store\")).toFixed(2) \n msg.money = parseFloat(global.get(\"exported_energy_monthly\", \"store\")*0.6).toFixed(2)\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1010,"y":660,"wires":[["a0bfba035e7e91a0"]]},{"id":"5c6acd9c909da96f","type":"function","z":"5fb9966c8a33b771","name":"selfuse_energy_display","func":"\nif(flow.get(\"display_mode\")){\n msg.topic = \"selfuse_energy_daily\"\n msg.payload = parseFloat(global.get(\"selfuse_energy_daily\", \"store\")).toFixed(2)\n msg.money = parseFloat(global.get(\"selfuse_energy_daily\", \"store\")*0.6).toFixed(2)\n}else{\n msg.topic = \"selfuse_energy_monthly\"\n msg.payload = parseFloat(global.get(\"selfuse_energy_monthly\", \"store\")).toFixed(2) \n msg.money = parseFloat(global.get(\"selfuse_energy_monthly\", \"store\")*0.6).toFixed(2)\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1010,"y":700,"wires":[["4b7f98391c95b216"]]},{"id":"2085d0721708278b","type":"function","z":"5fb9966c8a33b771","name":"exported_energy_monthly","func":"\n msg.topic = \"exported_energy_monthly\"\n msg.payload = parseFloat(global.get(\"exported_energy_monthly\", \"store\")).toFixed(2) \n\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1010,"y":820,"wires":[["719892f50aa82da7"]]},{"id":"5db20b6b73bc277a","type":"function","z":"5fb9966c8a33b771","name":"exported_energy_daily","func":"\n msg.topic = \"exported_energy_daily\"\n msg.payload = parseFloat(global.get(\"exported_energy_daily\", \"store\")).toFixed(2)\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1000,"y":740,"wires":[["d271b31a8a6b240e"]]},{"id":"f7559f9961f8235e","type":"function","z":"5fb9966c8a33b771","name":"selfuse_energy_daily","func":"\n msg.topic = \"selfuse_energy_daily\"\n msg.payload = parseFloat(global.get(\"selfuse_energy_daily\", \"store\")).toFixed(2)\n\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1000,"y":780,"wires":[["d271b31a8a6b240e"]]},{"id":"db0dda255fdddd2b","type":"function","z":"5fb9966c8a33b771","name":"selfuse_energy_monthly","func":"\n msg.topic = \"selfuse_energy_monthly\"\n msg.payload = parseFloat(global.get(\"selfuse_energy_monthly\", \"store\")).toFixed(2) \n \nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1010,"y":860,"wires":[["719892f50aa82da7"]]},{"id":"3014ea28d8d88b86","type":"ui_gauge","z":"5fb9966c8a33b771","name":"","group":"def107730da3d368","order":2,"width":"4","height":"3","gtype":"compass","title":"inverter_power","label":"W","format":"{{value}}","min":0,"max":"8000","colors":["#008fd5","#e6e600","#ca3838"],"seg1":"3000","seg2":"4000","className":"","x":980,"y":380,"wires":[]},{"id":"50e3ecce551d9973","type":"ui_gauge","z":"5fb9966c8a33b771","name":"","group":"def107730da3d368","order":3,"width":"4","height":"3","gtype":"compass","title":"feedin_power","label":"W","format":"{{value}}","min":"-5000","max":"5000","colors":["#008fd5","#e6e600","#ca3838"],"seg1":"3000","seg2":"4000","className":"","x":980,"y":420,"wires":[]},{"id":"5c4b5ed9a14f353d","type":"ui_gauge","z":"5fb9966c8a33b771","name":"","group":"def107730da3d368","order":4,"width":"4","height":"3","gtype":"compass","title":"load_power","label":"W","format":"{{value}}","min":0,"max":"5000","colors":["#008fd5","#e6e600","#ca3838"],"seg1":"3000","seg2":"4000","className":"","x":970,"y":460,"wires":[]},{"id":"0f6bd877cd8395f0","type":"ui_chart","z":"5fb9966c8a33b771","name":"","group":"bbfca520739f271f","order":1,"width":"18","height":"6","label":"Power (W)","chartType":"line","legend":"true","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":"24","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":970,"y":520,"wires":[["b9c7a747f0b148f4"]]},{"id":"11886ac37351e3e2","type":"ui_chart","z":"5fb9966c8a33b771","name":"","group":"bbfca520739f271f","order":2,"width":"18","height":"6","label":"{{msg.topic||\"Energy Daily\"}} (kWh)","chartType":"bar","legend":"true","xformat":"HH:mm:ss","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":1250,"y":1020,"wires":[[]]},{"id":"d271b31a8a6b240e","type":"ui_chart","z":"5fb9966c8a33b771","name":"","group":"def107730da3d368","order":5,"width":"6","height":"6","label":"Energy Pie Daily","chartType":"pie","legend":"true","xformat":"HH:mm:ss","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":1290,"y":760,"wires":[[]]},{"id":"8d6c46fdb05ca9d6","type":"ui_chart","z":"5fb9966c8a33b771","name":"","group":"def107730da3d368","order":1,"width":"12","height":"3","label":"Power (W)","chartType":"horizontalBar","legend":"false","xformat":"HH:mm:ss","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":972.0000305175781,"y":296.00000953674316,"wires":[[]]},{"id":"719892f50aa82da7","type":"ui_chart","z":"5fb9966c8a33b771","name":"","group":"def107730da3d368","order":6,"width":"6","height":"6","label":"Energy Pie Monthly","chartType":"pie","legend":"true","xformat":"HH:mm:ss","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":1290,"y":840,"wires":[[]]},{"id":"4b7f98391c95b216","type":"ui_template","z":"5fb9966c8a33b771","group":"ac9ab32ee56a0ad2","name":"selfuse_energy","order":6,"width":"6","height":"3","format":"\n<div class=\"icon_flat_rect\">\n <ul>\n <li style=\"background: #FFA060;\">\n <div class=\"text\">\n <p_solar ng-bind-html=\"msg.topic\"><span>name</span></p_solar>\n <br>\n <p_solar><span ng-bind-html=\"msg.payload\">0</span>kWh</p_solar>\n <br>\n <p_solar ng-bind-html=\"msg.money\"><span>0.1</span></p_solar><p_solar>€</p_solar>\n </div>\n </li>\n </ul>\n</div>\n","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","className":"","x":1280,"y":700,"wires":[[]]},{"id":"b77aaa97d09c0e6a","type":"ui_template","z":"5fb9966c8a33b771","group":"ac9ab32ee56a0ad2","name":"CSS","order":9,"width":"0","height":"0","format":"<style>\n/*\nbody.nr-dashboard-theme md-content md-card {\n background-color: #10AEF7;\n color: #111111;\n}\nbody.nr-dashboard-theme md-content md-card {\n \n color: red;\n text-shadow: 4px 2px 4px #00000045;\n box-shadow: 0 -1px 5px 1px #00000045;\n border-radius: 12px;\n border: 1px solid white;\n}\n\n.nr-dashboard-template p, .nr-dashboard-template h1, .nr-dashboard-template h2, .nr-dashboard-template h3, .nr-dashboard-template h4 {\n color: #111111 !important;\n background-color: #10AEF7 !important;\n}\n*/\n\n.icon_flat_rect>ul li{\n width: 243px;\n height: 105px;\n float: left;\n background: #10AEF7;\n margin-bottom: 20px;\n margin-right: 20px;\n border-radius: 5px;\n list-style-type: none;\n \n}\n.icon_flat_rect>ul li .text{\n /*float: right;*/\n text-align: center;\n margin-top: 10px;\n}\n.icon_flat_rect>ul li .text p_solar{\n color: white;\n text-align: center;\n padding-right: 20px;\n box-sizing: border-box;\n}\n.icon_flat_rect>ul li .text p_solar span{\n font-size: 32px;\n}\n</style>\n\n\n\n<!--div ng-bind-html=\"msg.payload\"></div-->\n\n <!--div class=\"groupTitle\"><span>Energy Dashboard</span></div>\n <div class=\"icon_flat_rect\">\n <ul>\n <li>\n <div class=\"text\">\n <p ng-bind-html=\"msg.topic\">name</p>\n <p><span ng-bind-html=\"msg.payload\">0</span>kWh</p>\n </div>\n </li>\n <li style=\"background: #7CC422;\">\n <div class=\"text\">\n <p id=\"dispname2\">name</p>\n <p><span id=\"disp2\">0</span></p>\n </div>\n </li>\n <li style=\"background: #FFA060;\">\n <div class=\"text\">\n <p id=\"dispname3\">name</p>\n <p><span id=\"disp3\">0</span></p>\n </div>\n </li>\n <li style=\"background: #FEC107;\">\n <div class=\"text\">\n <p id=\"dispname4\">name</p>\n <p><span id=\"disp4\">0</span></p>\n </div>\n </li>\n <li style=\"background: #46D1E4;\">\n <div class=\"text\">\n <p id=\"dispname5\">name</p>\n <p><span id=\"disp5\">0</span></p>\n </div>\n </li>\n <li style=\"background: #60D0FE;\">\n <div class=\"text\">\n <p id=\"dispname6\">name</p>\n <p><span id=\"disp6\">0</span></p>\n </div>\n </li>\n \n <div class=\"clear\"></div>\n </ul>\n </div>\n </div-->","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","className":"","x":390,"y":60,"wires":[[]]},{"id":"b3b37cdcd7518020","type":"ui_template","z":"5fb9966c8a33b771","group":"ac9ab32ee56a0ad2","name":"yield_energy","order":4,"width":"6","height":"3","format":"\n<div class=\"icon_flat_rect\">\n <ul>\n <li>\n <div class=\"text\">\n <p_solar ng-bind-html=\"msg.topic\"><span>name</span></p_solar>\n <br>\n <p_solar><span ng-bind-html=\"msg.payload\">0</span>kWh</p_solar>\n <br>\n <p_solar ng-bind-html=\"msg.money\"><span>0.1</span></p_solar><p_solar>€</p_solar>\n </div>\n </li>\n </ul>\n</div>\n","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","className":"","x":1270,"y":620,"wires":[[]]},{"id":"a0bfba035e7e91a0","type":"ui_template","z":"5fb9966c8a33b771","group":"ac9ab32ee56a0ad2","name":"exported_energy","order":5,"width":"6","height":"3","format":"\n<div class=\"icon_flat_rect\">\n <ul>\n <li style=\"background: #7CC422;\">\n <div class=\"text\">\n <p_solar ng-bind-html=\"msg.topic\"><span>name</span></p_solar>\n <br>\n <p_solar><span ng-bind-html=\"msg.payload\">0</span>kWh</p_solar>\n <br>\n <p_solar ng-bind-html=\"msg.money\"><span>0.1</span></p_solar><p_solar>€</p_solar>\n </div>\n </li>\n </ul>\n</div>\n","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","className":"","x":1290,"y":660,"wires":[[]]},{"id":"ead64aa70c385da1","type":"ui_template","z":"5fb9966c8a33b771","group":"ac9ab32ee56a0ad2","name":"grid_consumption_energy","order":7,"width":"6","height":"3","format":"\n<div class=\"icon_flat_rect\">\n <ul>\n <li style=\"background: #FEC107;\">\n <div class=\"text\">\n <p_solar ng-bind-html=\"msg.topic\"><span>name</span></p_solar>\n <br>\n <p_solar><span ng-bind-html=\"msg.payload\">0</span>kWh</p_solar>\n <br>\n <p_solar ng-bind-html=\"msg.money\"><span>0.1</span></p_solar><p_solar>€</p_solar>\n </div>\n </li>\n </ul>\n</div>\n","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","className":"","x":1310,"y":580,"wires":[[]]},{"id":"8cfc7efe1c0d8816","type":"ui_template","z":"5fb9966c8a33b771","group":"ac9ab32ee56a0ad2","name":"self_consumption_rate","order":8,"width":"6","height":"3","format":"\n<div class=\"icon_flat_rect\">\n <ul>\n <li style=\"background: #46D1E4;\">\n <div class=\"text\">\n <p_solar ng-bind-html=\"msg.topic\"><span>name</span></p_solar>\n <br>\n <p_solar><span ng-bind-html=\"msg.payload\">0</span>%</p_solar>\n </div>\n </li>\n </ul>\n</div>\n","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","className":"","x":1300,"y":960,"wires":[[]]},{"id":"68be2cb6adf8f373","type":"ui_button","z":"5fb9966c8a33b771","name":"","group":"ac9ab32ee56a0ad2","order":3,"width":"2","height":"1","passthru":true,"label":"Monthly","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"false","payloadType":"bool","topic":"","topicType":"str","x":400,"y":1020,"wires":[["6e05129a18c09213"]]},{"id":"4eabb9444831985d","type":"ui_button","z":"5fb9966c8a33b771","name":"","group":"ac9ab32ee56a0ad2","order":2,"width":"2","height":"1","passthru":true,"label":"Daily","tooltip":"","color":"","bgcolor":"","className":"","icon":"","payload":"true","payloadType":"bool","topic":"","topicType":"str","x":390,"y":960,"wires":[["6e05129a18c09213"]]},{"id":"9cace94d0fd39aac","type":"ui_text","z":"5fb9966c8a33b771","group":"ac9ab32ee56a0ad2","order":1,"width":"25","height":"1","name":"Solar PV System","label":"<font size=\"8\">Solar PV System</font>","format":"","layout":"col-center","className":"","x":430,"y":100,"wires":[]},{"id":"424798f99c387eef","type":"local-realtime","z":"5fb9966c8a33b771","name":"local-realtime","ip":"192.168.1.6","interval":60,"x":133.5,"y":387,"wires":[["02ad8acebdd33fc7","6d671c77a682e9a1","b3f3557fd1df50f7","d730ce29db99d728","d52c8e481eb959b8"]],"l":false},{"id":"def107730da3d368","type":"ui_group","name":"Right","tab":"753fd61a4d454c54","order":3,"disp":false,"width":"12","collapse":false,"className":""},{"id":"bbfca520739f271f","type":"ui_group","name":"Left","tab":"753fd61a4d454c54","order":2,"disp":false,"width":"18","collapse":false,"className":""},{"id":"ac9ab32ee56a0ad2","type":"ui_group","name":"TOP","tab":"753fd61a4d454c54","order":1,"disp":false,"width":"30","collapse":false,"className":""},{"id":"753fd61a4d454c54","type":"ui_tab","name":"Solar","icon":"dashboard","order":7,"disabled":false,"hidden":false}]