Monitoring shelly pro 4 PM

I am using the shelly pro 4 PM to switch valves of my floor heating on and off. Switching is done per http request but monitoring uses MQTT. That’s fine unless you want to know your daily energy usage. Therefore, you must read your energy data at midnight per http-request. I have both versions included in the flow. The picture shows the UI of my MQTT monitoring. These are the abbreviation I used (DGWZ: Top floor living room, DGSZ: Top floor bedroom, DGGZ: Top floor guestroom, DGBZ: Top floor bathroom)

[{"id":"8528f6385757181a","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"fc63440432bd74fe","type":"inject","z":"8528f6385757181a","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":200,"wires":[["26b01df177335b0d"]]},{"id":"26b01df177335b0d","type":"http request","z":"8528f6385757181a","name":"http DG pro4pm","method":"GET","ret":"txt","paytoqs":"ignore","url":"http://10.0.0.170/rpc/Shelly.GetStatus","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":320,"y":200,"wires":[["33c8c8ad426e2d72"]]},{"id":"a69c7e5a3d7fd20b","type":"json","z":"8528f6385757181a","name":"json-1","property":"payload","action":"","pretty":false,"x":610,"y":200,"wires":[["c67bb43fc8a3b120","5b55d8ab186c1f8f"]]},{"id":"c67bb43fc8a3b120","type":"debug","z":"8528f6385757181a","name":"debug 40","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":600,"y":160,"wires":[]},{"id":"da82b196bbaca3f0","type":"mqtt in","z":"8528f6385757181a","name":"shellypro4pm-94b97ec035e8/status/#","topic":"shellypro4pm-94b97ec035e8/status/#","qos":"0","datatype":"json","broker":"f5f6599b.7711a8","nl":false,"rap":true,"rh":0,"inputs":0,"x":330,"y":640,"wires":[["06b80f9c00189d15","6f584fead513616f"]]},{"id":"6f584fead513616f","type":"join","z":"8528f6385757181a","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":true,"timeout":"","count":"4","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":590,"y":640,"wires":[["9073f4c2691fabbc","ccb3997e96575bf8"]]},{"id":"9073f4c2691fabbc","type":"function","z":"8528f6385757181a","name":"shelly pro4pm MQTT","func":"let timestamp = Date.now();\n\nlet energy0 = msg.payload[\"shellypro4pm-94b97ec035e8/status/switch:0\"].aenergy.total;\nlet energy1 = msg.payload[\"shellypro4pm-94b97ec035e8/status/switch:1\"].aenergy.total;\nlet energy2 = msg.payload[\"shellypro4pm-94b97ec035e8/status/switch:2\"].aenergy.total;\nlet energy3 = msg.payload[\"shellypro4pm-94b97ec035e8/status/switch:3\"].aenergy.total;\n\nlet totalenergy = parseFloat(((energy0 + energy1 + energy2 + energy3)/1000).toFixed(3));\n\nlet power0 = msg.payload[\"shellypro4pm-94b97ec035e8/status/switch:0\"].apower;\nlet power1 = msg.payload[\"shellypro4pm-94b97ec035e8/status/switch:1\"].apower;\nlet power2 = msg.payload[\"shellypro4pm-94b97ec035e8/status/switch:2\"].apower;\nlet power3 = msg.payload[\"shellypro4pm-94b97ec035e8/status/switch:3\"].apower;\n\nlet totalpower = parseFloat((power0 + power1 + power2 + power3).toFixed(2));\n\nlet current0 = msg.payload[\"shellypro4pm-94b97ec035e8/status/switch:0\"].current;\nlet current1 = msg.payload[\"shellypro4pm-94b97ec035e8/status/switch:1\"].current;\nlet current2 = msg.payload[\"shellypro4pm-94b97ec035e8/status/switch:2\"].current;\nlet current3 = msg.payload[\"shellypro4pm-94b97ec035e8/status/switch:3\"].current;\n\nlet totalcurrent = parseFloat(((current0 + current1 + current2 + current3)/4).toFixed(3));\n\nlet voltage0 = msg.payload[\"shellypro4pm-94b97ec035e8/status/switch:0\"].voltage;\nlet voltage1 = msg.payload[\"shellypro4pm-94b97ec035e8/status/switch:1\"].voltage;\nlet voltage2 = msg.payload[\"shellypro4pm-94b97ec035e8/status/switch:2\"].voltage;\nlet voltage3 = msg.payload[\"shellypro4pm-94b97ec035e8/status/switch:3\"].voltage;\n\nlet totalvoltage = parseFloat(((voltage0 + voltage1 + voltage2 + voltage3)/4).toFixed(2));\n\nlet totaltemperature = parseFloat((msg.payload[\"shellypro4pm-94b97ec035e8/status/switch:0\"].temperature.tC).toFixed(2));\n\nlet stat0 = msg.payload[\"shellypro4pm-94b97ec035e8/status/switch:0\"].output === false ? '<font color=\"#000000\">off</font>' : '<font color=\"#ff0000\">on</font>';\nlet stat1 = msg.payload[\"shellypro4pm-94b97ec035e8/status/switch:1\"].output === false ? '<font color=\"#000000\">off</font>' : '<font color=\"#ff0000\">on</font>';\nlet stat2 = msg.payload[\"shellypro4pm-94b97ec035e8/status/switch:2\"].output === false ? '<font color=\"#000000\">off</font>' : '<font color=\"#ff0000\">on</font>';\nlet stat3 = msg.payload[\"shellypro4pm-94b97ec035e8/status/switch:3\"].output === false ? '<font color=\"#000000\">off</font>' : '<font color=\"#ff0000\">on</font>';\n\nreturn[\n    {payload:timestamp},\n    {payload:totalenergy},\n    {payload:totalpower},\n    {payload:totalcurrent},\n    {payload:totalvoltage},\n    {payload:totaltemperature},        \n    {payload:stat0},\n    {payload:stat1},\n    {payload:stat2},\n    {payload:stat3},\n    {payload:power0, topic:\"DGWZ\"},\n    {payload:power1, topic:\"DGSZ\"},\n    {payload:power2, topic:\"DGGZ\"},\n    {payload:power3, topic:\"DGBZ\"}                \n];","outputs":14,"noerr":0,"initialize":"","finalize":"","libs":[],"x":800,"y":640,"wires":[["8d94366c53bf9312"],["7ab7ad35be485d58"],["ff35a2330dd21926"],["b890cc2a46adfb5d"],["94748e86d2b4afa8"],["6d87810f88630b7d"],["673547a91eb9aa2b"],["36b26feee1c191d8"],["79c2510a7d2ccf64"],["82ca04d9509ecf63"],["7ef526d2ba4cadd8"],["7ef526d2ba4cadd8"],["7ef526d2ba4cadd8"],["7ef526d2ba4cadd8"]],"outputLabels":["timestamp","totalernergy","power gauge","current","voltage","temperature","status 0","status 1","status 2","status 3","power 0","power 1","power 2","power 3"]},{"id":"8d94366c53bf9312","type":"moment","z":"8528f6385757181a","name":"HH:mm:ss DD-MM-YYYY","topic":"","input":"","inputType":"msg","inTz":"Europe/Berlin","adjAmount":0,"adjType":"days","adjDir":"add","format":"HH:mm:ss DD-MM-YYYY","locale":"de-DE","output":"payload","outputType":"msg","outTz":"Europe/Berlin","x":1130,"y":420,"wires":[["14d66e212b7665aa"]]},{"id":"5b55d8ab186c1f8f","type":"function","z":"8528f6385757181a","name":"shelly pro4pm http","func":"let timestamp = Date.now();\n\nlet energy0 = msg.payload[\"switch:0\"].aenergy.total;\nlet energy1 = msg.payload[\"switch:1\"].aenergy.total;\nlet energy2 = msg.payload[\"switch:2\"].aenergy.total;\nlet energy3 = msg.payload[\"switch:3\"].aenergy.total;\n\nlet totalenergy = parseFloat(((energy0 + energy1 + energy2 + energy3)/1000).toFixed(3)) + \" kWh\";\n\nlet power0 = msg.payload[\"switch:0\"].apower;\nlet power1 = msg.payload[\"switch:1\"].apower;\nlet power2 = msg.payload[\"switch:2\"].apower;\nlet power3 = msg.payload[\"switch:3\"].apower;\n\nlet totalpower = parseFloat((power0 + power1 + power2 + power3).toFixed(2)) + \" Watt\";\n\nlet current0 = msg.payload[\"switch:0\"].current;\nlet current1 = msg.payload[\"switch:1\"].current;\nlet current2 = msg.payload[\"switch:2\"].current;\nlet current3 = msg.payload[\"switch:3\"].current;\n\nlet totalcurrent = parseFloat(((current0 + current1 + current2 + current3)/4).toFixed(3)) + \" amp\";\n\nlet voltage0 = msg.payload[\"switch:0\"].voltage;\nlet voltage1 = msg.payload[\"switch:1\"].voltage;\nlet voltage2 = msg.payload[\"switch:2\"].voltage;\nlet voltage3 = msg.payload[\"switch:3\"].voltage;\n\nlet totalvoltage = parseFloat(((voltage0 + voltage1 + voltage2 + voltage3)/4).toFixed(2)) + \" Volt\";\n\nlet temperature0 = msg.payload[\"switch:0\"].temperature.tC;\nlet temperature1 = msg.payload[\"switch:1\"].temperature.tC;\nlet temperature2 = msg.payload[\"switch:2\"].temperature.tC;\nlet temperature3 = msg.payload[\"switch:3\"].temperature.tC;\n\nlet temperature = parseFloat(((temperature0 + temperature1 + temperature2 + temperature3) / 4).toFixed(2)) + \" °C\";\n\nreturn [\n    {payload:timestamp},\n    {payload:totalenergy},\n    {payload:totalpower},\n    {payload:totalcurrent},\n    {payload:totalvoltage},\n    {payload:temperature}    \n    ];","outputs":6,"noerr":0,"initialize":"","finalize":"","libs":[],"x":810,"y":200,"wires":[["82a9d94f95bac91e"],["6e5f2e12700986de"],["cbc18ef635a7668d"],["90ed0a06a4ad9ee2"],["dfeac06b4cc9e127"],["59e820f1bbeab395"]],"outputLabels":["timestamp","energy","power","current","voltage","temperature"]},{"id":"6e5f2e12700986de","type":"debug","z":"8528f6385757181a","name":"energy","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1070,"y":140,"wires":[]},{"id":"cbc18ef635a7668d","type":"debug","z":"8528f6385757181a","name":"power","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1070,"y":180,"wires":[]},{"id":"90ed0a06a4ad9ee2","type":"debug","z":"8528f6385757181a","name":"current","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1080,"y":220,"wires":[]},{"id":"dfeac06b4cc9e127","type":"debug","z":"8528f6385757181a","name":"voltage","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1080,"y":260,"wires":[]},{"id":"4c944aef2d5c4615","type":"debug","z":"8528f6385757181a","name":"timestamp","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1330,"y":100,"wires":[]},{"id":"82a9d94f95bac91e","type":"moment","z":"8528f6385757181a","name":"HH:mm:ss DD-MM-YYYY","topic":"","input":"","inputType":"msg","inTz":"Europe/Berlin","adjAmount":0,"adjType":"days","adjDir":"add","format":"HH:mm:ss DD:MM:YYYY","locale":"de-DE","output":"payload","outputType":"msg","outTz":"Europe/Berlin","x":1130,"y":100,"wires":[["4c944aef2d5c4615"]]},{"id":"14d66e212b7665aa","type":"ui_text","z":"8528f6385757181a","group":"df0f5cfff9c55580","order":1,"width":0,"height":0,"name":"","label":"","format":"{{msg.payload}}","layout":"row-center","className":"","x":1310,"y":420,"wires":[]},{"id":"ff35a2330dd21926","type":"ui_gauge","z":"8528f6385757181a","name":"power gauge","group":"df0f5cfff9c55580","order":2,"width":6,"height":3,"gtype":"gage","title":"","label":"Watt","format":"{{value}}","min":0,"max":"50","colors":["#00b500","#e6e600","#ca3838"],"seg1":"30","seg2":"40","className":"","x":1090,"y":500,"wires":[]},{"id":"7ef526d2ba4cadd8","type":"ui_chart","z":"8528f6385757181a","name":"power chart","group":"df0f5cfff9c55580","order":19,"width":6,"height":6,"label":"12h Verlauf","chartType":"line","legend":"true","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"0","ymax":"50","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#26f234","#f52933","#000000","#2c1ef1","#fafafa","#ffffff","#fdfcfc","#fcfcfd","#fcfcfc"],"outputs":1,"useDifferentColor":false,"className":"","x":1090,"y":820,"wires":[[]]},{"id":"ccb3997e96575bf8","type":"debug","z":"8528f6385757181a","name":"debug 41","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":600,"y":600,"wires":[]},{"id":"673547a91eb9aa2b","type":"ui_text","z":"8528f6385757181a","group":"df0f5cfff9c55580","order":14,"width":1,"height":1,"name":"Stat 0","label":"","format":"{{msg.payload}}","layout":"row-center","className":"","x":1070,"y":660,"wires":[]},{"id":"36b26feee1c191d8","type":"ui_text","z":"8528f6385757181a","group":"df0f5cfff9c55580","order":15,"width":1,"height":1,"name":"Stat 1","label":"","format":"{{msg.payload}}","layout":"row-center","className":"","x":1070,"y":700,"wires":[]},{"id":"79c2510a7d2ccf64","type":"ui_text","z":"8528f6385757181a","group":"df0f5cfff9c55580","order":16,"width":1,"height":1,"name":"Stat 2","label":"","format":"{{msg.payload}}","layout":"row-center","className":"","x":1070,"y":740,"wires":[]},{"id":"82ca04d9509ecf63","type":"ui_text","z":"8528f6385757181a","group":"df0f5cfff9c55580","order":17,"width":1,"height":1,"name":"Stat 3","label":"","format":"{{msg.payload}}","layout":"row-center","className":"","x":1070,"y":780,"wires":[]},{"id":"7ab7ad35be485d58","type":"ui_text","z":"8528f6385757181a","group":"df0f5cfff9c55580","order":4,"width":"3","height":"1","name":"totalenergy","label":"","format":"{{msg.payload}}&nbsp;kWh","layout":"row-center","className":"","x":1090,"y":460,"wires":[]},{"id":"94748e86d2b4afa8","type":"ui_text","z":"8528f6385757181a","group":"df0f5cfff9c55580","order":3,"width":"3","height":"1","name":"Voltage","label":"","format":"{{msg.payload}}&nbsp;Volt","layout":"row-center","className":"","x":1080,"y":580,"wires":[]},{"id":"b890cc2a46adfb5d","type":"ui_text","z":"8528f6385757181a","group":"df0f5cfff9c55580","order":5,"width":"3","height":"1","name":"Current","label":"","format":"{{msg.payload}}&nbsp;amp","layout":"row-center","className":"","x":1080,"y":540,"wires":[]},{"id":"634cd2c4056a81b0","type":"inject","z":"8528f6385757181a","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":570,"y":800,"wires":[["97f69ea94e381c40"]]},{"id":"aa0c70b4b3837733","type":"function","z":"8528f6385757181a","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\"});\nreturn null;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":820,"y":840,"wires":[["7ef526d2ba4cadd8"]]},{"id":"33c8c8ad426e2d72","type":"switch","z":"8528f6385757181a","name":"200","property":"statusCode","propertyType":"msg","rules":[{"t":"eq","v":"200","vt":"str"},{"t":"neq","v":"200","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":470,"y":200,"wires":[["a69c7e5a3d7fd20b"],["453c6f907ae3eef6"]]},{"id":"70a780d05f80ddf6","type":"mqtt out","z":"8528f6385757181a","name":"to Telegram out","topic":"Heizung-Telegram","qos":"0","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"f5f6599b.7711a8","x":740,"y":1020,"wires":[]},{"id":"11bf993144b68fb9","type":"function","z":"8528f6385757181a","name":"","func":"msg.payload = \"Fehlerzeitpunkt: \" + msg.payload + \" / \" +\n              \"Flow: Monitor shellyplug s\" + \" / \" +\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":520,"y":1040,"wires":[["70a780d05f80ddf6"]]},{"id":"056c05e9dad155d2","type":"moment","z":"8528f6385757181a","name":"HH:mm:ss DD:MM:YYYY","topic":"","input":"xyz","inputType":"flow","inTz":"Europe/Berlin","adjAmount":0,"adjType":"days","adjDir":"add","format":"HH:mm:ss DD:MM:YYYY","locale":"de_DE","output":"","outputType":"msg","outTz":"Europe/Berlin","x":330,"y":1040,"wires":[["11bf993144b68fb9"]]},{"id":"e02da1d559453e7d","type":"catch","z":"8528f6385757181a","name":"All errors","scope":null,"uncaught":false,"x":140,"y":1040,"wires":[["056c05e9dad155d2"]]},{"id":"97f69ea94e381c40","type":"change","z":"8528f6385757181a","name":"reset chart","rules":[{"t":"set","p":"payload","pt":"msg","to":"[]","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":830,"y":800,"wires":[["7ef526d2ba4cadd8","aa0c70b4b3837733"]]},{"id":"6d87810f88630b7d","type":"ui_text","z":"8528f6385757181a","group":"df0f5cfff9c55580","order":6,"width":"3","height":"1","name":"Temperature","label":"","format":"{{msg.payload}}&nbsp;&deg;C","layout":"row-center","className":"","x":1090,"y":620,"wires":[]},{"id":"06b80f9c00189d15","type":"trigger","z":"8528f6385757181a","name":"","op1":"","op2":"","op1type":"nul","op2type":"date","duration":"10","extend":true,"overrideDelay":false,"units":"min","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":250,"y":700,"wires":[["d4749eb1d3e78361"]]},{"id":"d4749eb1d3e78361","type":"change","z":"8528f6385757181a","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"DG Shelly Pro 4 MQTT 5 min offline","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":420,"y":700,"wires":[["32f03196793e0597"]]},{"id":"453c6f907ae3eef6","type":"change","z":"8528f6385757181a","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"DG Shelly Pro 4 http-requestnicht erfolgreich","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":280,"wires":[["a33721178ee96205"]]},{"id":"59e820f1bbeab395","type":"debug","z":"8528f6385757181a","name":"temperatgure","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1090,"y":300,"wires":[]},{"id":"00964306ea477282","type":"link in","z":"8528f6385757181a","name":"error","links":["a33721178ee96205","32f03196793e0597"],"x":565,"y":1000,"wires":[["70a780d05f80ddf6"]]},{"id":"a33721178ee96205","type":"link out","z":"8528f6385757181a","name":"link out 5","mode":"link","links":["00964306ea477282"],"x":475,"y":280,"wires":[]},{"id":"32f03196793e0597","type":"link out","z":"8528f6385757181a","name":"link out 6","mode":"link","links":["00964306ea477282"],"x":535,"y":700,"wires":[]},{"id":"b3fdf367e012f73f","type":"ui_spacer","z":"8528f6385757181a","name":"spacer","group":"df0f5cfff9c55580","order":13,"width":1,"height":1},{"id":"9948302efc9c0953","type":"ui_spacer","z":"8528f6385757181a","name":"spacer","group":"df0f5cfff9c55580","order":18,"width":1,"height":1},{"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":"df0f5cfff9c55580","type":"ui_group","name":"DG Shelly pro 4 pm","tab":"f71b0643ae027237","order":1,"disp":true,"width":"6","collapse":false,"className":""},{"id":"f71b0643ae027237","type":"ui_tab","name":"test shelly pro4pm","icon":"dashboard","order":1,"disabled":false,"hidden":false}]
1 Like

This is an update of my shelly pro 4 pm flow:

  • Now you just have to set your shelly id once on top of the node
  • you get firmware update info top left (currently there is a new version 13 beta)
  • wifi strength is displayed top right
  • in order to get ok graphics, you have to check the topics in the initialisation node and the main node. The topics must be identical.

[{"id":"dd8bd6d8994dd282","type":"mqtt in","z":"8ac5ac42307c5911","name":"MQTT DG pro4pm","topic":"shellypro4pm-94b97ec035e8/status/#","qos":"0","datatype":"json","broker":"f5f6599b.7711a8","nl":false,"rap":true,"rh":0,"inputs":0,"x":270,"y":1420,"wires":[["218884dbc46cb91f","4caea7839405868a"]]},{"id":"4caea7839405868a","type":"join","z":"8ac5ac42307c5911","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":true,"timeout":"","count":"4","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":530,"y":1400,"wires":[["64d346122d659ac3"]]},{"id":"64d346122d659ac3","type":"function","z":"8ac5ac42307c5911","name":"DG shelly pro4pm MQTT","func":"//=======================================================================\nconst id = \"shellypro4pm-94b97ec035e8\";    // change id to your shelly id\n//=======================================================================\n\nlet wifiout = {};\nlet timestamp = date_time_string();\nnode.status({ text: timestamp });\n\nswitch (msg.topic) {\n    case \"wifi\":\n        let wifiin = msg.payload;\n        wifiout = wifi_out(wifiin);\n        return [null, wifiout, { payload: timestamp }, null, null, null, null, null, null, null, null, null, null, null, null, null, null];\n    case \"firmware\":\n        let update = msg.payload;\n        delete msg.payload;\n        if (update === true) {\n            return [{ color: \"green\", icon: \"fa fa-thumbs-up\" }, null, { payload: timestamp }, null, null, null, null, null, null, null, null, null, null, null, null, null, null]; \n        }\n        else {\n            return [{ color: \"red\", icon: \"fa fa-cloud-download\" }, null, { payload: timestamp }, null, null, null, null, null, null, null, null, null, null, null, null, null, null];\n        }\n}\n\nreturn display_data();\n\n\n//========================================================================\n\nfunction display_data() {\n\n    let energy0 = msg.payload[id + \"/status/switch:0\"].aenergy.total;\n    let energy1 = msg.payload[id + \"/status/switch:1\"].aenergy.total;\n    let energy2 = msg.payload[id + \"/status/switch:2\"].aenergy.total;\n    let energy3 = msg.payload[id + \"/status/switch:3\"].aenergy.total;\n\n    let totalenergy = parseFloat(((energy0 + energy1 + energy2 + energy3)/1000).toFixed(3));\n    totalenergy = check_energy(totalenergy);\n\n    let power0 = msg.payload[id + \"/status/switch:0\"].apower;\n    let power1 = msg.payload[id + \"/status/switch:1\"].apower;\n    let power2 = msg.payload[id + \"/status/switch:2\"].apower;\n    let power3 = msg.payload[id + \"/status/switch:3\"].apower;\n\n    let totalpower = parseFloat((power0 + power1 + power2 + power3).toFixed(2));\n\n    let current0 = msg.payload[id + \"/status/switch:0\"].current;\n    let current1 = msg.payload[id + \"/status/switch:1\"].current;\n    let current2 = msg.payload[id + \"/status/switch:2\"].current;\n    let current3 = msg.payload[id + \"/status/switch:3\"].current;\n\n    let totalcurrent = parseFloat(((current0 + current1 + current2 + current3)/4).toFixed(3));\n\n    let voltage0 = msg.payload[id + \"/status/switch:0\"].voltage;\n    let voltage1 = msg.payload[id + \"/status/switch:1\"].voltage;\n    let voltage2 = msg.payload[id + \"/status/switch:2\"].voltage;\n    let voltage3 = msg.payload[id + \"/status/switch:3\"].voltage;\n\n    let totalvoltage = parseFloat(((voltage0 + voltage1 + voltage2 + voltage3)/4).toFixed(2));\n\n    let totaltemperature = parseFloat((msg.payload[id + \"/status/switch:0\"].temperature.tC).toFixed(2)) || 0;\n    let totaltemperaturealarm = totaltemperature;\n\n    if (totaltemperature < 60) {\n        totaltemperature = '<font color=\"green\">' + totaltemperature + '</font>';\n    }\n    else {\n        totaltemperature = '<font color=\"red\">' + totaltemperature + '</font>';\n    }\n\n    let stat0 = msg.payload[id + \"/status/switch:0\"].output === false ? '<font color=\"#000000\">off</font>' : '<font color=\"#ff0000\">on</font>';\n    let stat1 = msg.payload[id + \"/status/switch:1\"].output === false ? '<font color=\"#000000\">off</font>' : '<font color=\"#ff0000\">on</font>';\n    let stat2 = msg.payload[id + \"/status/switch:2\"].output === false ? '<font color=\"#000000\">off</font>' : '<font color=\"#ff0000\">on</font>';\n    let stat3 = msg.payload[id + \"/status/switch:3\"].output === false ? '<font color=\"#000000\">off</font>' : '<font color=\"#ff0000\">on</font>';\n\n    return[\n        null,\n        null,\n        {payload:timestamp},\n        {payload:totalenergy},\n        {payload:totalpower},\n        {payload:totalcurrent},\n        {payload:totalvoltage},\n        {payload:totaltemperature},\n        {payload:totaltemperaturealarm},             \n        {payload:stat0},\n        {payload:stat1},\n        {payload:stat2},\n        {payload:stat3},\n        {payload:power0, topic:\"DGWZ\"},\n        {payload:power1, topic:\"DGSZ\"},\n        {payload:power2, topic:\"DGGZ\"},\n        {payload:power3, topic:\"DGBZ\"}                \n    ];\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//--------------------------------------------------------------------\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 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//--------------------------------------------------------------------","outputs":17,"noerr":0,"initialize":"// Code added here will be run once\n// whenever the node is started.\ncontext.set('last_energy', 0);","finalize":"","libs":[],"x":1010,"y":1400,"wires":[["f0d9f5723c9ef5d5"],["14d2fe416e7589e0"],["981734dda47f39fd"],["9511d01f8abcf8d4"],["505ad78c3b8ee315"],["1034b937d2328406"],["511a9f8ceec1af03"],["1a519875a7fae5c5"],["f0a0bef2e1a4116f"],["e09feefdf0595161"],["2b5fa0587d12b68d"],["8446034c2b70953d"],["51058151e886b2c3"],["7cec33b117e59103"],["7cec33b117e59103"],["7cec33b117e59103"],["7cec33b117e59103"]],"outputLabels":["firmware","wifi","timestamp","total energy","power","current","voltage","temperature","temperaturealarm","status 0","status 1","status 2","status 3","power 0","power 1","power 2","poower 3"]},{"id":"981734dda47f39fd","type":"ui_text","z":"8ac5ac42307c5911","group":"8b83ab75.fea488","order":2,"width":"4","height":"1","name":"timestamp","label":"","format":"{{msg.payload}}","layout":"row-center","className":"","x":1290,"y":1180,"wires":[]},{"id":"505ad78c3b8ee315","type":"ui_gauge","z":"8ac5ac42307c5911","name":"power gauge","group":"8b83ab75.fea488","order":4,"width":6,"height":3,"gtype":"gage","title":"","label":"Watt","format":"{{value}}","min":0,"max":"50","colors":["#00b500","#e6e600","#ca3838"],"seg1":"30","seg2":"40","className":"","x":1290,"y":1260,"wires":[]},{"id":"7cec33b117e59103","type":"ui_chart","z":"8ac5ac42307c5911","name":"power chart","group":"8b83ab75.fea488","order":15,"width":6,"height":6,"label":"12h Verlauf","chartType":"line","legend":"true","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"0","ymax":"50","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#26f234","#f52933","#000000","#2c1ef1","#fafafa","#ffffff","#fdfcfc","#fcfcfd","#fcfcfc"],"outputs":1,"useDifferentColor":false,"className":"","x":1290,"y":1620,"wires":[[]]},{"id":"e09feefdf0595161","type":"ui_text","z":"8ac5ac42307c5911","group":"8b83ab75.fea488","order":10,"width":1,"height":1,"name":"Stat 0","label":"","format":"{{msg.payload}}","layout":"row-center","className":"","x":1270,"y":1460,"wires":[]},{"id":"2b5fa0587d12b68d","type":"ui_text","z":"8ac5ac42307c5911","group":"8b83ab75.fea488","order":11,"width":1,"height":1,"name":"Stat 1","label":"","format":"{{msg.payload}}","layout":"row-center","className":"","x":1270,"y":1500,"wires":[]},{"id":"8446034c2b70953d","type":"ui_text","z":"8ac5ac42307c5911","group":"8b83ab75.fea488","order":12,"width":1,"height":1,"name":"Stat 2","label":"","format":"{{msg.payload}}","layout":"row-center","className":"","x":1270,"y":1540,"wires":[]},{"id":"51058151e886b2c3","type":"ui_text","z":"8ac5ac42307c5911","group":"8b83ab75.fea488","order":13,"width":1,"height":1,"name":"Stat 3","label":"","format":"{{msg.payload}}","layout":"row-center","className":"","x":1270,"y":1580,"wires":[]},{"id":"9511d01f8abcf8d4","type":"ui_text","z":"8ac5ac42307c5911","group":"8b83ab75.fea488","order":6,"width":"3","height":"1","name":"totalenergy","label":"","format":"{{msg.payload}}&nbsp;kWh","layout":"row-center","className":"","x":1290,"y":1220,"wires":[]},{"id":"511a9f8ceec1af03","type":"ui_text","z":"8ac5ac42307c5911","group":"8b83ab75.fea488","order":5,"width":"3","height":"1","name":"Voltage","label":"","format":"{{msg.payload}}&nbsp;Volt","layout":"row-center","className":"","x":1280,"y":1340,"wires":[]},{"id":"1034b937d2328406","type":"ui_text","z":"8ac5ac42307c5911","group":"8b83ab75.fea488","order":7,"width":"3","height":"1","name":"Current","label":"","format":"{{msg.payload}}&nbsp;amp","layout":"row-center","className":"","x":1280,"y":1300,"wires":[]},{"id":"a7409944092ff3b7","type":"inject","z":"8ac5ac42307c5911","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":270,"y":1580,"wires":[["a18325db6c95810b"]]},{"id":"199469b8084415cf","type":"function","z":"8ac5ac42307c5911","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":1040,"y":1620,"wires":[["7cec33b117e59103"]]},{"id":"a18325db6c95810b","type":"change","z":"8ac5ac42307c5911","name":"reset chart","rules":[{"t":"set","p":"payload","pt":"msg","to":"[]","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1050,"y":1580,"wires":[["7cec33b117e59103","199469b8084415cf"]]},{"id":"1a519875a7fae5c5","type":"ui_text","z":"8ac5ac42307c5911","group":"8b83ab75.fea488","order":8,"width":"3","height":"1","name":"Temperature","label":"","format":"{{msg.payload}}&nbsp;&deg;C","layout":"row-center","className":"","x":1290,"y":1380,"wires":[]},{"id":"218884dbc46cb91f","type":"trigger","z":"8ac5ac42307c5911","name":"","op1":"","op2":"","op1type":"nul","op2type":"date","duration":"10","extend":true,"overrideDelay":false,"units":"min","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":520,"y":1540,"wires":[["04a81059a68023f1"]]},{"id":"04a81059a68023f1","type":"change","z":"8ac5ac42307c5911","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_DG-shelly-pro-4","pt":"global","to":"off","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":710,"y":1540,"wires":[["3354802e289bcc34"]]},{"id":"3354802e289bcc34","type":"link out","z":"8ac5ac42307c5911","name":"link out 6","mode":"link","links":["6a7c2e9b33cb38d9","56bb657d450ff785"],"x":835,"y":1540,"wires":[]},{"id":"14d2fe416e7589e0","type":"ui_template","z":"8ac5ac42307c5911","group":"8b83ab75.fea488","name":"wifi","order":3,"width":"1","height":"1","format":"<div style=\"color:{{msg.payload}}; margin:auto;\" <i class=\"fa fa-wifi fa-1x\" aria-hidden=\"true\"> </i></div>\n<div>\n    <center>\n        <small><small><small>{{msg.topic}}</small></small></small>\n    </center>\n</div>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","className":"","x":1270,"y":1140,"wires":[[]]},{"id":"2eb9add8d3ad4e4e","type":"link out","z":"8ac5ac42307c5911","name":"link out 7","mode":"link","links":["6a7c2e9b33cb38d9","56bb657d450ff785"],"x":1105,"y":1200,"wires":[]},{"id":"f0a0bef2e1a4116f","type":"function","z":"8ac5ac42307c5911","name":"temp > 60","func":"if (msg.payload > 60) {\n    msg.payload = \"shelly plug s Telefon über 60 Grad!\"\n    return msg;\n}\nelse {\n    return { reset: 0 };\n}   ","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1280,"y":1420,"wires":[["a4279db02fc503e5"]]},{"id":"96a2ed99c3d088a9","type":"link out","z":"8ac5ac42307c5911","name":"link out 8","mode":"link","links":["6a7c2e9b33cb38d9","56bb657d450ff785"],"x":1495,"y":1420,"wires":[]},{"id":"a4279db02fc503e5","type":"rbe","z":"8ac5ac42307c5911","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":true,"property":"payload","topi":"topic","x":1410,"y":1420,"wires":[["96a2ed99c3d088a9"]]},{"id":"3cf9fffe6f51a462","type":"function","z":"8ac5ac42307c5911","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":750,"y":1300,"wires":[["64d346122d659ac3"]]},{"id":"2fd4f37c08bcac41","type":"switch","z":"8ac5ac42307c5911","name":"topic","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"5min","vt":"str"},{"t":"eq","v":"firmware","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":470,"y":1320,"wires":[["31991fbe3d793141"],["9d342c11c1b3d852"]]},{"id":"8a0fb2d7b7f8bd22","type":"link call","z":"8ac5ac42307c5911","name":"lc http-req DG shelly pro4 pm","links":["d59a2325dd14c795"],"linkType":"static","timeout":"100","x":780,"y":1200,"wires":[["07b71cff68cb3b9f"]]},{"id":"e44c8f01b4bd3804","type":"change","z":"8ac5ac42307c5911","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":590,"y":1200,"wires":[["8a0fb2d7b7f8bd22"]]},{"id":"b64fde8b50d26912","type":"function","z":"8ac5ac42307c5911","name":"firmware","func":"let update = isEmptyObject(msg.payload.sys.available_updates);\nnode.status({ text: update });\nreturn{topic:\"firmware\", payload:update};\n\n//--------------------------------------------------------------------\n\nfunction isEmptyObject(obj) {\n    var name;\n    for (name in obj) {\n        return false;\n    }\n    return true;\n}\n\n//--------------------------------------------------------------------\n// true means empty object and empty object means no new FW available\n//--------------------------------------------------------------------","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":760,"y":1360,"wires":[["64d346122d659ac3"]]},{"id":"d28ffab13bf5d958","type":"inject","z":"8ac5ac42307c5911","name":"00:30","props":[{"p":"topic","vt":"str"},{"p":"payload"}],"repeat":"","crontab":"30 00 * * *","once":true,"onceDelay":"5","topic":"firmware","payload":"","payloadType":"date","x":310,"y":1220,"wires":[["0f180b8d0ce353e3"]]},{"id":"f0d9f5723c9ef5d5","type":"ui_template","z":"8ac5ac42307c5911","group":"8b83ab75.fea488","name":"firmware","order":1,"width":"1","height":"1","format":"<div style=\"color:{{msg.color}}; margin:auto;\" <i class=\"{{msg.icon}}\" aria-hidden=\"true\"></i> </div>\n<div>\n    <center> <small><small><small>fw</small></small></small> </center>\n</div>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","className":"","x":1280,"y":1100,"wires":[[]]},{"id":"07b71cff68cb3b9f","type":"switch","z":"8ac5ac42307c5911","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":970,"y":1200,"wires":[["2eb9add8d3ad4e4e"],["2fd4f37c08bcac41"]]},{"id":"0acf40193f69e81a","type":"inject","z":"8ac5ac42307c5911","name":"every 5 min","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"300","crontab":"","once":true,"onceDelay":"0.5","topic":"5min","payload":"","payloadType":"date","x":290,"y":1180,"wires":[["0f180b8d0ce353e3"]]},{"id":"0f180b8d0ce353e3","type":"switch","z":"8ac5ac42307c5911","name":"","property":"WD_DG-shelly-pro-4","propertyType":"global","rules":[{"t":"eq","v":"on","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":470,"y":1200,"wires":[["e44c8f01b4bd3804"]]},{"id":"41a6d6aa9991c873","type":"inject","z":"8ac5ac42307c5911","name":"reset","props":[{"p":"reset","v":"0","vt":"num"}],"repeat":"","crontab":"","once":false,"onceDelay":"1","topic":"","x":550,"y":1480,"wires":[["db17acdd43ff24d8","218884dbc46cb91f"]]},{"id":"db17acdd43ff24d8","type":"change","z":"8ac5ac42307c5911","name":"WD_DG-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":740,"y":1480,"wires":[[]]},{"id":"24fd5f525b45b58d","type":"change","z":"8ac5ac42307c5911","name":"","rules":[{"t":"set","p":"WD_DG-shelly-pro-4","pt":"global","to":"on","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":800,"y":1120,"wires":[[]]},{"id":"578e4a2590f23eec","type":"inject","z":"8ac5ac42307c5911","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":570,"y":1120,"wires":[["24fd5f525b45b58d"]]},{"id":"7306c81de480c5d0","type":"mqtt out","z":"8ac5ac42307c5911","name":"to Telegram out","topic":"Heizung-Telegram","qos":"0","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"f5f6599b.7711a8","x":1080,"y":1780,"wires":[]},{"id":"51ea60c9bde44987","type":"function","z":"8ac5ac42307c5911","name":"error msg","func":"msg.payload = \"Fehlerzeitpunkt: \" + msg.payload + \" / \" +\n    \"RPI: Development 2\" + \" / \" +\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":820,"y":1800,"wires":[["7306c81de480c5d0"]]},{"id":"014b45c9f849bcbf","type":"catch","z":"8ac5ac42307c5911","name":"All errors","scope":null,"uncaught":false,"x":440,"y":1800,"wires":[["56944a9c56e428d6"]]},{"id":"56bb657d450ff785","type":"link in","z":"8ac5ac42307c5911","name":"error","links":["527b90ac58733a47","3354802e289bcc34","2d45a65a57c42339","2eb9add8d3ad4e4e","96a2ed99c3d088a9","2bcdbfe2e33a917b","418e9bc2077c68d7","81ba5d7aa0a3af0a","d2fb8e151022c6c3"],"x":865,"y":1760,"wires":[["7306c81de480c5d0"]]},{"id":"56944a9c56e428d6","type":"change","z":"8ac5ac42307c5911","name":"HH:mm:ss DD-MM-YYYY","rules":[{"t":"set","p":"payload","pt":"msg","to":"$moment().format(\"HH:mm:ss DD-MM-YYYY\")","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":630,"y":1800,"wires":[["51ea60c9bde44987"]]},{"id":"31991fbe3d793141","type":"junction","z":"8ac5ac42307c5911","x":580,"y":1300,"wires":[["3cf9fffe6f51a462"]]},{"id":"9d342c11c1b3d852","type":"junction","z":"8ac5ac42307c5911","x":580,"y":1360,"wires":[["b64fde8b50d26912"]]},{"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":"6","collapse":false},{"id":"743fd75e.f52cb8","type":"ui_tab","name":"Meßsteckdosen","icon":"dashboard","order":1,"disabled":false,"hidden":false}]
1 Like

talking about monitorig a Shelly 4 PM.... you might want to check this use-case:

:slight_smile:

I know this. Look at my post "shelly button actions to node red".
It shows only on and off.
I am using this method to switch z- wave plugs with shelly butons.
Power and energy changes have to be handled differently.
By the way, with shelly pro 4 pm it is different.

This is version 2 of the shelly pro 4 monitoring. It is a complete redesign and now has 4 channel monitoring. New incoming data will change the background of the relevant fields.
As I am monitoring 15+ shellies there are many http-requests which, when not serialized, created network troubles. Therefore, I have implemented a central http-request with rate limiter which will be called from the link-node.
Unfortunately, the size of the flow is slightly to big for posting it the usual way. Therefore, please download the text file.


shelly pro4 pm version 2.txt (32.6 KB)

1 Like

I found a littel problem in the node:
please change "false" to "true"
It should look like below:

case "firmware":
    let update = msg.payload;
    delete msg.payload;
    if (update === true) {

false means green color or no update available