Desde a publicação deste tópico que alterei algumas coisas, pouca coisa, mas pode ser que faça diferença, podes testar e ver se funciona. Se funcionar depois altero o tópico
[{"id":"a614550a.bf8e58","type":"server-state-changed","z":"dec677d6.e60418","name":"irrigation enabled","server":"6c015bb.092d8a4","version":"1","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_boolean.irrigation_enable","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"x":740,"y":140,"wires":[["904fc43e.45e828"],[]]},{"id":"9d7f9aa2.dadae8","type":"server-state-changed","z":"dec677d6.e60418","name":"cycle input changed value","server":"6c015bb.092d8a4","version":"1","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_select\\.irrigation_cycle[1-3]_schedule_time","entityidfiltertype":"regex","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"x":710,"y":200,"wires":[["904fc43e.45e828"]]},{"id":"add8b388.ab4c3","type":"api-current-state","z":"dec677d6.e60418","name":"get cycle1 time state","server":"6c015bb.092d8a4","version":"1","outputs":2,"halt_if":"^([0-2][0-9]:[0-5][0-9]|Desativado)$","halt_if_type":"re","halt_if_compare":"is","override_topic":false,"entity_id":"input_select.irrigation_cycle1_schedule_time","state_type":"str","state_location":"irrigation.cycle[0]","override_payload":"msg","entity_location":"","override_data":"none","blockInputOverrides":false,"x":380,"y":200,"wires":[["9477625c.895c2"],[]]},{"id":"9477625c.895c2","type":"api-current-state","z":"dec677d6.e60418","name":"get cycle2 time state","server":"6c015bb.092d8a4","version":"1","outputs":2,"halt_if":"^([0-2][0-9]:[0-5][0-9]|Desativado)$","halt_if_type":"re","halt_if_compare":"is","override_topic":false,"entity_id":"input_select.irrigation_cycle2_schedule_time","state_type":"str","state_location":"irrigation.cycle[1]","override_payload":"msg","entity_location":"","override_data":"none","blockInputOverrides":false,"x":380,"y":260,"wires":[["1584b7ec.8c2e38"],[]]},{"id":"1584b7ec.8c2e38","type":"api-current-state","z":"dec677d6.e60418","name":"get cycle3 time state","server":"6c015bb.092d8a4","version":"1","outputs":2,"halt_if":"^([0-2][0-9]:[0-5][0-9]|Desativado)$","halt_if_type":"re","halt_if_compare":"is","override_topic":false,"entity_id":"input_select.irrigation_cycle3_schedule_time","state_type":"str","state_location":"irrigation.cycle[2]","override_payload":"msg","entity_location":"","override_data":"none","blockInputOverrides":false,"x":380,"y":320,"wires":[["ff758b0.353fb78"],[]]},{"id":"171bee93.d73281","type":"function","z":"dec677d6.e60418","name":"logic","func":"function addZero(i) {\n if (i < 10) {\n i = \"0\" + i;\n }\n return i;\n}\n\nvar current_date = new Date();\nvar current_time = addZero(current_date.getHours()) + \":\" + addZero(current_date.getMinutes());\n\nvar result = [];\nvar day;\nvar time_lowest = \"24:00\";\nvar tmp;\nvar i;\n\nif (msg.irrigation.cycle[0] != \"Desativado\" ||\nmsg.irrigation.cycle[1] != \"Desativado\" ||\nmsg.irrigation.cycle[2] != \"Desativado\"){\n msg.irrigation.cycle.forEach(function(element){\n \n if (element != \"Desativado\"){\n if (current_time <= element){\n result.push(element);\n day = \"today\";\n }\n }\n });\n if (day == 'today'){\n for (i=result.length-1; i>=0; i--) {\n tmp = result[i];\n if (tmp < time_lowest) time_lowest = tmp;\n }\n } else {\n current_date.setDate(current_date.getDate()+1);\n for (i=msg.irrigation.cycle.length-1; i>=0; i--) {\n tmp = msg.irrigation.cycle[i];\n if (tmp < time_lowest) time_lowest = tmp;\n }\n }\n msg.time = time_lowest+\":00\";\n msg.date = current_date.getFullYear()+\"-\"+(addZero(current_date.getMonth()+1))+\"-\"+addZero(current_date.getDate());\n reset = {};\n reset.reset = true;\n return [null, reset, msg];\n} else {\n return [msg, null, null];\n}","outputs":3,"noerr":0,"initialize":"","finalize":"","x":550,"y":400,"wires":[["201769dc.101716"],["201769dc.101716"],["8883f670.18c648"]]},{"id":"8883f670.18c648","type":"api-call-service","z":"dec677d6.e60418","name":"set next irrigation date time","server":"6c015bb.092d8a4","version":"1","debugenabled":false,"service_domain":"input_datetime","service":"set_datetime","entityId":"input_datetime.irrigation_next_run_time","data":"{\"date\":\"{{date}}\",\"time\":\"{{time}}\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":620,"y":460,"wires":[[]]},{"id":"7dd71b5.44838e4","type":"inject","z":"dec677d6.e60418","name":"every 5 minutes","repeat":"300","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":170,"y":140,"wires":[["add8b388.ab4c3","3cdb7142.90c7de"]]},{"id":"904fc43e.45e828","type":"link out","z":"dec677d6.e60418","name":"","links":["ba13e501.ddfeb8","e7241119.397ee"],"x":875,"y":160,"wires":[]},{"id":"ba13e501.ddfeb8","type":"link in","z":"dec677d6.e60418","name":"","links":["904fc43e.45e828","77b03464.3d94ec","64ab62da.699cfc"],"x":75,"y":100,"wires":[["7296ccb2.0b1c84"]]},{"id":"7296ccb2.0b1c84","type":"stoptimer","z":"dec677d6.e60418","duration":"50","units":"Millisecond","payloadtype":"num","payloadval":"0","name":"","x":220,"y":100,"wires":[["add8b388.ab4c3"],[]]},{"id":"8335e9cb.790e08","type":"comment","z":"dec677d6.e60418","name":"irrigate zone","info":"","x":130,"y":740,"wires":[]},{"id":"76600e1f.2d2c6","type":"link in","z":"dec677d6.e60418","name":"","links":["6e569955.0cc0e8"],"x":75,"y":1080,"wires":[["2e1030cf.0c9c2"]]},{"id":"cd4a5856.8cdfa8","type":"stoptimer","z":"dec677d6.e60418","duration":"10","units":"Second","payloadtype":"num","payloadval":"0","name":"wait 10 sec","x":750,"y":1080,"wires":[["940539d7.725d28"],[]]},{"id":"1d751c63.c92a14","type":"api-call-service","z":"dec677d6.e60418","name":"update status","server":"6c015bb.092d8a4","version":1,"debugenabled":false,"service_domain":"input_text","service":"set_value","entityId":"input_text.irrigation_status","data":"{\"value\":\"A regar: Sector {{irrigation.zone}}\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":140,"y":1160,"wires":[["c669f256.e0aae"]]},{"id":"a5a7bd92.e7c16","type":"api-call-service","z":"dec677d6.e60418","name":"turn valve on","server":"6c015bb.092d8a4","version":"1","debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.irrigation_zone{{irrigation.zone}}_valve","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1170,"y":1080,"wires":[["1d751c63.c92a14"]]},{"id":"4e59050d.cc585c","type":"link out","z":"dec677d6.e60418","name":"","links":["d8839773.fb7fc8"],"x":535,"y":1040,"wires":[]},{"id":"5824331e.eea41c","type":"comment","z":"dec677d6.e60418","name":"set next irrigation time","info":"","x":160,"y":40,"wires":[]},{"id":"60d42afc.7c0ba4","type":"api-call-service","z":"dec677d6.e60418","name":"turn valve off","server":"6c015bb.092d8a4","version":"1","debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.irrigation_zone{{irrigation.zone}}_valve","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":610,"y":1160,"wires":[["95b9c55.fa56e38"]]},{"id":"abcac6c1.8a45e8","type":"api-call-service","z":"dec677d6.e60418","name":"update status","server":"6c015bb.092d8a4","version":"1","debugenabled":false,"service_domain":"input_text","service":"set_value","entityId":"input_text.irrigation_status","data":"{\"value\":\"A alterar sector...\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1000,"y":1160,"wires":[["6cb5ac4a.0fe2a4"]]},{"id":"6cb5ac4a.0fe2a4","type":"link out","z":"dec677d6.e60418","name":"","links":["d8839773.fb7fc8"],"x":1115,"y":1160,"wires":[]},{"id":"f49a686e.73fcb8","type":"switch","z":"dec677d6.e60418","name":"zones left?","property":"irrigation.irrigate","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":390,"y":900,"wires":[["6e569955.0cc0e8"],["905d84a2.94a398"]]},{"id":"d8839773.fb7fc8","type":"link in","z":"dec677d6.e60418","name":"","links":["4e59050d.cc585c","6cb5ac4a.0fe2a4","c81fb210.a833","db965fec.bcf16","ea17ae82.d498a"],"x":115,"y":800,"wires":[["20ddfcbe.2ae214","b83a0d4e.0dfdb"]]},{"id":"6e569955.0cc0e8","type":"link out","z":"dec677d6.e60418","name":"","links":["76600e1f.2d2c6"],"x":535,"y":860,"wires":[]},{"id":"5a260750.45b338","type":"api-call-service","z":"dec677d6.e60418","name":"update status","server":"6c015bb.092d8a4","version":"1","debugenabled":false,"service_domain":"input_text","service":"set_value","entityId":"input_text.irrigation_status","data":"{\"value\":\"Parado\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":840,"y":900,"wires":[["f067557.b2587a8"]]},{"id":"77b03464.3d94ec","type":"link out","z":"dec677d6.e60418","name":"","links":["ba13e501.ddfeb8"],"x":655,"y":960,"wires":[]},{"id":"3a8897b5.45b258","type":"function","z":"dec677d6.e60418","name":"set/update vars","func":"if (typeof msg.irrigation == 'undefined'){\n msg.irrigation = {};\n msg.irrigation.zone = 1;\n msg.irrigation.total_zones = 4;\n msg.irrigation.total_time = 0;\n msg.irrigation.irrigate = true;\n} else {\n msg.irrigation.zone++;\n msg.irrigation.total_time += msg.irrigation.duration;\n if (msg.irrigation.zone > msg.irrigation.total_zones){\n msg.irrigation.irrigate = false;\n msg.irrigation.zone = null;\n }\n}\nmsg.payload={};\n(msg.irrigation.zone === null) ? delete msg.payload.entity_id : msg.payload.entity_id = 'input_number.irrigation_zone'+msg.irrigation.zone+'_duration' ;\n// msg.payload.entity_id = 'input_number.irrigation_zone'+msg.irrigation.zone+'_duration';\nnode.status({fill:'blue',shape:'dot',text:msg.irrigation.zone});\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":200,"y":900,"wires":[["f49a686e.73fcb8"]]},{"id":"5076c19c.1d414","type":"inject","z":"dec677d6.e60418","name":"every minute","repeat":"60","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":160,"y":600,"wires":[["47b5169e.8d28f8"]]},{"id":"e9539709.1967b8","type":"api-current-state","z":"dec677d6.e60418","name":"get next run time ","server":"6c015bb.092d8a4","version":"1","outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_datetime.irrigation_next_run_time","state_type":"str","state_location":"nextrt","override_payload":"msg","entity_location":"","override_data":"none","blockInputOverrides":false,"x":150,"y":660,"wires":[["2fff8878.bbad28"]]},{"id":"710fe6f3.2f0a18","type":"moment","z":"dec677d6.e60418","name":"format time","topic":"","input":"now","inputType":"msg","inTz":"ETC/GMT","adjAmount":0,"adjType":"days","adjDir":"add","format":"HH:mm","locale":"en_US","output":"now","outputType":"msg","outTz":"Europe/Lisbon","x":690,"y":600,"wires":[["e9539709.1967b8"]]},{"id":"41af1a31.79a744","type":"switch","z":"dec677d6.e60418","name":"time equals","property":"now","propertyType":"msg","rules":[{"t":"eq","v":"nextrt","vt":"msg"}],"checkall":"true","repair":false,"outputs":1,"x":490,"y":660,"wires":[["1250ea90.811c35"]]},{"id":"528b2296.6e50cc","type":"change","z":"dec677d6.e60418","name":"set to now","rules":[{"t":"set","p":"now","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":530,"y":600,"wires":[["710fe6f3.2f0a18"]]},{"id":"2fff8878.bbad28","type":"moment","z":"dec677d6.e60418","name":"format time","topic":"","input":"nextrt","inputType":"msg","inTz":"Europe/Lisbon","adjAmount":0,"adjType":"days","adjDir":"add","format":"HH:mm","locale":"en_US","output":"nextrt","outputType":"msg","outTz":"Europe/Lisbon","x":330,"y":660,"wires":[["41af1a31.79a744"]]},{"id":"92874975.fcc868","type":"comment","z":"dec677d6.e60418","name":"cheking if it's time to start irrigate","info":"","x":190,"y":540,"wires":[]},{"id":"47b5169e.8d28f8","type":"api-current-state","z":"dec677d6.e60418","name":"is enabled?","server":"6c015bb.092d8a4","version":"1","outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.irrigation_enable","state_type":"str","state_location":"","override_payload":"none","entity_location":"","override_data":"none","blockInputOverrides":false,"x":350,"y":600,"wires":[["528b2296.6e50cc"],[]]},{"id":"db965fec.bcf16","type":"link out","z":"dec677d6.e60418","name":"","links":["d8839773.fb7fc8"],"x":935,"y":720,"wires":[]},{"id":"65d1f2e3.61b06c","type":"moment","z":"dec677d6.e60418","name":"set time","topic":"","input":"","inputType":"date","inTz":"ETC/GMT","adjAmount":0,"adjType":"days","adjDir":"add","format":"HH:mm","locale":"en_US","output":"time","outputType":"msg","outTz":"Europe/Lisbon","x":300,"y":980,"wires":[["2d27f951.043076"]]},{"id":"b8570bfb.19b528","type":"moment","z":"dec677d6.e60418","name":"set date","topic":"","input":"","inputType":"date","inTz":"ETC/GMT","adjAmount":0,"adjType":"days","adjDir":"add","format":"YYYY-MM-DD","locale":"en_US","output":"date","outputType":"msg","outTz":"Europe/Lisbon","x":140,"y":980,"wires":[["65d1f2e3.61b06c"]]},{"id":"2d27f951.043076","type":"api-call-service","z":"dec677d6.e60418","name":"set last time irrigated","server":"6c015bb.092d8a4","version":"1","debugenabled":false,"service_domain":"input_datetime","service":"set_datetime","entityId":"input_datetime.irrigation_last_time_irrigated","data":"{\"date\":\"{{date}}\",\"time\":\"{{time}}\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":500,"y":980,"wires":[["77b03464.3d94ec","5c14f4f1.e50e8c","979ca791.527408"]]},{"id":"ec45de34.2edbe","type":"server-state-changed","z":"dec677d6.e60418","name":"turn on manual activation","server":"6c015bb.092d8a4","version":"1","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_boolean.irrigation_manual_run","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"x":170,"y":1300,"wires":[["1c8a8d60.e81173"],["b4ae520f.44537"]]},{"id":"ea17ae82.d498a","type":"link out","z":"dec677d6.e60418","name":"","links":["d8839773.fb7fc8"],"x":795,"y":1240,"wires":[]},{"id":"a8c44304.c026d","type":"comment","z":"dec677d6.e60418","name":"manual activation","info":"","x":140,"y":1240,"wires":[]},{"id":"905d84a2.94a398","type":"api-call-service","z":"dec677d6.e60418","name":"turn off manual run switch","server":"6c015bb.092d8a4","version":"1","debugenabled":false,"service_domain":"input_boolean","service":"turn_off","entityId":"input_boolean.irrigation_manual_run","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":610,"y":900,"wires":[["5a260750.45b338"]]},{"id":"b1aa3f30.83265","type":"api-call-service","z":"dec677d6.e60418","name":"notify","server":"6c015bb.092d8a4","version":"1","debugenabled":false,"service_domain":"notify","service":"pushbullet_ricardo","entityId":"","data":"{ \"title\":\"Rega\", \"message\":\"Acabou a rega. Tempo total de rega: {{irrigation.total_time}} min\" }","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":950,"y":1020,"wires":[[]]},{"id":"65734a9a.1da264","type":"api-call-service","z":"dec677d6.e60418","name":"turn valves off","server":"6c015bb.092d8a4","version":"1","debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"group.irrigation_valves","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":620,"y":1380,"wires":[["da4d7c3d.5eb54"]]},{"id":"52097031.a98aa","type":"api-current-state","z":"dec677d6.e60418","name":"fetch duration","server":"c127cb01.a49e28","version":1,"outputs":2,"halt_if":"^([^0]|[^0][0])$","halt_if_type":"re","halt_if_compare":"is","override_topic":false,"entity_id":"","state_type":"num","state_location":"irrigation.duration","override_payload":"msg","entity_location":"","override_data":"none","blockInputOverrides":false,"x":400,"y":1080,"wires":[["ed6830d1.4f29a"],["4e59050d.cc585c"]]},{"id":"ff758b0.353fb78","type":"function","z":"dec677d6.e60418","name":"check if ordered","func":"msg.irrigation.sorted_cycle = msg.irrigation.cycle.slice(0).sort();\n\nif (msg.irrigation.cycle.toString() == msg.irrigation.sorted_cycle.toString()){\n msg.payload = \"time input sorted\";\n node.status({fill:'green',shape:'ring',text:msg.payload});\n return [msg, null];\n} else {\n msg.payload = \"time input NOT sorted\";\n node.status({fill:'red',shape:'ring',text:msg.payload});\n return [null, msg];\n}","outputs":2,"noerr":0,"x":180,"y":400,"wires":[["11dc32a4.0b024d"],["473e2ded.25a7d4"]]},{"id":"11dc32a4.0b024d","type":"api-current-state","z":"dec677d6.e60418","name":"is enabled?","server":"6c015bb.092d8a4","version":"1","outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.irrigation_enable","state_type":"str","state_location":"","override_payload":"none","entity_location":"","override_data":"none","blockInputOverrides":false,"x":390,"y":400,"wires":[["171bee93.d73281"],[]]},{"id":"5fb837e1.2ff708","type":"api-call-service","z":"dec677d6.e60418","name":"set cycles option","server":"6c015bb.092d8a4","version":"1","debugenabled":false,"service_domain":"input_select","service":"select_option","entityId":"{{payload.entity_id}}","data":"{\"option\":\"{{payload.value}}\"}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":320,"y":480,"wires":[[]]},{"id":"473e2ded.25a7d4","type":"function","z":"dec677d6.e60418","name":"split ","func":"function value(n){\n n = parseInt(n-1);\n return msg.irrigation.sorted_cycle[n];\n}\nfunction entity(n){\n return \"input_select.irrigation_cycle\"+n+\"_schedule_time\";\n}\n\nr1 = {\n \"value\": value(1),\n \"entity_id\": entity(1)\n };\nr2 = {\n \"value\": value(2),\n \"entity_id\": entity(2)\n };\nr3 = {\n \"value\": value(3),\n \"entity_id\": entity(3)\n };\nreturn ([{payload: r1}, {payload: r2}, {payload: r3}]);","outputs":3,"noerr":0,"x":150,"y":480,"wires":[["5fb837e1.2ff708"],["5fb837e1.2ff708"],["5fb837e1.2ff708"]]},{"id":"a5bab4f1.9cf828","type":"api-call-service","z":"dec677d6.e60418","name":"notify","server":"6c015bb.092d8a4","version":"1","debugenabled":false,"service_domain":"notify","service":"pushbullet_ricardo","entityId":"","data":"{ \"title\":\"Rega\", \"message\":\"Tempos dos ciclos não definidos\" }","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":750,"y":380,"wires":[[]]},{"id":"201769dc.101716","type":"trigger","z":"dec677d6.e60418","name":"","op1":"","op2":"","op1type":"pay","op2type":"nul","duration":"2","extend":false,"units":"hr","reset":"","bytopic":"all","outputs":1,"x":680,"y":320,"wires":[["a5bab4f1.9cf828"]]},{"id":"b4ae520f.44537","type":"api-current-state","z":"dec677d6.e60418","name":"is irrigation on?","server":"6c015bb.092d8a4","version":"1","outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"binary_sensor.irrigation_running","state_type":"str","state_location":"","override_payload":"none","entity_location":"","override_data":"none","blockInputOverrides":false,"x":410,"y":1380,"wires":[["65734a9a.1da264"],[]]},{"id":"1c8a8d60.e81173","type":"api-current-state","z":"dec677d6.e60418","name":"is irrigation off?","server":"6c015bb.092d8a4","version":"1","outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"binary_sensor.irrigation_running","state_type":"str","state_location":"","override_payload":"none","entity_location":"","override_data":"none","blockInputOverrides":false,"x":400,"y":1280,"wires":[["c7465875.b91bd8"],["45192709.b89bf8"]]},{"id":"8d4e43b8.ab4ad","type":"api-call-service","z":"dec677d6.e60418","name":"cancel timer","server":"6c015bb.092d8a4","version":"1","debugenabled":false,"service_domain":"timer","service":"cancel","entityId":"timer.irrigation_cycle_zone_duration","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1010,"y":1380,"wires":[[]]},{"id":"95b9c55.fa56e38","type":"api-current-state","z":"dec677d6.e60418","name":"irrigation canceled?","server":"6c015bb.092d8a4","version":"1","outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.irrigation_cancel","state_type":"str","state_location":"","override_payload":"none","entity_location":"","override_data":"none","blockInputOverrides":false,"x":790,"y":1160,"wires":[["97464d2f.bbe6f"],["abcac6c1.8a45e8"]]},{"id":"97464d2f.bbe6f","type":"link out","z":"dec677d6.e60418","name":"","links":["272e0aa9.edcfa6"],"x":935,"y":1200,"wires":[]},{"id":"272e0aa9.edcfa6","type":"link in","z":"dec677d6.e60418","name":"","links":["97464d2f.bbe6f","2648fcc.2333904"],"x":215,"y":860,"wires":[["628fba5.23dc044"]]},{"id":"5c14f4f1.e50e8c","type":"api-call-service","z":"dec677d6.e60418","name":"set off irrigation running","server":"6c015bb.092d8a4","version":"1","debugenabled":false,"service_domain":"input_boolean","service":"turn_off","entityId":"input_boolean.irrigation_running","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":810,"y":960,"wires":[[]]},{"id":"da4d7c3d.5eb54","type":"api-call-service","z":"dec677d6.e60418","name":"turn on cancel switch","server":"6c015bb.092d8a4","version":"1","debugenabled":false,"service_domain":"input_boolean","service":"turn_on","entityId":"input_boolean.irrigation_cancel","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":820,"y":1380,"wires":[["8d4e43b8.ab4ad"]]},{"id":"628fba5.23dc044","type":"api-call-service","z":"dec677d6.e60418","name":"turn off cancel switch","server":"6c015bb.092d8a4","version":"1","debugenabled":false,"service_domain":"input_boolean","service":"turn_off","entityId":"input_boolean.irrigation_cancel","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":360,"y":860,"wires":[["905d84a2.94a398"]]},{"id":"f067557.b2587a8","type":"api-call-service","z":"dec677d6.e60418","name":"turn valves off","server":"6c015bb.092d8a4","version":"1","debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"group.irrigation_valves","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1040,"y":900,"wires":[["b8570bfb.19b528"]]},{"id":"45192709.b89bf8","type":"api-call-service","z":"dec677d6.e60418","name":"turn off manual switch","server":"6c015bb.092d8a4","version":"1","debugenabled":false,"service_domain":"input_boolean","service":"turn_off","entityId":"input_boolean.irrigation_manual_run","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":640,"y":1320,"wires":[[]]},{"id":"940539d7.725d28","type":"api-current-state","z":"dec677d6.e60418","name":"irrigation canceled?","server":"6c015bb.092d8a4","version":"1","outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.irrigation_cancel","state_type":"str","state_location":"","override_payload":"none","entity_location":"","override_data":"none","blockInputOverrides":false,"x":950,"y":1080,"wires":[["2648fcc.2333904"],["a5a7bd92.e7c16"]]},{"id":"2648fcc.2333904","type":"link out","z":"dec677d6.e60418","name":"","links":["272e0aa9.edcfa6"],"x":1115,"y":1040,"wires":[]},{"id":"2e1030cf.0c9c2","type":"api-call-service","z":"dec677d6.e60418","name":"turn valves off","server":"6c015bb.092d8a4","version":"1","debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"group.irrigation_valves","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":200,"y":1080,"wires":[["52097031.a98aa"]]},{"id":"20ddfcbe.2ae214","type":"api-call-service","z":"dec677d6.e60418","name":"set on irrigation running","server":"6c015bb.092d8a4","version":"1","debugenabled":false,"service_domain":"input_boolean","service":"turn_on","entityId":"input_boolean.irrigation_running","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":270,"y":800,"wires":[["3a8897b5.45b258"]]},{"id":"ed6830d1.4f29a","type":"change","z":"dec677d6.e60418","name":"del entity_id","rules":[{"t":"delete","p":"payload.entity_id","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":1080,"wires":[["cd4a5856.8cdfa8"]]},{"id":"979ca791.527408","type":"api-call-service","z":"dec677d6.e60418","name":"turn off cancel switch","server":"6c015bb.092d8a4","version":"1","debugenabled":false,"service_domain":"input_boolean","service":"turn_off","entityId":"input_boolean.irrigation_cancel","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":780,"y":1020,"wires":[[]]},{"id":"bf88e300.4958","type":"api-call-service","z":"dec677d6.e60418","name":"turn off cancel switch","server":"6c015bb.092d8a4","version":"1","debugenabled":false,"service_domain":"input_boolean","service":"turn_off","entityId":"input_boolean.irrigation_cancel","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":620,"y":80,"wires":[[]]},{"id":"3cdb7142.90c7de","type":"api-current-state","z":"dec677d6.e60418","name":"is irrigation off?","server":"6c015bb.092d8a4","version":"1","outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"binary_sensor.irrigation_running","state_type":"str","state_location":"","override_payload":"none","entity_location":"","override_data":"none","blockInputOverrides":false,"x":440,"y":140,"wires":[["bf88e300.4958"],[]]},{"id":"8170972f.7feb48","type":"api-call-service","z":"dec677d6.e60418","name":"turn off cancel switch","server":"6c015bb.092d8a4","version":"1","debugenabled":false,"service_domain":"input_boolean","service":"turn_off","entityId":"input_boolean.irrigation_cancel","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":780,"y":720,"wires":[["db965fec.bcf16"]]},{"id":"c7465875.b91bd8","type":"api-call-service","z":"dec677d6.e60418","name":"turn off cancel switch","server":"6c015bb.092d8a4","version":"1","debugenabled":false,"service_domain":"input_boolean","service":"turn_off","entityId":"input_boolean.irrigation_cancel","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":640,"y":1240,"wires":[["ea17ae82.d498a"]]},{"id":"32d9d3cb.9d3cbc","type":"server-state-changed","z":"dec677d6.e60418","name":"irrigation cancel ON","server":"6c015bb.092d8a4","version":"1","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_boolean.irrigation_cancel","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"x":150,"y":1480,"wires":[["4330b7af.1eb8f8"],[]]},{"id":"4330b7af.1eb8f8","type":"api-current-state","z":"dec677d6.e60418","name":"is irrigation off?","server":"6c015bb.092d8a4","version":"1","outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"binary_sensor.irrigation_running","state_type":"str","state_location":"","override_payload":"none","entity_location":"","override_data":"none","blockInputOverrides":false,"x":370,"y":1480,"wires":[["98bad5d3.0e57c8"],[]]},{"id":"98bad5d3.0e57c8","type":"api-call-service","z":"dec677d6.e60418","name":"turn off cancel switch","server":"6c015bb.092d8a4","version":"1","debugenabled":false,"service_domain":"input_boolean","service":"turn_off","entityId":"input_boolean.irrigation_cancel","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":590,"y":1480,"wires":[[]]},{"id":"8fb664cc.9cde98","type":"comment","z":"dec677d6.e60418","name":"cancel irrigation","info":"","x":140,"y":1420,"wires":[]},{"id":"1250ea90.811c35","type":"api-current-state","z":"dec677d6.e60418","name":"is raining?","server":"6c015bb.092d8a4","version":"1","outputs":2,"halt_if":"3","halt_if_type":"num","halt_if_compare":"gte","override_topic":false,"entity_id":"sensor.dark_sky_precip_intensity","state_type":"num","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":650,"y":660,"wires":[["b5a1184e.f67938"],["8170972f.7feb48"]]},{"id":"b5a1184e.f67938","type":"api-call-service","z":"dec677d6.e60418","name":"notify","server":"6c015bb.092d8a4","version":"1","debugenabled":false,"service_domain":"notify","service":"pushbullet_ricardo","entityId":"","data":"{ \"title\":\"Rega\", \"message\":\"Está a chover, não vai regar!\" }","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":830,"y":660,"wires":[[]]},{"id":"b83a0d4e.0dfdb","type":"api-current-state","z":"dec677d6.e60418","name":"valves unavailable?","server":"6c015bb.092d8a4","version":"1","outputs":2,"halt_if":"unavailable","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"switch.irrigation_zone1_valve","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":330,"y":740,"wires":[["1370a194.9d351e"],[]]},{"id":"1370a194.9d351e","type":"api-call-service","z":"dec677d6.e60418","name":"notify","server":"6c015bb.092d8a4","version":"1","debugenabled":false,"service_domain":"notify","service":"pushbullet_ricardo","entityId":"","data":"{ \"title\":\"Rega\", \"message\":\"Sem ligação WIFI!\" }","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":510,"y":740,"wires":[[]]},{"id":"a4cfaaab.8f9518","type":"mytimeout","z":"dec677d6.e60418","name":"timer","outtopic":"","outsafe":"","outwarning":"","outunsafe":"off","warning":"0","timer":"0","debug":false,"ndebug":false,"ignoreCase":false,"repeat":false,"again":false,"x":450,"y":1160,"wires":[["60d42afc.7c0ba4"],[]]},{"id":"c669f256.e0aae","type":"function","z":"dec677d6.e60418","name":"func","func":"msg.payload = \"on\";\nmsg.timeout = parseInt(msg.irrigation.duration) * 60;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":310,"y":1160,"wires":[["a4cfaaab.8f9518"]]},{"id":"6c015bb.092d8a4","type":"server","name":"Home Assistant"},{"id":"c127cb01.a49e28","type":"server","name":"Home Assistant","legacy":false,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true}]