[ { "id": "2c2a6608ac2fca11", "type": "tab", "label": "Flow 1", "disabled": false, "info": "", "env": [] }, { "id": "ecf6efb2ea76919e", "type": "group", "z": "2c2a6608ac2fca11", "name": "Power Meter", "style": { "stroke": "#0070c0", "fill": "#bfdbef", "label": true }, "nodes": [ "93b650fb3ab057f0", "ac0634b697271639", "91097da0ced4f627", "1ea43799a504bf7f", "7d6dde77591875ad", "de19395a88c1588b", "73ac08d21897f8f6", "999d1401a70264e5", "7ef3223ce7168a26", "91c642d650f0df03", "3772fed907459be3", "9459ab84cda20d3b", "b24221b37729d622", "6f7cc39137791e98", "55f2a21217da64c9", "d91b3005b2678217", "6e1f0846febf052d", "9c036044db2cd839", "06bfcf0cbae1f9ed", "29e8579b198bcb80" ], "x": 54, "y": 139, "w": 1352, "h": 742 }, { "id": "026aa343c0ef9d41", "type": "group", "z": "2c2a6608ac2fca11", "name": "Operation", "style": { "stroke": "#92d04f", "fill": "#c8e7a7", "label": true }, "nodes": [ "0d762fa74ca16e1e", "62601e5e270f771a", "0f6eeb96ce0b3a3c", "89a48a8dc6dfb57b" ], "x": 54, "y": 899, "w": 972, "h": 162 }, { "id": "93b650fb3ab057f0", "type": "mqtt in", "z": "2c2a6608ac2fca11", "g": "ecf6efb2ea76919e", "name": "", "topic": "S31/PV/SENSOR", "qos": "2", "datatype": "auto-detect", "broker": "82aeabb7b2d7622f", "nl": false, "rap": true, "rh": 0, "inputs": 0, "x": 160, "y": 180, "wires": [ [ "ac0634b697271639", "6f7cc39137791e98" ] ] }, { "id": "ac0634b697271639", "type": "debug", "z": "2c2a6608ac2fca11", "g": "ecf6efb2ea76919e", "name": "mqtt in", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 570, "y": 180, "wires": [] }, { "id": "91097da0ced4f627", "type": "ui-text", "z": "2c2a6608ac2fca11", "g": "ecf6efb2ea76919e", "group": "fe70eacc843f372c", "order": 1, "width": 0, "height": 0, "name": "", "label": "Volt [V]", "format": "{{msg.payload}}", "layout": "row-spread", "style": false, "font": "", "fontSize": 16, "color": "#717171", "wrapText": false, "className": "", "value": "payload", "valueType": "msg", "x": 720, "y": 240, "wires": [] }, { "id": "1ea43799a504bf7f", "type": "ui-text", "z": "2c2a6608ac2fca11", "g": "ecf6efb2ea76919e", "group": "fe70eacc843f372c", "order": 2, "width": 0, "height": 0, "name": "", "label": "Amp [A]", "format": "{{msg.payload}}", "layout": "row-spread", "style": false, "font": "", "fontSize": 16, "color": "#717171", "wrapText": false, "className": "", "value": "payload", "valueType": "msg", "x": 720, "y": 340, "wires": [] }, { "id": "7d6dde77591875ad", "type": "ui-text", "z": "2c2a6608ac2fca11", "g": "ecf6efb2ea76919e", "group": "fe70eacc843f372c", "order": 3, "width": 0, "height": 0, "name": "", "label": "Watt[W]", "format": "{{msg.payload}}", "layout": "row-spread", "style": false, "font": "", "fontSize": 16, "color": "#717171", "wrapText": false, "className": "", "value": "payload", "valueType": "msg", "x": 720, "y": 420, "wires": [] }, { "id": "de19395a88c1588b", "type": "ui-text", "z": "2c2a6608ac2fca11", "g": "ecf6efb2ea76919e", "group": "fe70eacc843f372c", "order": 4, "width": 0, "height": 0, "name": "", "label": "Today [kWh]", "format": "{{msg.payload}}", "layout": "row-spread", "style": false, "font": "", "fontSize": 16, "color": "#717171", "wrapText": false, "className": "", "value": "payload", "valueType": "msg", "x": 730, "y": 500, "wires": [] }, { "id": "73ac08d21897f8f6", "type": "ui-text", "z": "2c2a6608ac2fca11", "g": "ecf6efb2ea76919e", "group": "fe70eacc843f372c", "order": 5, "width": 0, "height": 0, "name": "", "label": "Yesterday [kWh]", "format": "{{msg.payload}}", "layout": "row-spread", "style": false, "font": "", "fontSize": 16, "color": "#717171", "wrapText": false, "className": "", "value": "payload", "valueType": "msg", "x": 740, "y": 580, "wires": [] }, { "id": "999d1401a70264e5", "type": "ui-text", "z": "2c2a6608ac2fca11", "g": "ecf6efb2ea76919e", "group": "fe70eacc843f372c", "order": 6, "width": 0, "height": 0, "name": "", "label": "Total [kWh]", "format": "{{msg.payload}}", "layout": "row-spread", "style": false, "font": "", "fontSize": 16, "color": "#717171", "wrapText": false, "className": "", "value": "payload", "valueType": "msg", "x": 730, "y": 660, "wires": [] }, { "id": "7ef3223ce7168a26", "type": "ui-chart", "z": "2c2a6608ac2fca11", "g": "ecf6efb2ea76919e", "group": "a3e2ef1d9bf6b183", "name": "", "label": "Volt [V]", "order": 1, "chartType": "line", "category": "topic", "categoryType": "msg", "xAxisLabel": "", "xAxisProperty": "", "xAxisPropertyType": "timestamp", "xAxisType": "time", "xAxisFormat": "", "xAxisFormatType": "auto", "xmin": "", "xmax": "", "yAxisLabel": "", "yAxisProperty": "payload", "yAxisPropertyType": "msg", "ymin": "", "ymax": "", "bins": 10, "action": "append", "stackSeries": false, "pointShape": "circle", "pointRadius": 4, "showLegend": false, "removeOlder": "1440", "removeOlderUnit": "60", "removeOlderPoints": "", "colors": [ "#0095ff", "#ff0000", "#ff7f0e", "#2ca02c", "#a347e1", "#d62728", "#ff9896", "#9467bd", "#c5b0d5" ], "textColor": [ "#666666" ], "textColorDefault": true, "gridColor": [ "#e5e5e5" ], "gridColorDefault": true, "width": 6, "height": "3", "className": "", "interpolation": "linear", "x": 1040, "y": 240, "wires": [ [] ] }, { "id": "91c642d650f0df03", "type": "ui-chart", "z": "2c2a6608ac2fca11", "d": true, "g": "ecf6efb2ea76919e", "group": "a3e2ef1d9bf6b183", "name": "", "label": "Amp [A]", "order": 2, "chartType": "line", "category": "topic", "categoryType": "msg", "xAxisLabel": "", "xAxisProperty": "", "xAxisPropertyType": "timestamp", "xAxisType": "time", "xAxisFormat": "", "xAxisFormatType": "auto", "xmin": "", "xmax": "", "yAxisLabel": "", "yAxisProperty": "payload", "yAxisPropertyType": "msg", "ymin": "", "ymax": "", "bins": 10, "action": "append", "stackSeries": false, "pointShape": "circle", "pointRadius": 4, "showLegend": false, "removeOlder": "1440", "removeOlderUnit": "60", "removeOlderPoints": "", "colors": [ "#0095ff", "#ff0000", "#ff7f0e", "#2ca02c", "#a347e1", "#d62728", "#ff9896", "#9467bd", "#c5b0d5" ], "textColor": [ "#666666" ], "textColorDefault": true, "gridColor": [ "#e5e5e5" ], "gridColorDefault": true, "width": 6, "height": "3", "className": "", "interpolation": "linear", "x": 1040, "y": 340, "wires": [ [] ] }, { "id": "3772fed907459be3", "type": "ui-chart", "z": "2c2a6608ac2fca11", "g": "ecf6efb2ea76919e", "group": "a3e2ef1d9bf6b183", "name": "", "label": "Watt [W]", "order": 3, "chartType": "line", "category": "topic", "categoryType": "msg", "xAxisLabel": "", "xAxisProperty": "", "xAxisPropertyType": "timestamp", "xAxisType": "time", "xAxisFormat": "", "xAxisFormatType": "auto", "xmin": "", "xmax": "", "yAxisLabel": "", "yAxisProperty": "payload", "yAxisPropertyType": "msg", "ymin": "", "ymax": "", "bins": 10, "action": "append", "stackSeries": false, "pointShape": "circle", "pointRadius": 4, "showLegend": false, "removeOlder": "1440", "removeOlderUnit": "60", "removeOlderPoints": "", "colors": [ "#0095ff", "#ff0000", "#ff7f0e", "#2ca02c", "#a347e1", "#d62728", "#ff9896", "#9467bd", "#c5b0d5" ], "textColor": [ "#666666" ], "textColorDefault": true, "gridColor": [ "#e5e5e5" ], "gridColorDefault": true, "width": 6, "height": "3", "className": "", "interpolation": "linear", "x": 1040, "y": 420, "wires": [ [] ] }, { "id": "9459ab84cda20d3b", "type": "ui-chart", "z": "2c2a6608ac2fca11", "g": "ecf6efb2ea76919e", "group": "a3e2ef1d9bf6b183", "name": "", "label": "Today [kWh]", "order": 4, "chartType": "line", "category": "topic", "categoryType": "msg", "xAxisLabel": "", "xAxisProperty": "", "xAxisPropertyType": "timestamp", "xAxisType": "time", "xAxisFormat": "", "xAxisFormatType": "auto", "xmin": "", "xmax": "", "yAxisLabel": "", "yAxisProperty": "payload", "yAxisPropertyType": "msg", "ymin": "", "ymax": "", "bins": 10, "action": "append", "stackSeries": false, "pointShape": "circle", "pointRadius": 4, "showLegend": false, "removeOlder": "1440", "removeOlderUnit": "60", "removeOlderPoints": "", "colors": [ "#0095ff", "#ff0000", "#ff7f0e", "#2ca02c", "#a347e1", "#d62728", "#ff9896", "#9467bd", "#c5b0d5" ], "textColor": [ "#666666" ], "textColorDefault": true, "gridColor": [ "#e5e5e5" ], "gridColorDefault": true, "width": 6, "height": "3", "className": "", "interpolation": "linear", "x": 1050, "y": 500, "wires": [ [] ] }, { "id": "0d762fa74ca16e1e", "type": "mqtt out", "z": "2c2a6608ac2fca11", "g": "026aa343c0ef9d41", "name": "", "topic": "S31/PV/cmnd/power", "qos": "", "retain": "", "respTopic": "", "contentType": "", "userProps": "", "correl": "", "expiry": "", "broker": "82aeabb7b2d7622f", "x": 900, "y": 980, "wires": [] }, { "id": "62601e5e270f771a", "type": "inject", "z": "2c2a6608ac2fca11", "g": "026aa343c0ef9d41", "name": "ON", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "ON", "payloadType": "str", "x": 150, "y": 940, "wires": [ [ "0d762fa74ca16e1e" ] ] }, { "id": "0f6eeb96ce0b3a3c", "type": "inject", "z": "2c2a6608ac2fca11", "g": "026aa343c0ef9d41", "name": "OFF", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "OFF", "payloadType": "str", "x": 150, "y": 1020, "wires": [ [ "0d762fa74ca16e1e" ] ] }, { "id": "89a48a8dc6dfb57b", "type": "ui-switch", "z": "2c2a6608ac2fca11", "g": "026aa343c0ef9d41", "name": "", "label": "power", "group": "ce0de5b722503e3d", "order": 1, "width": "2", "height": "1", "passthru": false, "decouple": false, "topic": "topic", "topicType": "msg", "style": "", "className": "", "layout": "row-spread", "clickableArea": "switch", "onvalue": "ON", "onvalueType": "str", "onicon": "", "oncolor": "", "offvalue": "OFF", "offvalueType": "str", "officon": "", "offcolor": "", "x": 270, "y": 980, "wires": [ [ "0d762fa74ca16e1e" ] ] }, { "id": "b24221b37729d622", "type": "influxdb out", "z": "2c2a6608ac2fca11", "g": "ecf6efb2ea76919e", "influxdb": "30915a3f3426f96b", "name": "", "measurement": "S31_Power", "precision": "", "retentionPolicy": "", "database": "database", "precisionV18FluxV20": "ms", "retentionPolicyV18Flux": "", "org": "organisation", "bucket": "bucket", "x": 1210, "y": 460, "wires": [] }, { "id": "6f7cc39137791e98", "type": "function", "z": "2c2a6608ac2fca11", "g": "ecf6efb2ea76919e", "name": "select data", "func": "var ENERGY = msg.payload.ENERGY;\n\n\nvar msg1 = { topic: msg.topic, payload: ENERGY.Voltage };\nvar msg2 = { topic: msg.topic, payload: ENERGY.Current };\nvar msg3 = { topic: msg.topic, payload: ENERGY.Power };\nvar msg4 = { topic: msg.topic, payload: ENERGY.Today };\nvar msg5 = { topic: msg.topic, payload: ENERGY.Yesterday };\n// save also to flow variable\nvar getYesterday = msg5.payload;\nflow.set('getYesterday', getYesterday); // save back to global\n\n\nvar msg6 = { topic: msg.topic, payload: ENERGY.Total };\n\nvar msg7 = { topic: msg.topic, payload: msg.payload.Time };\n\nreturn [msg1, msg2, msg3, msg4, msg5, msg6, msg7 ];\n", "outputs": 7, "timeout": 0, "noerr": 0, "initialize": "// Code added here will be run once\n// whenever the node is started.\nvar getYesterday = flow.get('getYesterday') || 0;\nflow.set('getYesterday', getYesterday); // save back to global", "finalize": "", "libs": [], "x": 370, "y": 480, "wires": [ [ "91097da0ced4f627", "7ef3223ce7168a26", "55f2a21217da64c9" ], [ "1ea43799a504bf7f", "91c642d650f0df03" ], [ "7d6dde77591875ad", "3772fed907459be3", "b24221b37729d622" ], [ "de19395a88c1588b", "9459ab84cda20d3b" ], [ "73ac08d21897f8f6" ], [ "999d1401a70264e5" ], [ "d91b3005b2678217" ] ] }, { "id": "55f2a21217da64c9", "type": "influxdb out", "z": "2c2a6608ac2fca11", "g": "ecf6efb2ea76919e", "influxdb": "30915a3f3426f96b", "name": "", "measurement": "S31_Volt", "precision": "", "retentionPolicy": "", "database": "database", "precisionV18FluxV20": "ms", "retentionPolicyV18Flux": "", "org": "organisation", "bucket": "bucket", "x": 1200, "y": 280, "wires": [] }, { "id": "d91b3005b2678217", "type": "ui-text", "z": "2c2a6608ac2fca11", "g": "ecf6efb2ea76919e", "group": "fe70eacc843f372c", "order": 6, "width": 0, "height": 0, "name": "", "label": "timestamp", "format": "{{msg.payload}}", "layout": "row-spread", "style": false, "font": "", "fontSize": 16, "color": "#717171", "wrapText": false, "className": "", "value": "payload", "valueType": "msg", "x": 730, "y": 740, "wires": [] }, { "id": "6e1f0846febf052d", "type": "inject", "z": "2c2a6608ac2fca11", "g": "ecf6efb2ea76919e", "name": "daily at 6:05 save Yesterday", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "05 06 * * *", "once": false, "onceDelay": 0.1, "topic": "", "payload": "getYesterday", "payloadType": "flow", "x": 300, "y": 800, "wires": [ [ "9c036044db2cd839", "06bfcf0cbae1f9ed" ] ] }, { "id": "9c036044db2cd839", "type": "influxdb out", "z": "2c2a6608ac2fca11", "g": "ecf6efb2ea76919e", "influxdb": "30915a3f3426f96b", "name": "", "measurement": "S31_Yesterday", "precision": "", "retentionPolicy": "", "database": "database", "precisionV18FluxV20": "ms", "retentionPolicyV18Flux": "", "org": "organisation", "bucket": "bucket", "x": 1200, "y": 800, "wires": [] }, { "id": "06bfcf0cbae1f9ed", "type": "debug", "z": "2c2a6608ac2fca11", "g": "ecf6efb2ea76919e", "name": "Yesterday Power consumption", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 610, "y": 840, "wires": [] }, { "id": "29e8579b198bcb80", "type": "inject", "z": "2c2a6608ac2fca11", "g": "ecf6efb2ea76919e", "name": "clear trend", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "[]", "payloadType": "json", "x": 760, "y": 180, "wires": [ [ "9459ab84cda20d3b", "3772fed907459be3", "7ef3223ce7168a26", "91c642d650f0df03" ] ] }, { "id": "82aeabb7b2d7622f", "type": "mqtt-broker", "name": "", "broker": "192.168.1.200", "port": 1883, "clientid": "", "autoConnect": true, "usetls": false, "protocolVersion": 4, "keepalive": 60, "cleansession": true, "autoUnsubscribe": true, "birthTopic": "", "birthQos": "0", "birthRetain": "false", "birthPayload": "", "birthMsg": {}, "closeTopic": "", "closeQos": "0", "closeRetain": "false", "closePayload": "", "closeMsg": {}, "willTopic": "", "willQos": "0", "willRetain": "false", "willPayload": "", "willMsg": {}, "userProps": "", "sessionExpiry": "" }, { "id": "fe70eacc843f372c", "type": "ui-group", "name": "S31 TASMOTA", "page": "518379ff0771b9ce", "width": "2", "height": 1, "order": 1, "showTitle": true, "className": "", "visible": "true", "disabled": "false", "groupType": "default" }, { "id": "a3e2ef1d9bf6b183", "type": "ui-group", "name": "Trend", "page": "518379ff0771b9ce", "width": 6, "height": 1, "order": 3, "showTitle": true, "className": "", "visible": "true", "disabled": "false", "groupType": "default" }, { "id": "ce0de5b722503e3d", "type": "ui-group", "name": "ON-OFF", "page": "518379ff0771b9ce", "width": "2", "height": 1, "order": 2, "showTitle": true, "className": "", "visible": "true", "disabled": "false", "groupType": "default" }, { "id": "30915a3f3426f96b", "type": "influxdb", "hostname": "192.168.1.200", "port": 8086, "protocol": "http", "database": "data", "name": "", "usetls": false, "tls": "", "influxdbVersion": "1.x", "url": "http://localhost:8086", "timeout": 10, "rejectUnauthorized": true }, { "id": "518379ff0771b9ce", "type": "ui-page", "name": "POWER", "ui": "4559a9becf29093f", "path": "/page2", "icon": "home", "layout": "grid", "theme": "aa9387cfbb387c6c", "breakpoints": [ { "name": "Default", "px": "0", "cols": "3" }, { "name": "Tablet", "px": "576", "cols": "6" }, { "name": "Small Desktop", "px": "768", "cols": "9" }, { "name": "Desktop", "px": "1024", "cols": "12" } ], "order": 1, "className": "", "visible": "true", "disabled": "false" }, { "id": "4559a9becf29093f", "type": "ui-base", "name": "Dash", "path": "/dashboard", "appIcon": "", "includeClientData": true, "acceptsClientConfig": [ "ui-notification", "ui-control" ], "showPathInSidebar": false, "headerContent": "page", "navigationStyle": "default", "titleBarStyle": "default", "showReconnectNotification": true, "notificationDisplayTime": 1, "showDisconnectNotification": true, "allowInstall": false }, { "id": "aa9387cfbb387c6c", "type": "ui-theme", "name": "ui-base.label.theme 2", "colors": { "surface": "#ffffff", "primary": "#0094ce", "bgPage": "#eeeeee", "groupBg": "#ffffff", "groupOutline": "#cccccc" }, "sizes": { "density": "default", "pagePadding": "12px", "groupGap": "12px", "groupBorderRadius": "4px", "widgetGap": "12px" } }, { "id": "01c65ef11dc0f848", "type": "global-config", "env": [], "modules": { "@flowfuse/node-red-dashboard": "1.29.0", "node-red-contrib-influxdb": "0.7.0" } } ]