-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathirrigation_computer.json
1 lines (1 loc) · 26.3 KB
/
irrigation_computer.json
1
[{"id":"efd0c41f0ef91533","type":"comment","z":"151def52ea276427","name":"Irrigation computer","info":"# Irrigation Computer function node\n\n## Inputs\n\nThe function node expects the following data\n\n`msg.topic === \"settings\"`\nThis should contain the settings for the computer to function.\nThe main object in the settings is `temperatures`. This is an array of objects where in each object there is a `temperature` field and `waterneeded` field. This means that if the `temperature` for the day exceeds this temperature the lawn need `waterneeded` amount of water.\n\n`msg.topic === \"temperature\"`\n`msg.payload` should contain the outside temperature\n\n`msg.topic === \"rainfall\"`\n`msg.payload` should contain the rainfall for the last 24 hours\n\n`msg.topic === \"irrigation\"`\n`msg.payload` should contain the amount of water irrigated out to the lawn\n\n`msg.topic === \"calculate\"`\nThis message will run the water calculation and decide is watering is needed. \n\n## Output\n\nThe data on the first and the second output is the same. It sends out the complete `data` which is also stored in the context.\nThere is a message sent out on the first port every time data is updated. This can be used to update UI. The second port only sends out a message if the irrigation needs to be started.","x":3030,"y":1420,"wires":[]},{"id":"a215d6ce142ade89","type":"function","z":"151def52ea276427","name":"Irrigation Computer","func":"function AddMessage(data, text, maxmessages) {\n if (data.messages.length === maxmessages) {\n data.messages.pop();\n }\n let now = new Date();\n data.messages.unshift({ \"timestamp\": now.getTime(), \"text\": text, \"timetxt\": now.toLocaleString() });\n data.msgtxt = \"\";\n for (let i = 0; i < data.messages.length; i++) {\n let timestamp = new Date(data.messages[i].timestamp)\n data.msgtxt += timestamp.toLocaleString() + \" | \" + data.messages[i].text + \"<br/>\";\n }\n}\n\nlet secondoutput = null;\n\n// Process the settings message and store it\nif (msg.topic===\"settings\") {\n context.set(\"settings\",msg.payload);\n return;\n}\n\n// Reload predefined settings\nif (msg.topic===\"loaddata\") {\n context.set(\"data\",msg.payload,\"file\");\n}\n\nlet data = context.get(\"data\",\"file\");\nif (data === undefined) {\n data = {\n \"maxtemp\": -100.0, \"rainfall\": 0.0, \"tempcount\": 0, \"raincount\": 0, \"waterbalance\": 0, \"chanceofrain\": 0, \"messages\": []};\n}\n\n// Check that we have all the data\nlet settings = context.get(\"settings\");\nif (settings === undefined) {\n node.status({ fill: \"red\", shape: \"ring\", text: \"Settings missing\" });\n return;\n}\n\n// Process the temperature message\nif (msg.topic===\"temperature\") {\n data.currenttemp = msg.payload;\n if (msg.payload > data.maxtemp) {\n data.maxtemp = msg.payload;\n data.tempcount++;\n }\n context.set(\"data\", data, \"file\");\n}\n\n// Process the rainfall message\nif (msg.topic === \"rainfall\") {\n data.rainfall = msg.payload;\n data.raincount++;\n context.set(\"data\", data, \"file\");\n}\n\n// Process the chance of rain message\nif (msg.topic === \"chanceofrain\") {\n data.chanceofrain = msg.payload;\n context.set(\"data\", data, \"file\");\n}\n\n// Process the irrigation message\nif (msg.topic === \"irrigation\") {\n data.waterbalance += msg.payload;\n AddMessage(data, \"Adding water from irrigation, new balance: \" + data.waterbalance, settings.maxmessages);\n context.set(\"data\", data, \"file\");\n}\n\ndata.waterneeded = 0;\n\n// Calculate the water needed\nfor (let i=0;i<settings.temperatures.length;i++) {\n if (data.maxtemp > settings.temperatures[i].temperature) {\n data.waterneeded = settings.temperatures[i].waterneed;\n context.set(\"data\", data, \"file\");\n break;\n }\n}\n\n// Run the calculation\nif (msg.topic === \"calculate\") {\n if (data.tempcount < 10) {\n AddMessage(data, \"WARNING: temperature reading count zero or low (\" + data.tempcount + \"). Calculation could be incorrect.\", settings.maxmessages);\n }\n if (data.raincount === 0) {\n AddMessage(data, \"WARNING: rain reading count zero. Calculation could be incorrect.\", settings.maxmessages);\n }\n data.waterbalance = data.waterbalance + data.rainfall - data.waterneeded;\n data.waterbalance = Math.round(data.waterbalance * 10) / 10;\n AddMessage(data, \"New water balance calculated: \" + data.waterbalance + \". +\" + data.rainfall + \" from rainfall and -\" + data.waterneeded + \" from water needed\", settings.maxmessages);\n if (data.waterbalance <= 0) {\n if (data.chanceofrain > settings.chanceofrain_delay) {\n AddMessage(data, \"Chance of rain is high, irrigation delayed\"); \n } else {\n AddMessage(data, \"Watering needed, starting irrigation\");\n secondoutput = { \"topic\": \"irrigation\", \"payload\": JSON.parse(JSON.stringify(data)) };\n }\n }\n // reset values\n data.maxtemp = data.currenttemp;\n data.raincount = 0;\n data.tempcount = 0;\n // You may need to reset this value as well\n // data.rainfall = 0;\n context.set(\"data\", data, \"file\");\n}\n\nnode.status({ fill: \"green\", shape: \"ring\", text: \"Max temp: \" + data.maxtemp + \" | Rain today: \" + data.rainfall + \" | Water needed: \" + data.waterneeded + \" | Water balance: \" + data.waterbalance});\n\nreturn [{ \"topic\": \"irrigation\", \"payload\": data }, secondoutput];","outputs":2,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":3420,"y":1520,"wires":[["0d1909075552c0ba"],["18d2a9f617530801"]]},{"id":"cc2d1d4c86e3b444","type":"inject","z":"151def52ea276427","name":"Settings","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"settings","payload":"{\"temperatures\":[{\"temperature\":35,\"waterneed\":8},{\"temperature\":30,\"waterneed\":6},{\"temperature\":25,\"waterneed\":4},{\"temperature\":20,\"waterneed\":3},{\"temperature\":15,\"waterneed\":2}],\"chanceofrain_delay\":80,\"maxmessages\":50}","payloadType":"json","x":3070,"y":1480,"wires":[["a215d6ce142ade89"]]},{"id":"2989ea77ac0583d2","type":"change","z":"151def52ea276427","name":"Temperature","rules":[{"t":"set","p":"topic","pt":"msg","to":"temperature","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":3150,"y":1540,"wires":[["a215d6ce142ade89"]]},{"id":"d1c3a351e5016714","type":"change","z":"151def52ea276427","name":"Rainfall","rules":[{"t":"set","p":"topic","pt":"msg","to":"rainfall","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"payload.today","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":3160,"y":1580,"wires":[["a215d6ce142ade89"]]},{"id":"aee26bbc90e09ab0","type":"link in","z":"151def52ea276427","name":"Irrigation Computer Temperature In","links":["cf5c0a9b0cff712e"],"x":3015,"y":1540,"wires":[["2989ea77ac0583d2"]]},{"id":"4ed0bced4e4c4077","type":"link in","z":"151def52ea276427","name":"Irrigation Computer Rainfall In","links":["01c91968850ae0cd"],"x":3015,"y":1580,"wires":[["d1c3a351e5016714"]]},{"id":"aa45a40d1752a3dc","type":"change","z":"151def52ea276427","name":"Irrigation","rules":[{"t":"set","p":"topic","pt":"msg","to":"irrigation","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"8","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":3160,"y":1660,"wires":[["a215d6ce142ade89"]]},{"id":"cb9091330e9924ee","type":"inject","z":"151def52ea276427","name":"Calculate","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"00 23 * * *","once":false,"onceDelay":0.1,"topic":"calculate","payload":"","payloadType":"date","x":3150,"y":1720,"wires":[["a215d6ce142ade89"]]},{"id":"7bc3fd2d7939255b","type":"ui_text","z":"151def52ea276427","group":"ca8b0b77252e1f4a","order":0,"width":0,"height":0,"name":"","label":"Max temperature","format":"{{msg.payload.maxtemp}} °C","layout":"row-spread","className":"","x":4150,"y":1380,"wires":[]},{"id":"0cdb2b848e4c4dd3","type":"ui_text","z":"151def52ea276427","group":"ca8b0b77252e1f4a","order":0,"width":0,"height":0,"name":"","label":"Rainfall today","format":"{{msg.payload.rainfall}} mm","layout":"row-spread","className":"","x":4140,"y":1420,"wires":[]},{"id":"236d8ca3e8e62e50","type":"ui_text","z":"151def52ea276427","group":"ca8b0b77252e1f4a","order":0,"width":0,"height":0,"name":"","label":"Water needed","format":"{{msg.payload.waterneeded}} mm","layout":"row-spread","className":"","x":4140,"y":1460,"wires":[]},{"id":"b02834afcfcd99e5","type":"ui_text","z":"151def52ea276427","group":"ca8b0b77252e1f4a","order":0,"width":0,"height":0,"name":"","label":"Water balance","format":"{{msg.payload.waterbalance}} mm","layout":"row-spread","className":"","x":4140,"y":1500,"wires":[]},{"id":"9f97d73917d23144","type":"ui_text","z":"151def52ea276427","group":"ca8b0b77252e1f4a","order":0,"width":0,"height":0,"name":"","label":"Temp data count","format":"{{msg.payload.tempcount}}","layout":"row-spread","className":"","x":4150,"y":1540,"wires":[]},{"id":"ee6a723ce6f6a35b","type":"ui_text","z":"151def52ea276427","group":"ca8b0b77252e1f4a","order":0,"width":0,"height":0,"name":"","label":"Rain data count","format":"{{msg.payload.raincount}}","layout":"row-spread","className":"","x":4140,"y":1580,"wires":[]},{"id":"9fccdc5f12aa87b7","type":"ui_chart","z":"151def52ea276427","name":"","group":"35b2a1df3529e93c","order":0,"width":0,"height":0,"label":"Irrigation chart","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":"5","removeOlderPoints":"","removeOlderUnit":"86400","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#00a33f","#ff7f0e","#b80062","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":4480,"y":1720,"wires":[[]]},{"id":"8af5f8334d8a1721","type":"change","z":"151def52ea276427","name":"Current temp","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.currenttemp","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"Current temperature","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":3910,"y":1680,"wires":[["327e80e9da295330"]]},{"id":"bf7c7a7bc2548134","type":"change","z":"151def52ea276427","name":"Rainfall","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.rainfall","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"Rainfall","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":3900,"y":1720,"wires":[["37f352d76b00780c"]]},{"id":"372f1bc17d6a8d97","type":"change","z":"151def52ea276427","name":"Water Balance","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.waterbalance","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":"Water balance","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":3920,"y":1760,"wires":[["552cb52c3da39038"]]},{"id":"327e80e9da295330","type":"rbe","z":"151def52ea276427","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":true,"property":"payload","topi":"topic","x":4090,"y":1680,"wires":[["e90617e450dccee1"]]},{"id":"37f352d76b00780c","type":"rbe","z":"151def52ea276427","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":true,"property":"payload","topi":"topic","x":4090,"y":1720,"wires":[["9fccdc5f12aa87b7","cef8e9a35a4ad8b9"]]},{"id":"552cb52c3da39038","type":"rbe","z":"151def52ea276427","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":true,"property":"payload","topi":"topic","x":4090,"y":1760,"wires":[["9fccdc5f12aa87b7","cef8e9a35a4ad8b9"]]},{"id":"3b135be690882762","type":"ui_template","z":"151def52ea276427","group":"32e68baede1af094","name":"Messages","order":0,"width":"24","height":"10","format":"<div ng-bind-html=\"msg.payload\" height=\"100%\"></div>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","className":"","x":4110,"y":1820,"wires":[[]]},{"id":"f4244fb203229d2e","type":"change","z":"151def52ea276427","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.msgtxt","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":3920,"y":1820,"wires":[["3b135be690882762"]]},{"id":"77aebd2258cdcad0","type":"delay","z":"151def52ea276427","name":"","pauseType":"delay","timeout":"6","timeoutUnits":"hours","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":3860,"y":2140,"wires":[["edfd8a8d76e8164a"]]},{"id":"11c4c3ba57f2585f","type":"change","z":"151def52ea276427","name":"Chance of rain","rules":[{"t":"set","p":"topic","pt":"msg","to":"chanceofrain","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"msg.payload.daily[1].pop * 100","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":3140,"y":1620,"wires":[["a215d6ce142ade89"]]},{"id":"8f0113bae7337379","type":"link in","z":"151def52ea276427","name":"Irrigation Computer Chance of Rain In","links":["cdbec05f698bacc5"],"x":3015,"y":1620,"wires":[["11c4c3ba57f2585f"]]},{"id":"0c4b0f8a44df6ce5","type":"ui_text","z":"151def52ea276427","group":"ca8b0b77252e1f4a","order":0,"width":0,"height":0,"name":"","label":"Change of rain","format":"{{msg.payload.chanceofrain}} %","layout":"row-spread","className":"","x":4140,"y":1620,"wires":[]},{"id":"e90617e450dccee1","type":"delay","z":"151def52ea276427","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"15","rateUnits":"minute","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"allowrate":false,"outputs":1,"x":4260,"y":1680,"wires":[["9fccdc5f12aa87b7","cef8e9a35a4ad8b9"]]},{"id":"f52af2b7b5728bd0","type":"ui_text","z":"151def52ea276427","group":"ca8b0b77252e1f4a","order":0,"width":0,"height":0,"name":"","label":"Current temperature","format":"{{msg.payload.currenttemp}} °C","layout":"row-spread","className":"","x":4380,"y":1620,"wires":[]},{"id":"f629801a56a81fa5","type":"ui_text","z":"151def52ea276427","group":"ca8b0b77252e1f4a","order":0,"width":0,"height":0,"name":"Spacer","label":"","format":"","layout":"row-spread","className":"","x":4340,"y":1580,"wires":[]},{"id":"023472eeec39e788","type":"ui_text","z":"151def52ea276427","group":"ca8b0b77252e1f4a","order":0,"width":0,"height":0,"name":"Spacer","label":"","format":"","layout":"row-spread","className":"","x":4340,"y":1540,"wires":[]},{"id":"be02801c849c4930","type":"function","z":"151def52ea276427","name":"Watering needed","func":"// node.status({ fill: \"green\", shape: \"ring\", text: \"Max temp: \" + data.maxtemp + \" | Rain today: \" + data.rainfall + \" | Water needed: \" + data.waterneeded + \" | Water balance: \" + data.waterbalance });\n\n\nmsg.payload = { service: \"15\", type: \"message\", content: \"💦 Irrigation scheduled | Max temp: \" + msg.payload.maxtemp + \" | Rain today: \" + msg.payload.rainfall + \" | Water needed: \" + msg.payload.waterneeded + \" | Water balance: \" + msg.payload.waterbalance };\nreturn msg;\n\n","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":4150,"y":2020,"wires":[["5ab7041869c42180"]]},{"id":"5ab7041869c42180","type":"link out","z":"151def52ea276427","name":"","mode":"link","links":["86deb2f58b76aa52"],"x":4315,"y":2020,"wires":[]},{"id":"1c7b5beb21e08d40","type":"comment","z":"151def52ea276427","name":"Schedule watering","info":"","x":3930,"y":1920,"wires":[]},{"id":"36d55bddb7528d4b","type":"change","z":"151def52ea276427","name":"Modbus write msg","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"value\":true,\"fc\":5,\"unitid\":1,\"address\":1457,\"quantity\":1}","tot":"jsonata"},{"t":"set","p":"topic","pt":"msg","to":"irrigation_enable","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":4130,"y":2060,"wires":[["06a590ff3d230c0b"]]},{"id":"1312883c2ea4fb1c","type":"link out","z":"151def52ea276427","name":"link out 67","mode":"link","links":["488c5491f5a1ee53"],"x":4535,"y":2060,"wires":[]},{"id":"bf69848ab8e60ec6","type":"inject","z":"151def52ea276427","name":"Manual","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":3880,"y":2100,"wires":[["36d55bddb7528d4b"]]},{"id":"e5bfe46e5d22c3b3","type":"delay","z":"151def52ea276427","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":4380,"y":2100,"wires":[["1312883c2ea4fb1c"]]},{"id":"4242d296d81c04c8","type":"delay","z":"151def52ea276427","name":"","pauseType":"delay","timeout":"30","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":4380,"y":2140,"wires":[["1312883c2ea4fb1c"]]},{"id":"a2973a8279a6ddfc","type":"delay","z":"151def52ea276427","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"minutes","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":4380,"y":2180,"wires":[["1312883c2ea4fb1c"]]},{"id":"cef8e9a35a4ad8b9","type":"ui-chart","z":"151def52ea276427","group":"4f4b1e694ab12e37","name":"Irrigation Chart","label":"","order":1,"chartType":"line","category":"topic","categoryType":"msg","xAxisLabel":"","xAxisProperty":"","xAxisPropertyType":"property","xAxisType":"time","yAxisLabel":"","yAxisProperty":"","ymin":"","ymax":"","action":"append","pointShape":"circle","pointRadius":4,"showLegend":true,"removeOlder":"5","removeOlderUnit":"86400","removeOlderPoints":"","colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"width":6,"height":8,"className":"","x":4500,"y":1780,"wires":[[]]},{"id":"5ada9975d1929170","type":"change","z":"151def52ea276427","name":"Add Headers","rules":[{"t":"set","p":"headers","pt":"msg","to":"[{\"title\":\"Time\",\"value\":\"timetxt\",\"sortable\":true},{\"title\":\"Text\",\"value\":\"text\"}]","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":4110,"y":1860,"wires":[["587283abed3f4f4a"]]},{"id":"587283abed3f4f4a","type":"ui-template","z":"151def52ea276427","group":"afff42359047ca4d","page":"","ui":"","name":"Messages","order":1,"width":"0","height":"0","head":"","format":"<template>\n <!-- Provide an input text box to search the content -->\n <v-text-field v-model=\"search\" label=\"Search\" prepend-inner-icon=\"mdi-magnify\" single-line variant=\"outlined\"\n hide-details></v-text-field>\n <v-data-table v-model:search=\"search\" :items=\"msg?.payload\" :headers=\"msg?.headers\">\n\n </v-data-table>\n</template>\n\n<script>\n export default {\n data () {\n return {\n search: ''\n }\n },\n methods: {\n // add a function to determine the color of the progress bar given the row's item\n\n\n\n }\n }\n</script>","storeOutMessages":true,"passthru":true,"resendOnRefresh":true,"templateScope":"local","className":"","x":4290,"y":1860,"wires":[[]]},{"id":"5ca1e95d478b64d5","type":"change","z":"151def52ea276427","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.messages","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":3920,"y":1860,"wires":[["5ada9975d1929170"]]},{"id":"015da189f3713585","type":"ui-template","z":"151def52ea276427","group":"a777a300cd615fec","page":"","ui":"","name":"Status","order":1,"width":"0","height":"0","head":"","format":"<template>\n <v-card class=\"mx-auto\" color=\"white\" width=\"100%\">\n <v-card-item title=\"Parameters\">\n <template v-slot:subtitle>\n Rain count: {{ payload.raincount }}, temp count: {{ payload.tempcount }}\n </template>\n </v-card-item>\n\n <v-card-text class=\"py-0\">\n <v-row align=\"center\" no-gutters>\n <v-col cols=\"6\" >\n <v-icon icon=\"mdi-thermometer\" color=\"orange\" size=\"88\"></v-icon>\n </v-col>\n <v-col class=\"text-h2 text-right\" cols=\"6\">\n {{ payload.currenttemp }}°C\n </v-col>\n </v-row>\n\n <v-row align=\"center\" no-gutters>\n <v-col cols=\"6\">\n </v-col>\n <v-col class=\"text-h5 text-right\" cols=\"6\">\n max: {{ payload.maxtemp }}°C\n </v-col>\n </v-row>\n </v-card-text>\n <div class=\"d-flex py-2 justify-space-between\"></div>\n <v-divider></v-divider>\n\n <v-card-text class=\"py-0\">\n <v-row align=\"center\" no-gutters>\n <v-col cols=\"4\">\n <v-icon icon=\"mdi-weather-pouring\" color=\"blue\" size=\"88\"></v-icon>\n </v-col>\n <v-col class=\"text-h2 text-right\" cols=\"8\">\n {{ payload.rainfall }}mm\n </v-col>\n </v-row>\n \n <v-row align=\"center\" no-gutters>\n <v-col cols=\"4\">\n </v-col>\n <v-col class=\"text-h5 text-right\" cols=\"8\">\n chance of rain: {{ payload.chanceofrain }}%\n </v-col>\n </v-row>\n </v-card-text>\n <div class=\"d-flex py-2 justify-space-between\"></div>\n <v-divider></v-divider>\n\n <v-card-text class=\"py-0\">\n <v-row align=\"center\" no-gutters>\n <v-col cols=\"4\">\n <v-icon icon=\"mdi-sprinkler\" color=\"indigo\" size=\"88\"></v-icon>\n </v-col>\n <v-col class=\"text-h4 text-right\" cols=\"8\">\n balance: {{ payload.waterbalance }}mm\n </v-col>\n </v-row>\n \n <v-row align=\"center\" no-gutters>\n <v-col cols=\"4\">\n </v-col>\n <v-col class=\"text-h4 text-right\" cols=\"8\">\n needed: {{ payload.waterneeded }}mm\n </v-col>\n </v-row>\n </v-card-text>\n <div class=\"d-flex py-2 justify-space-between\"></div>\n\n </v-card>\n</template>\n\n<script>\n export default {\n data() {\n return { \n expand: false, \n payload: {} \n }\n },\n watch: {\n msg: function(){ \n if(this.msg.payload != undefined){ \n this.payload = this.msg.payload;\n }\n }\n }\n }\n</script>","storeOutMessages":true,"passthru":true,"resendOnRefresh":true,"templateScope":"local","className":"","x":4110,"y":1340,"wires":[[]]},{"id":"9d134c87a08ee853","type":"link in","z":"151def52ea276427","name":"Irrigation chart data in","links":["8799760ea2dc58e2"],"x":4305,"y":1800,"wires":[["cef8e9a35a4ad8b9"]]},{"id":"108487ee7fc4e244","type":"function","z":"151def52ea276427","name":"9am status","func":"let data = flow.get(\"waterdata\");\n\nif (data === undefined) {\n return;\n}\n\nmsg.payload = {\n service: \"15\", type: \"message\", content: \"💦 Water status | Cistern: \" + data.cisternwaterlevel + \"mm (+\" + data.cisternup + \"/\" + data.cisterndown + \") | well pump: \" + data.wellruntimetoday + \"min | cistern pump: \" + data.cisternruntimetoday + \"min\"};\nreturn msg;\n\n","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":4130,"y":1980,"wires":[["5ab7041869c42180"]]},{"id":"c09eaf8974ca7a30","type":"inject","z":"151def52ea276427","name":"9am","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"00 09 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":3950,"y":1980,"wires":[["108487ee7fc4e244"]]},{"id":"9984ebe169f327fb","type":"inject","z":"151def52ea276427","name":"Reset","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[]","payloadType":"json","x":4290,"y":1920,"wires":[["cef8e9a35a4ad8b9"]]},{"id":"0d1909075552c0ba","type":"junction","z":"151def52ea276427","x":3760,"y":1500,"wires":[["7bc3fd2d7939255b","0cdb2b848e4c4dd3","236d8ca3e8e62e50","b02834afcfcd99e5","9f97d73917d23144","ee6a723ce6f6a35b","8af5f8334d8a1721","bf7c7a7bc2548134","372f1bc17d6a8d97","f4244fb203229d2e","0c4b0f8a44df6ce5","f52af2b7b5728bd0","5ca1e95d478b64d5","015da189f3713585"]]},{"id":"18d2a9f617530801","type":"junction","z":"151def52ea276427","x":3740,"y":1520,"wires":[["77aebd2258cdcad0","1fd5a1ab91b1fd67"]]},{"id":"edfd8a8d76e8164a","type":"junction","z":"151def52ea276427","x":3300,"y":2020,"wires":[["aa45a40d1752a3dc"]]},{"id":"1fd5a1ab91b1fd67","type":"junction","z":"151def52ea276427","x":3820,"y":2020,"wires":[["be02801c849c4930","36d55bddb7528d4b"]]},{"id":"06a590ff3d230c0b","type":"junction","z":"151def52ea276427","x":4260,"y":2060,"wires":[["1312883c2ea4fb1c","e5bfe46e5d22c3b3","4242d296d81c04c8","a2973a8279a6ddfc"]]},{"id":"ca8b0b77252e1f4a","type":"ui_group","name":"Calculation Data","tab":"b487991f2b7fc541","order":1,"disp":true,"width":"6","collapse":false,"className":""},{"id":"35b2a1df3529e93c","type":"ui_group","name":"Chart","tab":"b487991f2b7fc541","order":2,"disp":true,"width":"18","collapse":false,"className":""},{"id":"32e68baede1af094","type":"ui_group","name":"Messages","tab":"b487991f2b7fc541","order":3,"disp":true,"width":"24","collapse":false,"className":""},{"id":"4f4b1e694ab12e37","type":"ui-group","name":"Irrigation Chart","page":"0dcf55bb68a340ea","width":"8","height":"1","order":2,"showTitle":true,"className":"","visible":"true","disabled":"false"},{"id":"afff42359047ca4d","type":"ui-group","name":"System Messages","page":"0dcf55bb68a340ea","width":"12","height":"1","order":3,"showTitle":true,"className":"","visible":"true","disabled":"false"},{"id":"a777a300cd615fec","type":"ui-group","name":"Status","page":"0dcf55bb68a340ea","width":"4","height":"1","order":1,"showTitle":false,"className":"","visible":"true","disabled":"false"},{"id":"b487991f2b7fc541","type":"ui_tab","name":"Irrigation","icon":"wi-wu-chancerain","disabled":false,"hidden":false},{"id":"0dcf55bb68a340ea","type":"ui-page","name":"Irrigation Computer","ui":"cb79bc4520925e32","path":"/irrigation","icon":"sprinkler","layout":"grid","theme":"0d92c765bfad87e6","order":3,"className":"","visible":"true","disabled":"false"},{"id":"cb79bc4520925e32","type":"ui-base","name":"My UI","path":"/dashboard","includeClientData":true,"acceptsClientConfig":["ui-notification","ui-control","ui-text"],"showPathInSidebar":false},{"id":"0d92c765bfad87e6","type":"ui-theme","name":"Basic Blue Theme","colors":{"surface":"#4d58ff","primary":"#0094ce","bgPage":"#eeeeee","groupBg":"#ffffff","groupOutline":"#cccccc"},"sizes":{"pagePadding":"12px","groupGap":"12px","groupBorderRadius":"4px","widgetGap":"12px"}}]