[{"id":"71e0ce1f04e41958","type":"function","z":"9120cee1.edcfb","name":"shelly pro 4 pm","func":"//=======================================================================\nconst id = \"shellypro4pm-94b97ec035e8\"; // change id to your shelly id\n//=======================================================================\n\nlet wifiout = {};\nlet timestamp = date_time_string();\nnode_send({ payload: timestamp }, context.get('timestamp'));\nnode.status({ text: timestamp });\n\nswitch (msg.topic) {\n case id + \"/status/switch:0\":\n display_switch_0();\n break;\n\n case id + \"/status/switch:1\":\n display_switch_1();\n break;\n\n case id + \"/status/switch:2\":\n display_switch_2();\n break;\n\n case id + \"/status/switch:3\":\n display_switch_3();\n break;\n\n case \"wifi\":\n let wifiin = msg.payload;\n wifiout = wifi_out(wifiin);\n node_send(wifiout, context.get('wifi'));\n break;\n\n case \"midnight\":\n context.set('midnight', msg.payload);\n break;\n\n case \"firmware\":\n let update = msg.payload;\n delete msg.payload;\n if (update === false) {\n node_send({ color: \"red\", icon: \"fa fa-cloud-download\" }, context.get('firmware'));\n }\n else {\n node_send({ color: \"green\", icon: \"fa fa-thumbs-up\" }, context.get('firmware'));\n }\n break;\n}\n\nreturn null;\n\n//--------------------------------------------------------------------\n\nfunction display_switch_0() {\n //node.warn(\"switch_0\");\n let status = msg.payload.output;\n //status = status === false ? 'switch 0' : 'switch 0';\n node_send({ payload: msg.payload.apower }, context.get('gauge_0'));\n node_send({ topic: \"DGWZ\", payload: msg.payload.apower }, context.get('12_h_verlauf')); \n\n node_send({ className: \"orange\", payload: msg.payload.voltage }, context.get('voltage_0'));\n setTimeout(() => { node_send({ className: \"thisClassHasNoCSS\" }, context.get('voltage_0')); }, \"300\");\n\n node_send({ className: \"orange\", payload: msg.payload.current }, context.get('current_0'));\n setTimeout(() => { node_send({ className: \"thisClassHasNoCSS\" }, context.get('current_0')); }, \"300\"); \n\n let totalenergy = parseFloat(msg.payload.aenergy.total);\n let mn = context.get('midnight');\n let dayenergy = (totalenergy - mn.midnight_0);\n totalenergy = parseFloat((totalenergy / 1000).toFixed(3));\n dayenergy = parseFloat((dayenergy /1000).toFixed(3));\n node_send({ className: \"orange\", payload: totalenergy }, context.get('totalenergy_0'));\n setTimeout(() => { node_send({ className: \"thisClassHasNoCSS\" }, context.get('totalenergy_0'));}, \"300\");\n node_send({ className: \"orange\", payload: dayenergy }, context.get('dayenergy_0'));\n setTimeout(() => { node_send({ className: \"thisClassHasNoCSS\" }, context.get('dayenergy_0')); }, \"300\"); \n \n let temp = msg.payload.temperature.tC;\n if (temp < 60) {\n temp = '' + temp + '';\n }\n else {\n temp = '' + temp + '';\n }\n node_send({ className: \"orange\", payload: temp }, context.get('temperature_0'));\n setTimeout(() => { node_send({ className: \"thisClassHasNoCSS\" }, context.get('temperature_0')); }, \"300\"); \n}\n\n//--------------------------------------------------------------------\n\nfunction display_switch_1() {\n //node.warn(\"switch_0\");\n let status = msg.payload.output;\n //status = status === false ? 'switch 0' : 'switch 0';\n node_send({ payload: msg.payload.apower }, context.get('gauge_1'));\n node_send({ topic: \"DGSZ\", payload: msg.payload.apower }, context.get('12_h_verlauf'));\n\n node_send({ className: \"orange\", payload: msg.payload.voltage }, context.get('voltage_1'));\n setTimeout(() => { node_send({ className: \"thisClassHasNoCSS\" }, context.get('voltage_1')); }, \"300\");\n\n node_send({ className: \"orange\", payload: msg.payload.current }, context.get('current_1'));\n setTimeout(() => { node_send({ className: \"thisClassHasNoCSS\" }, context.get('current_1')); }, \"300\");\n\n let totalenergy = parseFloat(msg.payload.aenergy.total);\n let mn = context.get('midnight');\n let dayenergy = (totalenergy - mn.midnight_1);\n totalenergy = parseFloat((totalenergy / 1000).toFixed(3));\n dayenergy = parseFloat((dayenergy / 1000).toFixed(3));\n node_send({ className: \"orange\", payload: totalenergy }, context.get('totalenergy_1'));\n setTimeout(() => { node_send({ className: \"thisClassHasNoCSS\" }, context.get('totalenergy_1')); }, \"300\");\n node_send({ className: \"orange\", payload: dayenergy }, context.get('dayenergy_1'));\n setTimeout(() => { node_send({ className: \"thisClassHasNoCSS\" }, context.get('dayenergy_1')); }, \"300\");\n\n let temp = msg.payload.temperature.tC;\n if (temp < 60) {\n temp = '' + temp + '';\n }\n else {\n temp = '' + temp + '';\n }\n node_send({ className: \"orange\", payload: temp }, context.get('temperature_1'));\n setTimeout(() => { node_send({ className: \"thisClassHasNoCSS\" }, context.get('temperature_1')); }, \"300\");\n}\n\n//-------------------------------------------------------------------\n\nfunction display_switch_2() {\n //node.warn(\"switch_0\");\n let status = msg.payload.output;\n //status = status === false ? 'switch 0' : 'switch 0';\n node_send({ payload: msg.payload.apower }, context.get('gauge_2'));\n node_send({ topic: \"DGGZ\", payload: msg.payload.apower }, context.get('12_h_verlauf'));\n\n node_send({ className: \"orange\", payload: msg.payload.voltage }, context.get('voltage_2'));\n setTimeout(() => { node_send({ className: \"thisClassHasNoCSS\" }, context.get('voltage_2')); }, \"300\");\n\n node_send({ className: \"orange\", payload: msg.payload.current }, context.get('current_2'));\n setTimeout(() => { node_send({ className: \"thisClassHasNoCSS\" }, context.get('current_2')); }, \"300\");\n\n let totalenergy = parseFloat(msg.payload.aenergy.total);\n let mn = context.get('midnight');\n let dayenergy = (totalenergy - mn.midnight_2);\n totalenergy = parseFloat((totalenergy / 1000).toFixed(3));\n dayenergy = parseFloat((dayenergy / 1000).toFixed(3));\n node_send({ className: \"orange\", payload: totalenergy }, context.get('totalenergy_2'));\n setTimeout(() => { node_send({ className: \"thisClassHasNoCSS\" }, context.get('totalenergy_2')); }, \"300\");\n node_send({ className: \"orange\", payload: dayenergy }, context.get('dayenergy_2'));\n setTimeout(() => { node_send({ className: \"thisClassHasNoCSS\" }, context.get('dayenergy_2')); }, \"300\");\n\n let temp = msg.payload.temperature.tC;\n if (temp < 60) {\n temp = '' + temp + '';\n }\n else {\n temp = '' + temp + '';\n }\n node_send({ className: \"orange\", payload: temp }, context.get('temperature_2'));\n setTimeout(() => { node_send({ className: \"thisClassHasNoCSS\" }, context.get('temperature_2')); }, \"300\");\n}\n\n//-------------------------------------------------------------------\n\nfunction display_switch_3() {\n //node.warn(\"switch_0\");\n let status = msg.payload.output;\n //status = status === false ? 'switch 0' : 'switch 0';\n node_send({ payload: msg.payload.apower }, context.get('gauge_3'));\n node_send({ topic: \"DGBZ\", payload: msg.payload.apower }, context.get('12_h_verlauf'));\n\n node_send({ className: \"orange\", payload: msg.payload.voltage }, context.get('voltage_3'));\n setTimeout(() => { node_send({ className: \"thisClassHasNoCSS\" }, context.get('voltage_3')); }, \"300\");\n\n node_send({ className: \"orange\", payload: msg.payload.current }, context.get('current_3'));\n setTimeout(() => { node_send({ className: \"thisClassHasNoCSS\" }, context.get('current_3')); }, \"300\");\n\n let totalenergy = parseFloat(msg.payload.aenergy.total);\n let mn = context.get('midnight');\n let dayenergy = (totalenergy - mn.midnight_3);\n totalenergy = parseFloat((totalenergy / 1000).toFixed(3));\n dayenergy = parseFloat((dayenergy / 1000).toFixed(3));\n node_send({ className: \"orange\", payload: totalenergy }, context.get('totalenergy_3'));\n setTimeout(() => { node_send({ className: \"thisClassHasNoCSS\" }, context.get('totalenergy_3')); }, \"300\");\n node_send({ className: \"orange\", payload: dayenergy }, context.get('dayenergy_3'));\n setTimeout(() => { node_send({ className: \"thisClassHasNoCSS\" }, context.get('dayenergy_3')); }, \"300\");\n\n let temp = msg.payload.temperature.tC;\n if (temp < 60) {\n temp = '' + temp + '';\n }\n else {\n temp = '' + temp + '';\n }\n node_send({ className: \"orange\", payload: temp }, context.get('temperature_3'));\n setTimeout(() => { node_send({ className: \"thisClassHasNoCSS\" }, context.get('temperature_3')); }, \"300\");\n}\n\n//====================================================================\n\nfunction node_send(value, port) {\n const messages = new Array(node.outputCount);\n messages[port] = value;\n node.send(messages);\n}\n\n//====================================================================\n\nfunction check_energy(data) {\n let new_energy = data;\n if (new_energy < context.get('last_energy')) {\n new_energy = new_energy + context.get('last_energy');\n }\n context.set('last_energy', new_energy);\n return new_energy;\n}\n\n/*\n\n// persisting energy data --> need to change config.js\n\nfunction check_energy(data) {\n let new_energy = data;\n if (new_energy < context.get('last_energy,file')) {\n new_energy = new_energy + context.get('last_energy,file');\n }\n context.set('last_energy,file', new_energy);\n //node.warn(new_energy);\n return new_energy;\n}\n\n*/\n\n//--------------------------------------------------------------------\n\nfunction wifi_out(wifiin) {\n let rssi = wifiin;\n let color;\n if (rssi < -80) {\n color = 'red';\n }\n else if (rssi < -70) {\n color = '#FFC300';\n }\n else {\n color = 'green';\n }\n rssi = rssi.toString();\n return ({ \"topic\": rssi, \"payload\": color });\n}\n\n//--------------------------------------------------------------------\n\nfunction date_time_string() {\n const date = new Date(Date.now());\n const year = date.getFullYear();\n const month = (\"0\" + (date.getMonth() + 1)).slice(-2);\n const day = (\"0\" + date.getDate()).slice(-2);\n const hours = (\"0\" + date.getHours()).slice(-2);\n const minutes = (\"0\" + date.getMinutes()).slice(-2);\n const seconds = (\"0\" + date.getSeconds()).slice(-2);\n let datetimestring = day + \"-\" + month + \"-\" + year + \" \" + hours + ':' + minutes + ':' + seconds;\n return datetimestring;\n}\n\n//--------------------------------------------------------------------","outputs":28,"noerr":0,"initialize":"// Code added here will be run once\n// whenever the node is started.\ncontext.set('midnight', [0.0,0.0,0.0]);\n\ncontext.set('firmware',0);\ncontext.set('timestamp', 1);\ncontext.set('wifi', 2);\n\ncontext.set('gauge_0', 3);\ncontext.set('voltage_0', 4);\ncontext.set('current_0', 5);\ncontext.set('dayenergy_0', 6);\ncontext.set('totalenergy_0', 7);\ncontext.set('temperature_0', 8);\n\ncontext.set('gauge_1', 9);\ncontext.set('voltage_1', 10);\ncontext.set('current_1', 11);\ncontext.set('dayenergy_1', 12);\ncontext.set('totalenergy_1', 13);\ncontext.set('temperature_1', 14);\n\ncontext.set('gauge_2', 15);\ncontext.set('voltage_2', 16);\ncontext.set('current_2', 17);\ncontext.set('dayenergy_2', 18);\ncontext.set('totalenergy_2', 19);\ncontext.set('temperature_2', 20);\n\ncontext.set('gauge_3', 21);\ncontext.set('voltage_3', 22);\ncontext.set('current_3', 23);\ncontext.set('dayenergy_3', 24);\ncontext.set('totalenergy_3', 25);\ncontext.set('temperature_3', 26);\n\ncontext.set('12_h_verlauf', 27);","finalize":"","libs":[],"x":940,"y":720,"wires":[["292716be47b084ee"],["f7dce516b4f9f47d"],["e4a382e8c7a95a41"],["241874cdf18e2f44"],["de2f996557e9f1a1"],["a6a354f3b91b14a4"],["e3d96ca71ffc57a0"],["05d4e05d24168978"],["b86de5c7f26e9910"],["1a0c4fb8c021e623"],["99cdbbf4171364e7"],["4d9023180a9b3d02"],["e9e60350f17f96e8"],["3b1e8d6928d64b6d"],["8e84f2028ac59190"],["0bdffbdc80485488"],["26de4aa622b2b875"],["8aa88497236369ca"],["558bebd84bb0ccd7"],["224c73dffeaaf260"],["3e05a0152253ecca"],["aa9515f345fab96f"],["5610faf3918aded7"],["1188bd803bd49572"],["94a618559a98dd07"],["b5b7892f53c0ac5a"],["78691abfa2a045ab"],["7029f8ad28fa27a5"]],"outputLabels":["firmware","timestamp","wifi","gauge 1","voltage 1","current 1","energy day 1","energy total 1","temp 1","gauge 2","votage 2","current 2","energy day 2","energy total 2","temp 2","gauge 3","voltage 3","current 3","energy day 3","energy total 3","temp 3","gauge 4","voltage 4","current 4","energy day 4","energy total 4","temp 4","12 h verlauf"]},{"id":"82018d2b8b39d28e","type":"mqtt in","z":"9120cee1.edcfb","name":"MQTT DG pro4pm","topic":"shellypro4pm-94b97ec035e8/status/#","qos":"0","datatype":"auto-detect","broker":"f5f6599b.7711a8","nl":false,"rap":true,"rh":0,"inputs":0,"x":150,"y":720,"wires":[["71e0ce1f04e41958","0e63096993f9930d","419fb02f5f8cee83"]]},{"id":"0e63096993f9930d","type":"debug","z":"9120cee1.edcfb","name":"debug 105","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":450,"y":760,"wires":[]},{"id":"eba5e3d9423b7ca3","type":"link out","z":"9120cee1.edcfb","name":"link out 7","mode":"link","links":["6a7c2e9b33cb38d9"],"x":955,"y":400,"wires":[]},{"id":"4599046b36e07d9f","type":"function","z":"9120cee1.edcfb","name":"wifi","func":"node.status({ text: msg.payload.wifi.rssi });\nreturn { topic:'wifi', payload: msg.payload.wifi.rssi};","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":650,"y":540,"wires":[["71e0ce1f04e41958"]]},{"id":"f34e667527bf8670","type":"switch","z":"9120cee1.edcfb","name":"topic","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"wifi","vt":"str"},{"t":"eq","v":"firmware","vt":"str"},{"t":"eq","v":"midnight","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":430,"y":600,"wires":[["4599046b36e07d9f"],["5c1e02d2566922dc"],["0ddda5c7dd7fdc30"]]},{"id":"a16250ef95815f9e","type":"link call","z":"9120cee1.edcfb","name":"lc http-req DG shelly pro4 pm","links":["d59a2325dd14c795"],"linkType":"static","timeout":"100","x":620,"y":400,"wires":[["31c2516f9e12604c"]]},{"id":"587ce43fc31bd5bb","type":"change","z":"9120cee1.edcfb","name":"url 170","rules":[{"t":"set","p":"url","pt":"msg","to":"http://10.0.0.170/rpc/Shelly.GetStatus","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":400,"wires":[["a16250ef95815f9e"]]},{"id":"5c1e02d2566922dc","type":"function","z":"9120cee1.edcfb","name":"firmware","func":"let update;\nif (typeof msg.payload.sys.available_updates != 'undefined' && msg.payload.sys.available_updates !== null) {\n update = false;\n}\nelse {\n update = true;\n}\nnode.status({ text: update });\nreturn{topic:\"firmware\", payload:update};\n\n//--------------------------------------------------------------------\n// true means empty object and empty object means no new FW available\n//--------------------------------------------------------------------","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":640,"y":600,"wires":[["71e0ce1f04e41958"]]},{"id":"ee66308ba2887601","type":"inject","z":"9120cee1.edcfb","name":"00:30","props":[{"p":"topic","vt":"str"},{"p":"payload"}],"repeat":"","crontab":"","once":true,"onceDelay":"5","topic":"firmware","payload":"","payloadType":"date","x":170,"y":440,"wires":[["f32a2f2448913b8f"]]},{"id":"31c2516f9e12604c","type":"switch","z":"9120cee1.edcfb","name":"200","property":"statusCode","propertyType":"msg","rules":[{"t":"neq","v":"200","vt":"str"},{"t":"eq","v":"200","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":810,"y":400,"wires":[["eba5e3d9423b7ca3","136cce15056d5081"],["d125bf9cffb68555"]]},{"id":"d49848662f428fb5","type":"inject","z":"9120cee1.edcfb","name":"every 5 min","props":[{"p":"topic","vt":"str"},{"p":"payload"}],"repeat":"","crontab":"","once":true,"onceDelay":"1","topic":"wifi","payload":"","payloadType":"date","x":150,"y":360,"wires":[["f32a2f2448913b8f"]]},{"id":"f32a2f2448913b8f","type":"switch","z":"9120cee1.edcfb","name":"","property":"WD_DG-shelly-pro-4","propertyType":"global","rules":[{"t":"eq","v":"on","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":310,"y":400,"wires":[["587ce43fc31bd5bb"]]},{"id":"d8a3067964cf531a","type":"inject","z":"9120cee1.edcfb","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":170,"y":1040,"wires":[["9988b640c61ebdbf"]]},{"id":"a6597d87f3a0aee7","type":"function","z":"9120cee1.edcfb","name":"init color/room","func":"node.send({\"topic\":\"DGWZ\",\"payload\":\"0.0\"});\nnode.send({\"topic\":\"DGSZ\",\"payload\":\"0.0\"});\nnode.send({\"topic\":\"DGGZ\",\"payload\":\"0.0\"});\nnode.send({\"topic\":\"DGBZ\",\"payload\":\"0.0\"});\nnode.status({ text: date_time_string() });\nreturn null;\n\n//--------------------------------------------------------------------\n\nfunction date_time_string() {\n const date = new Date(Date.now());\n const year = date.getFullYear();\n const month = (\"0\" + (date.getMonth() + 1)).slice(-2);\n const day = (\"0\" + date.getDate()).slice(-2);\n const hours = (\"0\" + date.getHours()).slice(-2);\n const minutes = (\"0\" + date.getMinutes()).slice(-2);\n const seconds = (\"0\" + date.getSeconds()).slice(-2);\n let datetimestring = day + \"-\" + month + \"-\" + year + \" \" + hours + ':' + minutes + ':' + seconds;\n return datetimestring;\n} ","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":940,"y":1080,"wires":[["7029f8ad28fa27a5"]]},{"id":"9988b640c61ebdbf","type":"change","z":"9120cee1.edcfb","name":"reset chart","rules":[{"t":"set","p":"payload","pt":"msg","to":"[]","tot":"jsonata"},{"t":"set","p":"WD_DG-shelly-pro-4","pt":"global","to":"on","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":950,"y":1040,"wires":[["a6597d87f3a0aee7","7029f8ad28fa27a5"]]},{"id":"6ffbea3a0f6f39eb","type":"inject","z":"9120cee1.edcfb","name":"midnight","props":[{"p":"topic","vt":"str"},{"p":"payload"}],"repeat":"","crontab":"","once":true,"onceDelay":"3","topic":"midnight","payload":"","payloadType":"date","x":160,"y":400,"wires":[["f32a2f2448913b8f"]]},{"id":"0ddda5c7dd7fdc30","type":"function","z":"9120cee1.edcfb","name":"midnight","func":"let midnight_0 = msg.payload[\"switch:0\"].aenergy.total;\nlet midnight_1 = msg.payload[\"switch:1\"].aenergy.total;\nlet midnight_2 = msg.payload[\"switch:2\"].aenergy.total;\nlet midnight_3 = msg.payload[\"switch:3\"].aenergy.total;\nmsg.payload = { \"midnight_0\": midnight_0, \"midnight_1\": midnight_1, \"midnight_2\": midnight_2, \"midnight_3\": midnight_3};\nnode.status({ text: midnight_0 + \"|\" + midnight_1 + \"|\" + midnight_2 + \"|\" + midnight_3});\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":640,"y":660,"wires":[["71e0ce1f04e41958"]]},{"id":"f7dce516b4f9f47d","type":"ui_text","z":"9120cee1.edcfb","group":"8b83ab75.fea488","order":2,"width":6,"height":1,"name":"timestamp","label":"","format":"{{msg.payload}}","layout":"row-center","className":"","x":1310,"y":140,"wires":[]},{"id":"de2f996557e9f1a1","type":"ui_text","z":"9120cee1.edcfb","group":"8b83ab75.fea488","order":8,"width":2,"height":1,"name":"voltage-1","label":"","format":"{{msg.payload}} Volt","layout":"row-center","className":"","x":1300,"y":280,"wires":[]},{"id":"a6a354f3b91b14a4","type":"ui_text","z":"9120cee1.edcfb","group":"8b83ab75.fea488","order":12,"width":2,"height":1,"name":"current-1","label":"","format":"{{msg.payload}} amp","layout":"row-center","className":"","x":1300,"y":320,"wires":[]},{"id":"e3d96ca71ffc57a0","type":"ui_text","z":"9120cee1.edcfb","group":"8b83ab75.fea488","order":16,"width":2,"height":1,"name":"energy tag-1","label":"D:","format":"{{msg.payload}} kWh","layout":"row-center","className":"","x":1310,"y":360,"wires":[]},{"id":"05d4e05d24168978","type":"ui_text","z":"9120cee1.edcfb","group":"8b83ab75.fea488","order":20,"width":2,"height":1,"name":"energy total -1","label":"T:","format":"{{msg.payload}} kWh","layout":"row-center","className":"","x":1320,"y":400,"wires":[]},{"id":"b86de5c7f26e9910","type":"ui_text","z":"9120cee1.edcfb","group":"8b83ab75.fea488","order":24,"width":2,"height":1,"name":"temp-1","label":"","format":"{{msg.payload}} °C","layout":"row-center","className":"","x":1300,"y":440,"wires":[]},{"id":"99cdbbf4171364e7","type":"ui_text","z":"9120cee1.edcfb","group":"8b83ab75.fea488","order":9,"width":2,"height":1,"name":"voltage-2","label":"","format":"{{msg.payload}} Volt","layout":"row-center","className":"","x":1300,"y":540,"wires":[]},{"id":"4d9023180a9b3d02","type":"ui_text","z":"9120cee1.edcfb","group":"8b83ab75.fea488","order":13,"width":2,"height":1,"name":"current-2","label":"","format":"{{msg.payload}} amp","layout":"row-center","className":"","x":1300,"y":580,"wires":[]},{"id":"e9e60350f17f96e8","type":"ui_text","z":"9120cee1.edcfb","group":"8b83ab75.fea488","order":17,"width":2,"height":1,"name":"energy tag-2","label":"","format":"{{msg.payload}} kWh","layout":"row-center","className":"","x":1310,"y":620,"wires":[]},{"id":"3b1e8d6928d64b6d","type":"ui_text","z":"9120cee1.edcfb","group":"8b83ab75.fea488","order":21,"width":2,"height":1,"name":"energy total -2","label":"","format":"{{msg.payload}} kWh","layout":"row-center","className":"","x":1320,"y":660,"wires":[]},{"id":"8e84f2028ac59190","type":"ui_text","z":"9120cee1.edcfb","group":"8b83ab75.fea488","order":25,"width":2,"height":1,"name":"temp-2","label":"","format":"{{msg.payload}} °C","layout":"row-center","className":"","x":1300,"y":700,"wires":[]},{"id":"26de4aa622b2b875","type":"ui_text","z":"9120cee1.edcfb","group":"8b83ab75.fea488","order":10,"width":2,"height":1,"name":"voltage-3","label":"","format":"{{msg.payload}} Volt","layout":"row-center","className":"","x":1300,"y":800,"wires":[]},{"id":"8aa88497236369ca","type":"ui_text","z":"9120cee1.edcfb","group":"8b83ab75.fea488","order":14,"width":2,"height":1,"name":"current-3","label":"","format":"{{msg.payload}} amp","layout":"row-center","className":"","x":1300,"y":840,"wires":[]},{"id":"558bebd84bb0ccd7","type":"ui_text","z":"9120cee1.edcfb","group":"8b83ab75.fea488","order":18,"width":2,"height":1,"name":"energy tag-3","label":"","format":"{{msg.payload}} kWh","layout":"row-center","className":"","x":1310,"y":880,"wires":[]},{"id":"224c73dffeaaf260","type":"ui_text","z":"9120cee1.edcfb","group":"8b83ab75.fea488","order":22,"width":2,"height":1,"name":"energy total -3","label":"","format":"{{msg.payload}} kWh","layout":"row-center","className":"","x":1320,"y":920,"wires":[]},{"id":"3e05a0152253ecca","type":"ui_text","z":"9120cee1.edcfb","group":"8b83ab75.fea488","order":26,"width":2,"height":1,"name":"temp-3","label":"","format":"{{msg.payload}} °C","layout":"row-center","className":"","x":1300,"y":960,"wires":[]},{"id":"5610faf3918aded7","type":"ui_text","z":"9120cee1.edcfb","group":"8b83ab75.fea488","order":11,"width":2,"height":1,"name":"voltage-4","label":"","format":"{{msg.payload}} Volt","layout":"row-center","className":"","x":1300,"y":1060,"wires":[]},{"id":"1188bd803bd49572","type":"ui_text","z":"9120cee1.edcfb","group":"8b83ab75.fea488","order":15,"width":2,"height":1,"name":"current-4","label":"","format":"{{msg.payload}} amp","layout":"row-center","className":"","x":1300,"y":1100,"wires":[]},{"id":"94a618559a98dd07","type":"ui_text","z":"9120cee1.edcfb","group":"8b83ab75.fea488","order":19,"width":2,"height":1,"name":"energy tag-4","label":"","format":"{{msg.payload}} kWh","layout":"row-center","className":"","x":1310,"y":1140,"wires":[]},{"id":"b5b7892f53c0ac5a","type":"ui_text","z":"9120cee1.edcfb","group":"8b83ab75.fea488","order":23,"width":2,"height":1,"name":"energy total -4","label":"","format":"{{msg.payload}} kWh","layout":"row-center","className":"","x":1320,"y":1180,"wires":[]},{"id":"78691abfa2a045ab","type":"ui_text","z":"9120cee1.edcfb","group":"8b83ab75.fea488","order":27,"width":2,"height":1,"name":"temp-4","label":"","format":"{{msg.payload}} °C","layout":"row-center","className":"","x":1300,"y":1220,"wires":[]},{"id":"241874cdf18e2f44","type":"ui_gauge","z":"9120cee1.edcfb","name":"gauge-1","group":"8b83ab75.fea488","order":4,"width":2,"height":2,"gtype":"gage","title":"DGWZ","label":"Watt 1","format":"{{value}}","min":0,"max":"50","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","diff":false,"className":"","x":1300,"y":240,"wires":[]},{"id":"1a0c4fb8c021e623","type":"ui_gauge","z":"9120cee1.edcfb","name":"gauge-2","group":"8b83ab75.fea488","order":5,"width":2,"height":2,"gtype":"gage","title":"DGSZ","label":"Watt 2","format":"{{value}}","min":0,"max":"50","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","diff":false,"className":"","x":1300,"y":500,"wires":[]},{"id":"0bdffbdc80485488","type":"ui_gauge","z":"9120cee1.edcfb","name":"gauge-3","group":"8b83ab75.fea488","order":6,"width":2,"height":2,"gtype":"gage","title":"DGGZ","label":"Watt 3","format":"{{value}}","min":0,"max":"50","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","diff":false,"className":"","x":1300,"y":760,"wires":[]},{"id":"aa9515f345fab96f","type":"ui_gauge","z":"9120cee1.edcfb","name":"gauge-4","group":"8b83ab75.fea488","order":7,"width":2,"height":2,"gtype":"gage","title":"DGBZ","label":"Watt 4","format":"{{value}}","min":0,"max":"50","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","diff":false,"className":"","x":1300,"y":1020,"wires":[]},{"id":"7029f8ad28fa27a5","type":"ui_chart","z":"9120cee1.edcfb","name":"","group":"8b83ab75.fea488","order":28,"width":8,"height":5,"label":"12 h Verlauf","chartType":"line","legend":"true","xformat":"HH:mm","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"30","removeOlder":"12","removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#f73808","#1476f5","#43ff0f","#ffdd00","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":1310,"y":1280,"wires":[[]]},{"id":"292716be47b084ee","type":"ui_template","z":"9120cee1.edcfb","group":"8b83ab75.fea488","name":"firmware","order":1,"width":1,"height":1,"format":"
\n
\n
fw
\n
","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","className":"","x":1300,"y":100,"wires":[[]]},{"id":"e4a382e8c7a95a41","type":"ui_template","z":"9120cee1.edcfb","group":"8b83ab75.fea488","name":"wifi","order":3,"width":1,"height":1,"format":"
\n
\n
\n {{msg.topic}}\n
\n
","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","className":"","x":1290,"y":180,"wires":[[]]},{"id":"1fd88df573b82846","type":"ui_template","z":"9120cee1.edcfb","group":"696818e9f361e593","name":"Custom Styling","order":1,"width":"0","height":"0","format":"","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":false,"templateScope":"global","className":"","x":1320,"y":40,"wires":[[]]},{"id":"136cce15056d5081","type":"debug","z":"9120cee1.edcfb","name":"debug 106","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1010,"y":360,"wires":[]},{"id":"419fb02f5f8cee83","type":"trigger","z":"9120cee1.edcfb","name":"","op1":"","op2":"","op1type":"nul","op2type":"date","duration":"10","extend":true,"overrideDelay":false,"units":"min","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":460,"y":940,"wires":[["b33b8d32ddf2ddb0"]]},{"id":"b33b8d32ddf2ddb0","type":"change","z":"9120cee1.edcfb","name":"watch dog","rules":[{"t":"set","p":"payload","pt":"msg","to":"DG Shelly Pro 4 MQTT 10 min offline","tot":"str"},{"t":"set","p":"WD_UG-shelly-pro-4","pt":"global","to":"off","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":630,"y":940,"wires":[["105c761dce82fa4c"]]},{"id":"105c761dce82fa4c","type":"link out","z":"9120cee1.edcfb","name":"link out 46","mode":"link","links":["6a7c2e9b33cb38d9"],"x":735,"y":940,"wires":[]},{"id":"aa5ac3263fb9b3f8","type":"inject","z":"9120cee1.edcfb","name":"reset","props":[{"p":"reset","v":"0","vt":"num"}],"repeat":"","crontab":"","once":false,"onceDelay":"1","topic":"","x":430,"y":880,"wires":[["791189012a3eda74","419fb02f5f8cee83"]]},{"id":"791189012a3eda74","type":"change","z":"9120cee1.edcfb","name":"WD_UG-shelly-pro-4","rules":[{"t":"set","p":"WD_DG-shelly-pro-4","pt":"global","to":"on","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":620,"y":880,"wires":[[]]},{"id":"d125bf9cffb68555","type":"junction","z":"9120cee1.edcfb","x":280,"y":460,"wires":[["f34e667527bf8670"]]},{"id":"7156e5e261e87e76","type":"catch","z":"9120cee1.edcfb","name":"All errors","scope":null,"uncaught":false,"x":560,"y":2100,"wires":[["b610e77b6807f610"]]},{"id":"b610e77b6807f610","type":"change","z":"9120cee1.edcfb","name":"DD-MM-YYYY HH:mm:ss","rules":[{"t":"set","p":"date","pt":"msg","to":"$moment().format(\"DD-MM-YYYY HH:mm:ss\")","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":750,"y":2100,"wires":[["b8bffaffb82af4f5"]]},{"id":"b8bffaffb82af4f5","type":"function","z":"9120cee1.edcfb","name":"","func":"msg.payload = \"Fehlerzeitpunkt: \" + msg.date + \" / \" +\n \"RPI: Monitor\" + \" / \" +\n \"Flow: shelly pro 4 pm\" + \" / \" +\n \"Fehlermeldung: \" + msg.error.message + \" / \" +\n \"Fehler ID: \"+ msg.error.source.id + \" / \" +\n \"Fehlertyp: \" + msg.error.source.type + \" / \" +\n \"Fehlernode: \" + msg.error.source.name + \" / \" + \n \"Fehlerzähler: \" + msg.error.source.count;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":940,"y":2100,"wires":[["edbd1e35a30b9a38"]]},{"id":"6a7c2e9b33cb38d9","type":"link in","z":"9120cee1.edcfb","name":"error","links":["527b90ac58733a47","3354802e289bcc34","2d45a65a57c42339","2eb9add8d3ad4e4e","96a2ed99c3d088a9","2bcdbfe2e33a917b","418e9bc2077c68d7","81ba5d7aa0a3af0a","d2fb8e151022c6c3","eba5e3d9423b7ca3","105c761dce82fa4c"],"x":985,"y":2060,"wires":[["edbd1e35a30b9a38"]]},{"id":"edbd1e35a30b9a38","type":"mqtt out","z":"9120cee1.edcfb","name":"to Telegram out","topic":"Heizung-Telegram","qos":"0","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"f5f6599b.7711a8","x":1200,"y":2080,"wires":[]},{"id":"f5f6599b.7711a8","type":"mqtt-broker","broker":"10.0.0.43","port":"1883","clientid":"","autoConnect":true,"usetls":false,"protocolVersion":4,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"8b83ab75.fea488","type":"ui_group","name":"DG shelly pro 4","tab":"743fd75e.f52cb8","order":1,"disp":true,"width":"8","collapse":false,"className":""},{"id":"696818e9f361e593","type":"ui_group","name":"Demo-3","tab":"355ca3bb331997b3","order":1,"disp":true,"width":"6","collapse":false,"className":""},{"id":"743fd75e.f52cb8","type":"ui_tab","name":"Meßsteckdosen","icon":"dashboard","order":1,"disabled":false,"hidden":false},{"id":"355ca3bb331997b3","type":"ui_tab","name":"Demo","icon":"dashboard","order":2,"disabled":false,"hidden":false}]