[{"id":"2406e624f7a7075f","type":"tab","label":"rubbish copy","disabled":false,"info":"","env":[]},{"id":"6b489d73dcb73ff3","type":"group","z":"2406e624f7a7075f","style":{"stroke":"#999999","stroke-opacity":"1","fill":"none","fill-opacity":"1","label":true,"label-position":"nw","color":"#a4a4a4"},"nodes":["5c5bfbad60e9cc90","794960034618c47d","4846691c109ba498","e5705dcb08480921","2fa4299cd3b8a204","965b96058bd05ff4","295129478e3c6dcd","972eb1c8f32847b0","c85d48d884a7d47d","62a2e36a1fbc1b81","64628e72fe4e48ab","9b2be4f5752e127c","aec313f27585cda3","bf16a05253854eff","df279bb1d23eaf1b","21e1eee80f5101ae","db212cde1dc76066","12a2b5c260796531","d73db820f3be5e02","a1a1deb55ed829fd","a117117f86ec59b7","982eab30b1b0de29","4780152889466519","9a66e23fbd7cf742","5e47f64e65511354","105f4b7feee092af","afa28583d47b2637","5ad808cc7c67c278","128983cf1f73d5c9","071d10b804b741d1","52a8ecf14d627d34","86d07e1f78507b6c","f8f166636c18b3d5","a5b2e036a88eec3c"],"x":64,"y":739,"w":1362,"h":1062},{"id":"41fe783dfe406d95","type":"group","z":"2406e624f7a7075f","style":{"stroke":"#999999","stroke-opacity":"1","fill":"none","fill-opacity":"1","label":true,"label-position":"nw","color":"#a4a4a4"},"nodes":["6dac4da2e494637e","0b54bf2619006822","10e7f0f1465917f2","8b5c898767849746","935a66d4693c5c9b","d8206cd44a4e54e1","c423969fe564a096","41d7c40177126e8e","5de3d271cd521361","768252475c4684ca","5956cb6ebad09ad9","430e3779edf23fd4","b705a8585f7bdd60","a2af313db22ade22","ce857179aadd9dad","97ab3de76bdb20f4","72ec2e1c169e362f","fe8b0a8ef48cabb0","d2eaa80f07b81a0d","bfea699b5c0afd7b","431139b7b5624430","28f57f9cf058ea7e","0d331a8f083c1b90","0e3e3f7e0a39fddb","c18db319a3d49ee5"],"x":64,"y":1839,"w":942,"h":582},{"id":"c43706ec27606843","type":"group","z":"2406e624f7a7075f","style":{"stroke":"#999999","stroke-opacity":"1","fill":"none","fill-opacity":"1","label":true,"label-position":"nw","color":"#a4a4a4"},"nodes":["f61809741b51edcb","9754e62f2779b0a7","a450135a0c8a95f0","df0553f14c746313","0ef58bcd44221016","261731b2bc83050b","c004a5e0f3ebbc78","ebe3cde28eb3bd62","28752df7bc1341e1","a89ccebe6789bddf","69ee71db38ed53d6","f2076c70445f42df","defbd489926d44eb","e46616b7d8bda6a9","036a389d68d21743","baa2e82a04cb3121","2bf635d1a4c939d4","281257265c580851","1194fa099b1838bd","b23b0666c5335add","f7992dad9953f82c","9b6d42246d045c6f","aacb0da840c0701e","95f275a3eeb93d80","df57220be53c14b0","816ecb5127073ed8","ec8a6a7a0c41facd","5e96a1af4529fadc","05afd44d9aa052b9","493cd66a32013939","4c2ba4728e123ca0","0156734da8e53b84","8975044fa2684989","096b640572fa41fa","da6d1342b694cc08"],"x":64,"y":139,"w":1442,"h":562},{"id":"685a5de0f8b9e848","type":"function","z":"2406e624f7a7075f","name":"Settings","func":"//see Setup tab\n","outputs":1,"noerr":0,"initialize":"// -----------------------------------------\n// FLOW VARIABLES\n// -----------------------------------------\n\n// Flow Variables on startup\nflow.set(\"distanceOut\", 3);\n\nflow.set(\"redBin\", \"nothingrequired\");\nflow.set(\"greenBin\", \"nothingrequired\");\nflow.set(\"foodBin\", \"nothingrequired\");","finalize":"","libs":[],"x":320,"y":80,"wires":[[]]},{"id":"f4f553b372796b4f","type":"comment","z":"2406e624f7a7075f","name":"Startup Settings","info":"","x":160,"y":80,"wires":[]},{"id":"5c5bfbad60e9cc90","type":"inject","z":"2406e624f7a7075f","g":"6b489d73dcb73ff3","name":"","props":[{"p":"payload"}],"repeat":"3600","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"A reminder. It is rubbish day tomorrow, and the red bin is not yet out.","payloadType":"str","x":170,"y":1240,"wires":[["794960034618c47d","c85d48d884a7d47d","105f4b7feee092af"]]},{"id":"794960034618c47d","type":"api-current-state","z":"2406e624f7a7075f","g":"6b489d73dcb73ff3","name":"","server":"8e2273cf.db33f","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.my_council_waste","state_type":"num","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":520,"y":920,"wires":[["e5705dcb08480921"]]},{"id":"4846691c109ba498","type":"api-current-state","z":"2406e624f7a7075f","g":"6b489d73dcb73ff3","name":"","server":"8e2273cf.db33f","version":3,"outputs":2,"halt_if":"false","halt_if_type":"bool","halt_if_compare":"is","entity_id":"sensor.red_waste_bin_out","state_type":"habool","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"msg.payload","valueType":"jsonata"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":700,"y":1040,"wires":[["295129478e3c6dcd"],["a1a1deb55ed829fd"]]},{"id":"e5705dcb08480921","type":"switch","z":"2406e624f7a7075f","g":"6b489d73dcb73ff3","name":"","property":"payload.attributes.daysTo","propertyType":"msg","rules":[{"t":"gte","v":"1","vt":"str"},{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":810,"y":920,"wires":[["972eb1c8f32847b0"],["2fa4299cd3b8a204"],["965b96058bd05ff4"]]},{"id":"2fa4299cd3b8a204","type":"change","z":"2406e624f7a7075f","g":"6b489d73dcb73ff3","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"tomorrow","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":980,"y":900,"wires":[["4846691c109ba498"]]},{"id":"965b96058bd05ff4","type":"change","z":"2406e624f7a7075f","g":"6b489d73dcb73ff3","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"today","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":980,"y":940,"wires":[["4846691c109ba498"]]},{"id":"295129478e3c6dcd","type":"change","z":"2406e624f7a7075f","g":"6b489d73dcb73ff3","name":"","rules":[{"t":"set","p":"redBin","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":980,"y":1020,"wires":[["12a2b5c260796531"]]},{"id":"972eb1c8f32847b0","type":"change","z":"2406e624f7a7075f","g":"6b489d73dcb73ff3","name":"","rules":[{"t":"set","p":"redBin","pt":"flow","to":"nothingrequired","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"nothingrequired","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":980,"y":860,"wires":[["12a2b5c260796531"]]},{"id":"c85d48d884a7d47d","type":"api-current-state","z":"2406e624f7a7075f","g":"6b489d73dcb73ff3","name":"","server":"8e2273cf.db33f","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.my_council_recycling","state_type":"num","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":530,"y":1240,"wires":[["64628e72fe4e48ab"]]},{"id":"62a2e36a1fbc1b81","type":"api-current-state","z":"2406e624f7a7075f","g":"6b489d73dcb73ff3","name":"","server":"8e2273cf.db33f","version":3,"outputs":2,"halt_if":"false","halt_if_type":"bool","halt_if_compare":"is","entity_id":"sensor.green_recycling_bin_out","state_type":"habool","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"msg.payload","valueType":"jsonata"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":680,"y":1400,"wires":[["bf16a05253854eff"],["d73db820f3be5e02"]]},{"id":"64628e72fe4e48ab","type":"switch","z":"2406e624f7a7075f","g":"6b489d73dcb73ff3","name":"","property":"payload.attributes.daysTo","propertyType":"msg","rules":[{"t":"gte","v":"1","vt":"str"},{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":810,"y":1240,"wires":[["df279bb1d23eaf1b"],["9b2be4f5752e127c"],["aec313f27585cda3"]]},{"id":"9b2be4f5752e127c","type":"change","z":"2406e624f7a7075f","g":"6b489d73dcb73ff3","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"tomorrow","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":980,"y":1220,"wires":[["62a2e36a1fbc1b81"]]},{"id":"aec313f27585cda3","type":"change","z":"2406e624f7a7075f","g":"6b489d73dcb73ff3","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"today","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":980,"y":1260,"wires":[["62a2e36a1fbc1b81"]]},{"id":"bf16a05253854eff","type":"change","z":"2406e624f7a7075f","g":"6b489d73dcb73ff3","name":"","rules":[{"t":"set","p":"greenBin","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":990,"y":1380,"wires":[["db212cde1dc76066"]]},{"id":"df279bb1d23eaf1b","type":"change","z":"2406e624f7a7075f","g":"6b489d73dcb73ff3","name":"","rules":[{"t":"set","p":"greenBin","pt":"flow","to":"nothingrequired","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"nothingrequired","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":980,"y":1180,"wires":[["db212cde1dc76066"]]},{"id":"21e1eee80f5101ae","type":"change","z":"2406e624f7a7075f","g":"6b489d73dcb73ff3","name":"","rules":[{"t":"set","p":"foodBin","pt":"flow","to":"nothingrequired","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"nothingrequired","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":980,"y":1540,"wires":[["86d07e1f78507b6c"]]},{"id":"db212cde1dc76066","type":"debug","z":"2406e624f7a7075f","g":"6b489d73dcb73ff3","name":"flow: greenBin","active":true,"tosidebar":true,"console":true,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload.distance","statusType":"auto","x":1290,"y":1280,"wires":[]},{"id":"12a2b5c260796531","type":"debug","z":"2406e624f7a7075f","g":"6b489d73dcb73ff3","name":"flow: redBin","active":true,"tosidebar":true,"console":true,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload.distance","statusType":"auto","x":1280,"y":960,"wires":[]},{"id":"d73db820f3be5e02","type":"change","z":"2406e624f7a7075f","g":"6b489d73dcb73ff3","name":"","rules":[{"t":"set","p":"greenBin","pt":"flow","to":"correctlyout","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"correctlyout","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":980,"y":1420,"wires":[["db212cde1dc76066"]]},{"id":"a1a1deb55ed829fd","type":"change","z":"2406e624f7a7075f","g":"6b489d73dcb73ff3","name":"","rules":[{"t":"set","p":"redBin","pt":"flow","to":"correctlyout","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"correctlyout","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":980,"y":1060,"wires":[["12a2b5c260796531"]]},{"id":"a117117f86ec59b7","type":"comment","z":"2406e624f7a7075f","g":"6b489d73dcb73ff3","name":"Red Waste Rubbish Bin","info":"","x":460,"y":880,"wires":[]},{"id":"982eab30b1b0de29","type":"comment","z":"2406e624f7a7075f","g":"6b489d73dcb73ff3","name":"Green Recycling Rubbish Bin","info":"","x":480,"y":1200,"wires":[]},{"id":"4780152889466519","type":"comment","z":"2406e624f7a7075f","g":"6b489d73dcb73ff3","name":"Food Rubbish Bin","info":"","x":450,"y":1560,"wires":[]},{"id":"9a66e23fbd7cf742","type":"comment","z":"2406e624f7a7075f","g":"6b489d73dcb73ff3","name":"Update Hourly","info":"","x":170,"y":1200,"wires":[]},{"id":"5e47f64e65511354","type":"comment","z":"2406e624f7a7075f","g":"6b489d73dcb73ff3","name":"Council Checks. Is it a rubbish day today or tomorrow? If so, are the correct bins out?","info":"","x":390,"y":780,"wires":[]},{"id":"105f4b7feee092af","type":"api-current-state","z":"2406e624f7a7075f","g":"6b489d73dcb73ff3","name":"","server":"8e2273cf.db33f","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.my_council_food_waste","state_type":"num","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":530,"y":1600,"wires":[["5ad808cc7c67c278"]]},{"id":"afa28583d47b2637","type":"api-current-state","z":"2406e624f7a7075f","g":"6b489d73dcb73ff3","name":"","server":"8e2273cf.db33f","version":3,"outputs":2,"halt_if":"false","halt_if_type":"bool","halt_if_compare":"is","entity_id":"sensor.food_waste_bin_out","state_type":"habool","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"msg.payload","valueType":"jsonata"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":680,"y":1740,"wires":[["52a8ecf14d627d34"],["f8f166636c18b3d5"]]},{"id":"5ad808cc7c67c278","type":"switch","z":"2406e624f7a7075f","g":"6b489d73dcb73ff3","name":"","property":"payload.attributes.daysTo","propertyType":"msg","rules":[{"t":"gte","v":"1","vt":"str"},{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":810,"y":1600,"wires":[["21e1eee80f5101ae"],["128983cf1f73d5c9"],["071d10b804b741d1"]]},{"id":"128983cf1f73d5c9","type":"change","z":"2406e624f7a7075f","g":"6b489d73dcb73ff3","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"tomorrow","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":980,"y":1580,"wires":[["afa28583d47b2637"]]},{"id":"071d10b804b741d1","type":"change","z":"2406e624f7a7075f","g":"6b489d73dcb73ff3","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"today","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":980,"y":1620,"wires":[["afa28583d47b2637"]]},{"id":"52a8ecf14d627d34","type":"change","z":"2406e624f7a7075f","g":"6b489d73dcb73ff3","name":"","rules":[{"t":"set","p":"foodBin","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":980,"y":1720,"wires":[["86d07e1f78507b6c"]]},{"id":"86d07e1f78507b6c","type":"debug","z":"2406e624f7a7075f","g":"6b489d73dcb73ff3","name":"flow: foodBin","active":true,"tosidebar":true,"console":true,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload.distance","statusType":"auto","x":1280,"y":1660,"wires":[]},{"id":"f8f166636c18b3d5","type":"change","z":"2406e624f7a7075f","g":"6b489d73dcb73ff3","name":"","rules":[{"t":"set","p":"foodBin","pt":"flow","to":"correctlyout","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"correctlyout","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":980,"y":1760,"wires":[["86d07e1f78507b6c"]]},{"id":"a5b2e036a88eec3c","type":"link in","z":"2406e624f7a7075f","g":"6b489d73dcb73ff3","name":"link in 19","links":["28f57f9cf058ea7e","0d331a8f083c1b90","61355b128cbd11ca"],"x":205,"y":1280,"wires":[["105f4b7feee092af","c85d48d884a7d47d","794960034618c47d"]]},{"id":"6dac4da2e494637e","type":"function","z":"2406e624f7a7075f","g":"41fe783dfe406d95","name":"Check if rubbish day is TOMORROW and announce","func":"\nvar redBin = flow.get(\"redBin\") || \"nothingrequired\" ;\nvar greenBin = flow.get(\"greenBin\") || \"nothingrequired\";\nvar foodBin = flow.get(\"foodBin\") || \"nothingrequired\";\nvar announcement = \"\" ;\n\nif ( redBin === \"tomorrow\" \n && foodBin === \"tomorrow\" \n && greenBin === \"tomorrow\" ) \n {\n announcement = \"It is rubbish day tomorrow, all bins need to be put out.\"\n }\n\nif (redBin === \"tomorrow\" \n && foodBin === \"tomorrow\" \n && greenBin === \"nothingrequired\") \n {\n announcement = \"It is rubbish day tomorrow, but not a recycling day. Please put the red bin and food bin out.\"\n }\n\nif (redBin === \"correctlyout\"\n && foodBin === \"tomorrow\"\n && greenBin === \"nothingrequired\") {\n announcement = \"It is rubbish day tomorrow. The red bin is out but the food bin still needs to be put out.\"\n}\n\nif (redBin === \"correctlyout\"\n && foodBin === \"tomorrow\"\n && greenBin === \"tomorrow\") {\n announcement = \"It is rubbish day tomorrow. The red bin is out but the recycling and food bins still needs to be put out.\"\n}\n\nif (redBin === \"correctlyout\"\n && foodBin === \"tomorrow\"\n && greenBin === \"correctlyout\") {\n announcement = \"It is rubbish day tomorrow. The red and green bins are out but the food bin still needs to be put out.\"\n}\n\nif (redBin === \"correctlyout\"\n && foodBin === \"tomorrow\"\n && greenBin === \"nothingrequired\") {\n announcement = \"It is rubbish day tomorrow, but not a recycling day. The red bin is out but not the food bin yet.\"\n}\n\nif (redBin === \"tomorrow\"\n && foodBin === \"correctlyout\"\n && greenBin === \"nothingrequired\") {\n announcement = \"It is rubbish day tomorrow, but not a recycling day. The food bin is out but not the red bin yet.\"\n}\n\nif (redBin === \"tomorrow\"\n && foodBin === \"correctlyout\"\n && greenBin === \"correctlyout\") {\n announcement = \"It is rubbish and recycling day tomorrow. The food bin and red bin are out but not the green bin yet.\"\n}\n\n\nmsg.payload = announcement;\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":510,"y":2060,"wires":[["0b54bf2619006822","430e3779edf23fd4"]]},{"id":"0b54bf2619006822","type":"debug","z":"2406e624f7a7075f","g":"41fe783dfe406d95","name":"Announcement","active":true,"tosidebar":true,"console":true,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload.distance","statusType":"auto","x":830,"y":2060,"wires":[]},{"id":"10e7f0f1465917f2","type":"function","z":"2406e624f7a7075f","g":"41fe783dfe406d95","name":"Check if rubbish day is TODAY and if so announce","func":"\n\nvar redBin = flow.get(\"redBin\") || \"nothingrequired\" ;\nvar greenBin = flow.get(\"greenBin\") || \"nothingrequired\";\nvar foodBin = flow.get(\"foodBin\") || \"nothingrequired\";\nvar announcement = \"\" ;\n\nif ( redBin === \"today\" \n && foodBin === \"today\" \n && greenBin === \"today\" ) \n {\n announcement = \"It is rubbish day today, all bins still need to be put out\"\n }\n\nif (redBin === \"today\" \n && foodBin === \"today\" \n && greenBin === \"nothingrequired\") \n {\n announcement = \"It is rubbish day today, but not a recycling day. The red bin and food bin still need to go out.\"\n }\n\nif (redBin === \"correctlyout\"\n && foodBin === \"today\"\n && greenBin === \"nothingrequired\") {\n announcement = \"It is rubbish day today, but not a recycling day. The red bin is out but the food bin still needs to be put out.\"\n}\n\nif (redBin === \"correctlyout\"\n && foodBin === \"today\"\n && greenBin === \"correctlyout\") {\n announcement = \"It is rubbish day today. The red and green bins are out but the food bin still needs to be put out.\"\n}\n\nif (redBin === \"correctlyout\"\n && foodBin === \"today\"\n && greenBin === \"nothingrequired\") {\n announcement = \"It is rubbish day today but not a recycling day. The red bin is out but not the food bin yet.\"\n}\n\nif (redBin === \"today\"\n && foodBin === \"correctlyout\"\n && greenBin === \"nothingrequired\") {\n announcement = \"It is rubbish day today, but not a recycling day. The food bin is out but not the red bin yet.\"\n}\n\nif (redBin === \"today\"\n && foodBin === \"correctlyout\"\n && greenBin === \"correctlyout\") {\n announcement = \"It is rubbish and recycling day today. The food bin and red bin are out but not the green bin yet.\"\n}\n\n\nmsg.payload = announcement;\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":530,"y":2280,"wires":[["935a66d4693c5c9b","b705a8585f7bdd60"]]},{"id":"8b5c898767849746","type":"inject","z":"2406e624f7a7075f","g":"41fe783dfe406d95","name":"16:00","props":[{"p":"payload"}],"repeat":"","crontab":"00 16 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":170,"y":1980,"wires":[[]]},{"id":"935a66d4693c5c9b","type":"debug","z":"2406e624f7a7075f","g":"41fe783dfe406d95","name":"Announcement","active":true,"tosidebar":true,"console":true,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload.distance","statusType":"auto","x":830,"y":2280,"wires":[]},{"id":"d8206cd44a4e54e1","type":"inject","z":"2406e624f7a7075f","g":"41fe783dfe406d95","name":"17:00","props":[{"p":"payload"}],"repeat":"","crontab":"00 17 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":170,"y":2040,"wires":[[]]},{"id":"c423969fe564a096","type":"inject","z":"2406e624f7a7075f","g":"41fe783dfe406d95","name":"19:00","props":[{"p":"payload"}],"repeat":"","crontab":"00 19 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":170,"y":2120,"wires":[[]]},{"id":"41d7c40177126e8e","type":"inject","z":"2406e624f7a7075f","g":"41fe783dfe406d95","name":"20:30","props":[{"p":"payload"}],"repeat":"","crontab":"30 20 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":170,"y":2160,"wires":[["d2eaa80f07b81a0d"]]},{"id":"5de3d271cd521361","type":"inject","z":"2406e624f7a7075f","g":"41fe783dfe406d95","name":"21:30","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"30 21 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":170,"y":2240,"wires":[["d2eaa80f07b81a0d"]]},{"id":"768252475c4684ca","type":"inject","z":"2406e624f7a7075f","g":"41fe783dfe406d95","name":"07:00","props":[{"p":"payload"}],"repeat":"","crontab":"00 07 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":170,"y":2320,"wires":[["bfea699b5c0afd7b"]]},{"id":"5956cb6ebad09ad9","type":"inject","z":"2406e624f7a7075f","g":"41fe783dfe406d95","name":"08:00","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"00 08 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":170,"y":2360,"wires":[["bfea699b5c0afd7b"]]},{"id":"430e3779edf23fd4","type":"change","z":"2406e624f7a7075f","g":"41fe783dfe406d95","name":"","rules":[{"t":"set","p":"summary","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":690,"y":2140,"wires":[["0e3e3f7e0a39fddb"]]},{"id":"b705a8585f7bdd60","type":"change","z":"2406e624f7a7075f","g":"41fe783dfe406d95","name":"","rules":[{"t":"set","p":"summary","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":690,"y":2180,"wires":[["0e3e3f7e0a39fddb"]]},{"id":"a2af313db22ade22","type":"inject","z":"2406e624f7a7075f","g":"41fe783dfe406d95","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"test message","payloadType":"str","x":470,"y":2140,"wires":[["430e3779edf23fd4"]]},{"id":"ce857179aadd9dad","type":"delay","z":"2406e624f7a7075f","g":"41fe783dfe406d95","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":620,"y":1940,"wires":[["6dac4da2e494637e"]]},{"id":"97ab3de76bdb20f4","type":"inject","z":"2406e624f7a7075f","g":"41fe783dfe406d95","name":"21:00","props":[{"p":"payload"}],"repeat":"","crontab":"00 21 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":170,"y":2200,"wires":[["d2eaa80f07b81a0d"]]},{"id":"72ec2e1c169e362f","type":"inject","z":"2406e624f7a7075f","g":"41fe783dfe406d95","name":"18:00","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"00 18 * * *","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":170,"y":2080,"wires":[[]]},{"id":"fe8b0a8ef48cabb0","type":"inject","z":"2406e624f7a7075f","g":"41fe783dfe406d95","name":"Test","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":170,"y":1940,"wires":[["28f57f9cf058ea7e","ce857179aadd9dad"]]},{"id":"d2eaa80f07b81a0d","type":"delay","z":"2406e624f7a7075f","g":"41fe783dfe406d95","name":"+ random 15mins delay","pauseType":"random","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"15","randomUnits":"minutes","drop":false,"allowrate":false,"outputs":1,"x":390,"y":1960,"wires":[["ce857179aadd9dad","28f57f9cf058ea7e"]]},{"id":"bfea699b5c0afd7b","type":"delay","z":"2406e624f7a7075f","g":"41fe783dfe406d95","name":"+ random 5mins delay","pauseType":"random","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"minutes","drop":false,"allowrate":false,"outputs":1,"x":380,"y":2340,"wires":[["431139b7b5624430","0d331a8f083c1b90"]]},{"id":"431139b7b5624430","type":"delay","z":"2406e624f7a7075f","g":"41fe783dfe406d95","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":620,"y":2340,"wires":[["10e7f0f1465917f2"]]},{"id":"28f57f9cf058ea7e","type":"link out","z":"2406e624f7a7075f","g":"41fe783dfe406d95","name":"link out 8","mode":"link","links":["a5b2e036a88eec3c"],"x":565,"y":1880,"wires":[]},{"id":"0d331a8f083c1b90","type":"link out","z":"2406e624f7a7075f","g":"41fe783dfe406d95","name":"link out 9","mode":"link","links":["a5b2e036a88eec3c"],"x":575,"y":2380,"wires":[]},{"id":"0e3e3f7e0a39fddb","type":"function","z":"2406e624f7a7075f","g":"41fe783dfe406d95","name":"passthrough","func":"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":910,"y":2140,"wires":[["71d1e3ca6e9fe6ca"]]},{"id":"c18db319a3d49ee5","type":"comment","z":"2406e624f7a7075f","g":"41fe783dfe406d95","name":"Check days and announce actions","info":"","x":240,"y":1880,"wires":[]},{"id":"f61809741b51edcb","type":"mqtt in","z":"2406e624f7a7075f","g":"c43706ec27606843","name":"espresense/devices/known:1xxxxxxxxxxx/garage","topic":"espresense/devices/known:1xxxxxxxxxxx/garage","qos":"2","datatype":"auto-detect","broker":"e28b763a.77bd98","nl":false,"rap":true,"rh":0,"inputs":0,"x":270,"y":280,"wires":[["9754e62f2779b0a7","a89ccebe6789bddf"]]},{"id":"9754e62f2779b0a7","type":"debug","z":"2406e624f7a7075f","g":"c43706ec27606843","name":"debug 97","active":true,"tosidebar":true,"console":true,"tostatus":true,"complete":"payload.distance","targetType":"msg","statusVal":"payload.distance","statusType":"auto","x":390,"y":320,"wires":[]},{"id":"a450135a0c8a95f0","type":"comment","z":"2406e624f7a7075f","g":"c43706ec27606843","name":"Red Waste Rubbish Bin","info":"","x":200,"y":240,"wires":[]},{"id":"df0553f14c746313","type":"debug","z":"2406e624f7a7075f","g":"c43706ec27606843","name":"debug 98","active":true,"tosidebar":true,"console":true,"tostatus":true,"complete":"payload.distance","targetType":"msg","statusVal":"payload.distance","statusType":"auto","x":410,"y":480,"wires":[]},{"id":"0ef58bcd44221016","type":"mqtt in","z":"2406e624f7a7075f","g":"c43706ec27606843","name":"espresense/devices/known:2xxxxxxxxxxx/garage","topic":"espresense/devices/known:2xxxxxxxxxxx/garage","qos":"2","datatype":"auto-detect","broker":"e28b763a.77bd98","nl":false,"rap":true,"rh":0,"inputs":0,"x":280,"y":440,"wires":[["df0553f14c746313","e46616b7d8bda6a9"]]},{"id":"261731b2bc83050b","type":"comment","z":"2406e624f7a7075f","g":"c43706ec27606843","name":"Green Recycling Rubbish Bin","info":"","x":220,"y":400,"wires":[]},{"id":"c004a5e0f3ebbc78","type":"debug","z":"2406e624f7a7075f","g":"c43706ec27606843","name":"debug 99","active":true,"tosidebar":true,"console":true,"tostatus":true,"complete":"payload.distance","targetType":"msg","statusVal":"payload.distance","statusType":"auto","x":410,"y":640,"wires":[]},{"id":"ebe3cde28eb3bd62","type":"mqtt in","z":"2406e624f7a7075f","g":"c43706ec27606843","name":"espresense/devices/known:3xxxxxxxxxxx/garage","topic":"espresense/devices/known:3xxxxxxxxxxx/garage","qos":"2","datatype":"auto-detect","broker":"e28b763a.77bd98","nl":false,"rap":true,"rh":0,"inputs":0,"x":280,"y":600,"wires":[["c004a5e0f3ebbc78","281257265c580851"]]},{"id":"28752df7bc1341e1","type":"comment","z":"2406e624f7a7075f","g":"c43706ec27606843","name":"Food Rubbish Bin","info":"","x":190,"y":560,"wires":[]},{"id":"a89ccebe6789bddf","type":"switch","z":"2406e624f7a7075f","g":"c43706ec27606843","name":"Compare distance to flow.distanceOut","property":"payload.distance","propertyType":"msg","rules":[{"t":"gt","v":"distanceOut","vt":"flow"},{"t":"lte","v":"distanceOut","vt":"flow"}],"checkall":"true","repair":false,"outputs":2,"x":710,"y":280,"wires":[["69ee71db38ed53d6"],["f2076c70445f42df"]]},{"id":"69ee71db38ed53d6","type":"change","z":"2406e624f7a7075f","g":"c43706ec27606843","name":"Set to TRUE","rules":[{"t":"set","p":"payload","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":790,"y":240,"wires":[["096b640572fa41fa"]]},{"id":"f2076c70445f42df","type":"change","z":"2406e624f7a7075f","g":"c43706ec27606843","name":"Set to FALSE","rules":[{"t":"set","p":"payload","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":780,"y":320,"wires":[["096b640572fa41fa"]]},{"id":"defbd489926d44eb","type":"debug","z":"2406e624f7a7075f","g":"c43706ec27606843","name":"debug 100","active":true,"tosidebar":true,"console":true,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1210,"y":300,"wires":[]},{"id":"e46616b7d8bda6a9","type":"switch","z":"2406e624f7a7075f","g":"c43706ec27606843","name":"Compare distance to flow.distanceOut","property":"payload.distance","propertyType":"msg","rules":[{"t":"gt","v":"distanceOut","vt":"flow"},{"t":"lte","v":"distanceOut","vt":"flow"}],"checkall":"true","repair":false,"outputs":2,"x":710,"y":440,"wires":[["036a389d68d21743"],["baa2e82a04cb3121"]]},{"id":"036a389d68d21743","type":"change","z":"2406e624f7a7075f","g":"c43706ec27606843","name":"Set to TRUE","rules":[{"t":"set","p":"payload","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":790,"y":400,"wires":[["0156734da8e53b84"]]},{"id":"baa2e82a04cb3121","type":"change","z":"2406e624f7a7075f","g":"c43706ec27606843","name":"Set to FALSE","rules":[{"t":"set","p":"payload","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":780,"y":480,"wires":[["0156734da8e53b84"]]},{"id":"2bf635d1a4c939d4","type":"debug","z":"2406e624f7a7075f","g":"c43706ec27606843","name":"debug 101","active":true,"tosidebar":true,"console":true,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1210,"y":480,"wires":[]},{"id":"281257265c580851","type":"switch","z":"2406e624f7a7075f","g":"c43706ec27606843","name":"Compare distance to flow.distanceOut","property":"payload.distance","propertyType":"msg","rules":[{"t":"gt","v":"distanceOut","vt":"flow"},{"t":"lte","v":"distanceOut","vt":"flow"}],"checkall":"true","repair":false,"outputs":2,"x":710,"y":600,"wires":[["1194fa099b1838bd"],["b23b0666c5335add"]]},{"id":"1194fa099b1838bd","type":"change","z":"2406e624f7a7075f","g":"c43706ec27606843","name":"Set to TRUE","rules":[{"t":"set","p":"payload","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":790,"y":560,"wires":[["05afd44d9aa052b9","4c2ba4728e123ca0"]]},{"id":"b23b0666c5335add","type":"change","z":"2406e624f7a7075f","g":"c43706ec27606843","name":"Set to FALSE","rules":[{"t":"set","p":"payload","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":780,"y":640,"wires":[["05afd44d9aa052b9","4c2ba4728e123ca0"]]},{"id":"f7992dad9953f82c","type":"debug","z":"2406e624f7a7075f","g":"c43706ec27606843","name":"debug 102","active":true,"tosidebar":true,"console":true,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1210,"y":660,"wires":[]},{"id":"9b6d42246d045c6f","type":"mqtt out","z":"2406e624f7a7075f","g":"c43706ec27606843","name":"","topic":"house-status/rubbishbinstatus/redbin-out","qos":"","retain":"true","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"e28b763a.77bd98","x":1300,"y":240,"wires":[]},{"id":"aacb0da840c0701e","type":"mqtt out","z":"2406e624f7a7075f","g":"c43706ec27606843","name":"","topic":"house-status/rubbishbinstatus/greenbin-out","qos":"","retain":"true","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"e28b763a.77bd98","x":1310,"y":420,"wires":[]},{"id":"95f275a3eeb93d80","type":"mqtt out","z":"2406e624f7a7075f","g":"c43706ec27606843","name":"","topic":"house-status/rubbishbinstatus/foodbin-out","qos":"","retain":"true","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"e28b763a.77bd98","x":1300,"y":600,"wires":[]},{"id":"df57220be53c14b0","type":"comment","z":"2406e624f7a7075f","g":"c43706ec27606843","name":"Update MQTT Server with bin distance. Out on roadside = TRUE, not out = FALSE","info":"","x":390,"y":180,"wires":[]},{"id":"816ecb5127073ed8","type":"inject","z":"2406e624f7a7075f","g":"c43706ec27606843","name":"","props":[{"p":"payload.distance","v":"100","vt":"num"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","x":420,"y":240,"wires":[["a89ccebe6789bddf"]]},{"id":"ec8a6a7a0c41facd","type":"inject","z":"2406e624f7a7075f","g":"c43706ec27606843","name":"","props":[{"p":"payload.distance","v":"100","vt":"num"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","x":420,"y":560,"wires":[["281257265c580851"]]},{"id":"5e96a1af4529fadc","type":"inject","z":"2406e624f7a7075f","g":"c43706ec27606843","name":"","props":[{"p":"payload.distance","v":"100","vt":"num"}],"repeat":"","crontab":"","once":true,"onceDelay":0.1,"topic":"","x":440,"y":400,"wires":[["e46616b7d8bda6a9"]]},{"id":"05afd44d9aa052b9","type":"debug","z":"2406e624f7a7075f","g":"c43706ec27606843","name":"debug 103","active":true,"tosidebar":true,"console":true,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload.distance","statusType":"auto","x":980,"y":660,"wires":[]},{"id":"493cd66a32013939","type":"trigger","z":"2406e624f7a7075f","g":"c43706ec27606843","name":"","op1":"","op2":"true","op1type":"nul","op2type":"bool","duration":"60","extend":true,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":1010,"y":540,"wires":[["95f275a3eeb93d80","f7992dad9953f82c"]]},{"id":"4c2ba4728e123ca0","type":"function","z":"2406e624f7a7075f","g":"c43706ec27606843","name":"passthrough","func":"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":990,"y":600,"wires":[["95f275a3eeb93d80","f7992dad9953f82c","493cd66a32013939"]]},{"id":"0156734da8e53b84","type":"function","z":"2406e624f7a7075f","g":"c43706ec27606843","name":"passthrough","func":"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":970,"y":440,"wires":[["8975044fa2684989","aacb0da840c0701e","2bf635d1a4c939d4"]]},{"id":"8975044fa2684989","type":"trigger","z":"2406e624f7a7075f","g":"c43706ec27606843","name":"","op1":"","op2":"true","op1type":"nul","op2type":"bool","duration":"60","extend":true,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":990,"y":380,"wires":[["aacb0da840c0701e","2bf635d1a4c939d4"]]},{"id":"096b640572fa41fa","type":"function","z":"2406e624f7a7075f","g":"c43706ec27606843","name":"passthrough","func":"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":970,"y":300,"wires":[["da6d1342b694cc08","defbd489926d44eb","9b6d42246d045c6f"]]},{"id":"da6d1342b694cc08","type":"trigger","z":"2406e624f7a7075f","g":"c43706ec27606843","name":"","op1":"","op2":"true","op1type":"nul","op2type":"bool","duration":"60","extend":true,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":990,"y":240,"wires":[["9b6d42246d045c6f","defbd489926d44eb"]]},{"id":"71d1e3ca6e9fe6ca","type":"function","z":"2406e624f7a7075f","name":"Notifications here (this is a dummy node)","func":"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1280,"y":2040,"wires":[[]]},{"id":"8e2273cf.db33f","type":"server","d":true,"name":"Home Assistant Sers","version":5,"addon":false,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true},{"id":"e28b763a.77bd98","type":"mqtt-broker","name":"mqtt","broker":"192.168.1.257","port":"1883","clientid":"","autoConnect":true,"usetls":false,"compatmode":false,"protocolVersion":"5","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"userProps":"","sessionExpiry":""}]