-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
windka
committed
Sep 24, 2023
1 parent
f0e260a
commit ca8a0ad
Showing
9 changed files
with
37 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
[{"id":"ed7589d527fde314","type":"grohe sense","z":"3a763adab0a2a52d","location":"dd73ac27fcefb839","room":"Wasserkeller","appliance":"SenseGuard","devicetype":"103","description":"","x":410,"y":120,"wires":[["1c805198756f32e4","8bd5c1954b70c692"]]},{"id":"c478c1d3715264d5","type":"function","z":"3a763adab0a2a52d","name":"data","func":"let end = new Date();\nlet start = new Date();\nstart.setDate(end.getDate() - 1); // last 7 days.\n\nmsg.payload = {\n data : {\n from : start,\n to : end\n }\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":250,"y":120,"wires":[["ed7589d527fde314"]]},{"id":"8c577a27b2846c21","type":"inject","z":"3a763adab0a2a52d","name":"get data","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":100,"y":120,"wires":[["c478c1d3715264d5"]]},{"id":"7c48a090670f1d7c","type":"ui_chart","z":"3a763adab0a2a52d","name":"","group":"c3c1f58f8122f797","order":3,"width":"0","height":"0","label":"Temperature","chartType":"line","legend":"false","xformat":"auto","interpolate":"step","nodata":"","dot":false,"ymin":"0","ymax":"30","removeOlder":"7","removeOlderPoints":"1000","removeOlderUnit":"86400","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#b31e1e","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":770,"y":80,"wires":[[]]},{"id":"1c805198756f32e4","type":"function","z":"3a763adab0a2a52d","name":"measurement","func":"if (msg.payload.data){\n let measurement = msg.payload.data.measurement;\n\n let temperatureData = [];\n let pressureData = [];\n let flowrateData = [];\n\n for (const item of measurement) {\n let date = new Date(item.timestamp);\n var timestamp = date; //Math.floor(date.getTime() / 1000); // unix\n\n let temperaturePoint = {\n x : timestamp,\n y: item.temperature_guard\n };\n temperatureData.push(temperaturePoint);\n\n let pressurePoint = {\n x: timestamp,\n y: item.pressure\n };\n pressureData.push(pressurePoint);\n\n let flowratePoint = {\n x: timestamp,\n y: item.flowrate\n };\n flowrateData.push(flowratePoint);\n }\n\n let msg1 = { \n payload : [{\n series: [\"Temperature\"],\n data: [temperatureData],\n labels: [\"SenseGuard\"]\n }]\n };\n\n let msg2 = {\n payload: [{\n series: [\"Pressure\"],\n data: [pressureData],\n labels: [\"SenseGuard\"]\n }]\n };\n\n let msg3 = {\n payload: [{\n series: [\"Flowrate\"],\n data: [flowrateData],\n labels: [\"SenseGuard\"]\n }]\n };\n\n let msgs = [msg1, msg2, msg3];\n return msgs;\n}\n","outputs":3,"noerr":0,"initialize":"","finalize":"","libs":[],"x":600,"y":120,"wires":[["7c48a090670f1d7c"],["d3bf5c1c5a788794"],["388db5f93031978b"]]},{"id":"d3bf5c1c5a788794","type":"ui_chart","z":"3a763adab0a2a52d","name":"","group":"c3c1f58f8122f797","order":3,"width":"0","height":"0","label":"Pressure","chartType":"line","legend":"false","xformat":"auto","interpolate":"step","nodata":"","dot":false,"ymin":"0","ymax":"10","removeOlder":"24","removeOlderPoints":"1000","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":760,"y":120,"wires":[[]]},{"id":"388db5f93031978b","type":"ui_chart","z":"3a763adab0a2a52d","name":"","group":"c3c1f58f8122f797","order":3,"width":"0","height":"0","label":"Flowrate","chartType":"line","legend":"false","xformat":"auto","interpolate":"step","nodata":"","dot":false,"ymin":"0","ymax":"20","removeOlder":"24","removeOlderPoints":"1000","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1eb328","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":760,"y":160,"wires":[[]]},{"id":"8bd5c1954b70c692","type":"function","z":"3a763adab0a2a52d","name":"withdrawals","func":"if (msg.payload.data){\n let withdrawals = msg.payload.data.withdrawals;\n\n let waterconsumptionData = [];\n let maxflowrateData = [];\n // TODO: hotwater_share, hotwater_share, water_cost, energy_cost\n\n for (const item of withdrawals) {\n let start = new Date(item.starttime);\n let stop = new Date(item.stoptime);\n\n let waterconsumptionPoint1 = {\n x : start,\n y: item.waterconsumption\n };\n let waterconsumptionPoint2 = {\n x: stop,\n y: 0\n };\n waterconsumptionData.push(waterconsumptionPoint1);\n waterconsumptionData.push(waterconsumptionPoint2);\n\n let maxflowratePoint1 = {\n x: start,\n y: item.maxflowrate\n };\n let maxflowratePoint2 = {\n x: stop,\n y: 0\n };\n maxflowrateData.push(maxflowratePoint1);\n maxflowrateData.push(maxflowratePoint2);\n }\n\n let msg1 = { \n payload : [{\n series: [\"Water Consumption\"],\n data: [waterconsumptionData],\n labels: [\"SenseGuard\"]\n }]\n };\n\n let msg2 = {\n payload: [{\n series: [\"Max Flowrate\"],\n data: [maxflowrateData],\n labels: [\"SenseGuard\"]\n }]\n };\n\n let msgs = [msg1, msg2];\n return msgs;\n}\n","outputs":2,"noerr":0,"initialize":"","finalize":"","libs":[],"x":590,"y":220,"wires":[["b0b2b52ac3d0bf14"],["819ecf89e1f7aa0f"]]},{"id":"b0b2b52ac3d0bf14","type":"ui_chart","z":"3a763adab0a2a52d","name":"","group":"c3c1f58f8122f797","order":3,"width":"0","height":"0","label":"Water Consumption","chartType":"line","legend":"false","xformat":"auto","interpolate":"step","nodata":"","dot":false,"ymin":"0","ymax":"30","removeOlder":"7","removeOlderPoints":"1000","removeOlderUnit":"86400","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1e30b3","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":790,"y":200,"wires":[[]]},{"id":"819ecf89e1f7aa0f","type":"ui_chart","z":"3a763adab0a2a52d","name":"","group":"c3c1f58f8122f797","order":3,"width":"0","height":"0","label":"Max Flowrate","chartType":"line","legend":"false","xformat":"auto","interpolate":"step","nodata":"","dot":false,"ymin":"0","ymax":"30","removeOlder":"7","removeOlderPoints":"1000","removeOlderUnit":"86400","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#b31e9f","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":780,"y":240,"wires":[[]]},{"id":"dd73ac27fcefb839","type":"grohe location","location":"Haus"},{"id":"c3c1f58f8122f797","type":"ui_group","name":"SenseGuard History","tab":"933900f0656633c1","order":4,"disp":true,"width":"6","collapse":false,"className":""},{"id":"933900f0656633c1","type":"ui_tab","name":"Grohe","icon":"fa-tint","disabled":false,"hidden":false}] | ||
[{"id":"18a50190d5728c82","type":"grohe sense","z":"3d8bc5187eb93fc0","location":"dd73ac27fcefb839","room":"Wasserkeller","appliance":"SenseGuard","devicetype":"103","description":"","x":570,"y":340,"wires":[["3d5f97c568c4cb42","84f27caf5714dfcb","64d01d21d74b529f"]]},{"id":"ef6e230a25a4f8b8","type":"function","z":"3d8bc5187eb93fc0","name":"data","func":"let end = new Date();\nlet start = new Date();\nstart.setDate(end.getDate() - 1); // last 7 days.\n\nmsg.payload = {\n data : {\n from : start,\n to : end,\n groupBy : 'hour'\n }\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":410,"y":340,"wires":[["18a50190d5728c82"]]},{"id":"475071bbc99ee5e0","type":"inject","z":"3d8bc5187eb93fc0","name":"get data","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":260,"y":340,"wires":[["ef6e230a25a4f8b8"]]},{"id":"fc41aee5ad16e5df","type":"ui_chart","z":"3d8bc5187eb93fc0","name":"","group":"c3c1f58f8122f797","order":3,"width":"0","height":"0","label":"Temperature Sense Guard","chartType":"line","legend":"false","xformat":"auto","interpolate":"step","nodata":"","dot":false,"ymin":"0","ymax":"30","removeOlder":"7","removeOlderPoints":"1000","removeOlderUnit":"86400","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#b31e1e","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":980,"y":300,"wires":[[]]},{"id":"3d5f97c568c4cb42","type":"function","z":"3d8bc5187eb93fc0","name":"measurement","func":"if (msg.payload.data){\n let measurement = msg.payload.data.measurement;\n\n let temperatureData = [];\n let pressureData = [];\n let flowrateData = [];\n\n for (const item of measurement) {\n let date = new Date(item.date);\n var timestamp = date; //Math.floor(date.getTime() / 1000); // unix\n\n let temperaturePoint = {\n x : timestamp,\n y: item.temperature_guard\n };\n temperatureData.push(temperaturePoint);\n\n let pressurePoint = {\n x: timestamp,\n y: item.pressure\n };\n pressureData.push(pressurePoint);\n\n let flowratePoint = {\n x: timestamp,\n y: item.flowrate\n };\n flowrateData.push(flowratePoint);\n }\n\n let msg1 = { \n payload : [{\n series: [\"Temperature\"],\n data: [temperatureData],\n labels: [\"SenseGuard\"]\n }]\n };\n\n let msg2 = {\n payload: [{\n series: [\"Pressure\"],\n data: [pressureData],\n labels: [\"SenseGuard\"]\n }]\n };\n\n let msg3 = {\n payload: [{\n series: [\"Flowrate\"],\n data: [flowrateData],\n labels: [\"SenseGuard\"]\n }]\n };\n\n let msgs = [msg1, msg2, msg3];\n return msgs;\n}\n","outputs":3,"noerr":0,"initialize":"","finalize":"","libs":[],"x":760,"y":340,"wires":[["fc41aee5ad16e5df"],["db2b19b13ea2801f"],["26b85ca823fc464f"]]},{"id":"db2b19b13ea2801f","type":"ui_chart","z":"3d8bc5187eb93fc0","name":"","group":"c3c1f58f8122f797","order":3,"width":"0","height":"0","label":"Pressure Sense Guard","chartType":"line","legend":"false","xformat":"auto","interpolate":"step","nodata":"","dot":false,"ymin":"0","ymax":"10","removeOlder":"24","removeOlderPoints":"1000","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":960,"y":340,"wires":[[]]},{"id":"26b85ca823fc464f","type":"ui_chart","z":"3d8bc5187eb93fc0","name":"","group":"c3c1f58f8122f797","order":3,"width":"0","height":"0","label":"Flowrate Sense Guard","chartType":"line","legend":"false","xformat":"auto","interpolate":"step","nodata":"","dot":false,"ymin":"0","ymax":"20","removeOlder":"24","removeOlderPoints":"1000","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1eb328","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":960,"y":380,"wires":[[]]},{"id":"84f27caf5714dfcb","type":"function","z":"3d8bc5187eb93fc0","name":"withdrawals","func":"if (msg.payload.data){\n let withdrawals = msg.payload.data.withdrawals;\n\n let waterconsumptionData = [];\n // TODO: hotwater_share, water_cost, energy_cost\n\n for (const item of withdrawals) {\n let date = new Date(item.date);\n\n let waterconsumptionPoint = {\n x : date,\n y: item.waterconsumption\n };\n waterconsumptionData.push(waterconsumptionPoint);\n }\n\n let msg1 = { \n payload : [{\n series: [\"Water Consumption\"],\n data: [waterconsumptionData],\n labels: [\"SenseGuard\"]\n }]\n };\n\n let msgs = [msg1];\n return msgs;\n}\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":750,"y":420,"wires":[["00a8f0759410f141"]]},{"id":"00a8f0759410f141","type":"ui_chart","z":"3d8bc5187eb93fc0","name":"","group":"c3c1f58f8122f797","order":3,"width":"0","height":"0","label":"Water Consumption","chartType":"line","legend":"false","xformat":"auto","interpolate":"step","nodata":"","dot":false,"ymin":"0","ymax":"100","removeOlder":"7","removeOlderPoints":"1000","removeOlderUnit":"86400","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1e30b3","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":950,"y":420,"wires":[[]]},{"id":"64d01d21d74b529f","type":"debug","z":"3d8bc5187eb93fc0","name":"debug","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":730,"y":480,"wires":[]},{"id":"dd73ac27fcefb839","type":"grohe location","location":"Haus"},{"id":"c3c1f58f8122f797","type":"ui_group","name":"SenseGuard History","tab":"933900f0656633c1","order":4,"disp":true,"width":"6","collapse":false,"className":""},{"id":"933900f0656633c1","type":"ui_tab","name":"Grohe","icon":"fa-tint","disabled":false,"hidden":false}] |
Oops, something went wrong.