[{"id":"c182c0c.cdb5a4","type":"tab","label":"Pump Timer","disabled":false,"info":""},{"id":"e9b94257.58865","type":"mytimeout","z":"c182c0c.cdb5a4","name":"Count Down Timer","outtopic":"TimerCountDown","outsafe":"on","outwarning":"Warning","outunsafe":"off","warning":"5","timer":"10800","debug":false,"ndebug":false,"ignoreCase":true,"repeat":false,"again":false,"x":550,"y":180,"wires":[["d2444abc.57f1b8"],["963ceca.f2ca51"]]},{"id":"d2444abc.57f1b8","type":"debug","z":"c182c0c.cdb5a4","name":"On/Off","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":770,"y":160,"wires":},{"id":"963ceca.f2ca51","type":"switch","z":"c182c0c.cdb5a4","name":"Filter","property":"payload","propertyType":"msg","rules":[{"t":"gt","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":750,"y":220,"wires":[["b6cf2b14.dcc918"]]},{"id":"760ae9da.fff238","type":"function","z":"c182c0c.cdb5a4","name":"Create JSON","func":"var timeout = flow.get("TimeRemainPool",msg.payload);\n\nvar value = msg.payload; //value will equal pool pump status\n\n if (value === true){\n msg.payload = {"payload": "on", timeout, "warning": 30}; \n return [msg];\n }\n \n else {\n msg.payload = "stop"; \n return [msg];\n }\n","outputs":1,"noerr":0,"x":330,"y":180,"wires":[["e9b94257.58865"]]},{"id":"8b8f80a5.f2879","type":"debug","z":"c182c0c.cdb5a4","name":"TimeRemainPool","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":1170,"y":260,"wires":},{"id":"b6cf2b14.dcc918","type":"function","z":"c182c0c.cdb5a4","name":"Create flow TimeRemainPool","func":"flow.set("TimeRemainPool",msg.payload);\nmsg.payload = ((msg.payload)/60).toFixed(2);\nreturn msg;\n","outputs":1,"noerr":0,"x":900,"y":280,"wires":[["8b8f80a5.f2879","a5df946b.3477c8"]]},{"id":"a5df946b.3477c8","type":"ui_text","z":"c182c0c.cdb5a4","group":"fad07ad1.a0beb8","order":0,"width":0,"height":0,"name":"Pool Time Remaining","label":"Pool Time Remaining:","format":"{{msg.payload}}","layout":"row-left","x":1180,"y":320,"wires":},{"id":"4c61adff.8827c4","type":"function","z":"c182c0c.cdb5a4","name":"Get PoolPump Status","func":"var value = global.get("PoolPumpStatus",msg.payload);\nmsg = { payload:value };\nreturn msg;","outputs":1,"noerr":0,"x":200,"y":120,"wires":[["3265b32.337834c","80d36119.11cbf"]]},{"id":"3265b32.337834c","type":"rbe","z":"c182c0c.cdb5a4","name":"Change Only","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":430,"y":120,"wires":[["760ae9da.fff238"]]},{"id":"b8a16315.3875d","type":"inject","z":"c182c0c.cdb5a4","name":"Trigger","topic":"","payload":"","payloadType":"str","repeat":"10","crontab":"","once":true,"onceDelay":"1","x":100,"y":40,"wires":[["4c61adff.8827c4"]]},{"id":"80d36119.11cbf","type":"debug","z":"c182c0c.cdb5a4","name":"Pool Pump Status","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":460,"y":60,"wires":},{"id":"454e5daf.54af64","type":"inject","z":"c182c0c.cdb5a4","name":"Daily Pump Time Required","topic":"","payload":"10800","payloadType":"num","repeat":"","crontab":"01 01 * * *","once":false,"onceDelay":0.1,"x":300,"y":360,"wires":[["396af68c.11318a"]]},{"id":"396af68c.11318a","type":"function","z":"c182c0c.cdb5a4","name":"Update day's target","func":"PumpTimeRequired = msg.payload; //value will equal pool pump status\nvar timeout = flow.get("TimeRemainPool",msg.payload);\nmsg.payload = timeout + PumpTimeRequired;\n\nreturn msg;","outputs":1,"noerr":0,"x":590,"y":360,"wires":[["b6cf2b14.dcc918"]]},{"id":"fad07ad1.a0beb8","type":"ui_group","z":"","name":"POOL CONTROLLER V1.1","tab":"aa7a6127.8d57f","order":1,"disp":true,"width":"6","collapse":false},{"id":"aa7a6127.8d57f","type":"ui_tab","z":"","name":"Pool Settings","icon":"dashboard","order":1}]