[{"id":"eb725c52.8260f","type":"tab","label":"SumpPumpMonitor","disabled":false,"info":""},{"id":"602486f0.6ecd88","type":"ui_button","z":"eb725c52.8260f","name":"","group":"2b79823a.5475ee","order":3,"width":0,"height":0,"passthru":false,"label":"Restart SumpSensor-CPU","color":"","bgcolor":"#703633","icon":"","payload":"1","payloadType":"str","topic":"","x":260,"y":580,"wires":[["87a4eea5.be77a"]]},{"id":"de91b269.af49e","type":"mqtt out","z":"eb725c52.8260f","name":"","topic":"cmnd/SumpWaterSensorCPUrestart","qos":"2","retain":"","broker":"e5102fc8.e43f8","x":818.0000457763672,"y":581.9998645782471,"wires":[]},{"id":"6789b3b3.1226fc","type":"mqtt in","z":"eb725c52.8260f","name":"","topic":"stat/SumpWaterSensor/LWT","qos":"2","datatype":"auto","broker":"e5102fc8.e43f8","x":240,"y":380,"wires":[["28eacd24.bc3602","962631db.dbe","fe47b18a.048c1"]]},{"id":"28eacd24.bc3602","type":"ui_text","z":"eb725c52.8260f","group":"2b79823a.5475ee","order":1,"width":"0","height":"0","name":"SumpWaterSensor_status","label":"SumpWaterSensor Status: ","format":"{{msg.payload}}","layout":"row-center","x":730,"y":380,"wires":[]},{"id":"5375c238.d9c05c","type":"mqtt in","z":"eb725c52.8260f","name":"","topic":"stat/SumpWaterSensorInfo","qos":"2","datatype":"auto","broker":"e5102fc8.e43f8","x":250,"y":460,"wires":[["962631db.dbe","fe47b18a.048c1"]]},{"id":"962631db.dbe","type":"function","z":"eb725c52.8260f","name":"Process Info","func":"var d = new Date();\nvar temp = d.toDateString();\ntemp = temp+\", \"+d.toLocaleTimeString()\nif(msg.topic==\"stat/SumpWaterSensor/LWT\"){\n msg.Status=msg.payload;\n if(msg.payload==\"Offline\"){\n global.set(\"SumpWaterSensorCPUOfflineCount\",global.get(\"SumpWaterSensorCPUOfflineCount\")+1);\n global.set(\"SumpWaterSensorCPULastOffline\",temp);\n }\n} else if(msg.topic.indexOf(\"Info\")>-1){\n var UptimeJSON=JSON.parse(msg.payload);\n var Device_Uptime=UptimeJSON.Uptime||\"N/A\";\n if (Device_Uptime!==\"N/A\"){\n var UpDay=Math.floor(Device_Uptime/86400);\n Device_Uptime%=86400;\n var UpHour=Math.floor(Device_Uptime/3600);\n Device_Uptime%=3600;\n var UpMin=Math.floor(Device_Uptime/60);\n var UpSec=Math.floor(Device_Uptime%60);\n var UptimeStr=`Uptime: ${UpDay}d:${UpHour}h:${UpMin}m:${UpSec}s`;\n if (msg.topic.indexOf(\"SumpWaterSensor\")>-1) {\n global.set(\"SumpWaterSensorCPUUptime\",UptimeStr);\n }\n }\n}\n\nmsg.payload=global.get(\"SumpWaterSensorCPUOfflineCount\").toString()||\"-\";\nmsg.LastOffline=global.get(\"SumpWaterSensorCPULastOffline\")||\"-\";\nmsg.uptime=global.get(\"SumpWaterSensorCPUUptime\");\nreturn msg;\n","outputs":"1","noerr":0,"x":510,"y":460,"wires":[["8846149a.a2c5c8"]]},{"id":"8846149a.a2c5c8","type":"ui_template","z":"eb725c52.8260f","group":"2b79823a.5475ee","name":"SumpWaterSensorCPU","order":2,"width":"6","height":"4","format":"<div align=\"center\" overflow-y=\"hidden\">\n\t<p>Offline Counts:</p>\n\t<p ng-style=\"{color: 'green'}\">{{msg.payload}}\n </p>\n\t<p>Last Offline Time:</p>\n\t<p ng-style=\"{color: 'green'}\">{{msg.LastOffline}}\n </p>\n\t<p ng-style=\"{color: '#1b9eb2'}\">{{msg.uptime}}\n </p>\n</div>","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":750,"y":460,"wires":[[]]},{"id":"62bdfafa.58e354","type":"mqtt in","z":"eb725c52.8260f","name":"","topic":"tele/SumpWaterSensor","qos":"2","datatype":"auto","broker":"e5102fc8.e43f8","x":220,"y":280,"wires":[["b7ba70ba.cc1d","1508b24b.17603e","eaa13bf5.3e8ab8","fe47b18a.048c1","993aff48.2cc51","ad24e44.40f3d18"]]},{"id":"b7ba70ba.cc1d","type":"ui_text","z":"eb725c52.8260f","group":"2b79823a.5475ee","order":1,"width":"0","height":"0","name":"SumpWaterSensor_state","label":"Sensor State: ","format":"{{msg.payload}}","layout":"row-center","x":730,"y":340,"wires":[]},{"id":"87a4eea5.be77a","type":"function","z":"eb725c52.8260f","name":"GlobalSet","func":"global.set(\"NumMovements\",0);\nglobal.set(\"SumpWaterSensorCPUOfflineCount\",0);\nglobal.set(\"SumpWaterSensorCPULastOffline\",\"-\");\nreturn msg;","outputs":1,"noerr":0,"x":524.0000152587891,"y":586.5555419921875,"wires":[["de91b269.af49e"]]},{"id":"1508b24b.17603e","type":"function","z":"eb725c52.8260f","name":"SumpWaterState","func":"if (msg.payload==\"WET\") {\n msg.payload=\"Warning, sump pump water level is too high, please check!\";\n} else {\n msg.payload=\"sump pump water level is back to normal\";\n}\nreturn msg;\n","outputs":"1","noerr":0,"x":570,"y":280,"wires":[["4b5dc6a0.137128"]]},{"id":"4b5dc6a0.137128","type":"delay","z":"eb725c52.8260f","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"9","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":820,"y":280,"wires":[[]]},{"id":"2956e835.0cdf38","type":"sendsms","z":"eb725c52.8260f","d":true,"creds":"blah","to":"xx","fr":"xx","text":"Sump water!","unicode":false,"x":230,"y":80,"wires":[[]]},{"id":"828754c5.5e8358","type":"ui_button","z":"eb725c52.8260f","name":"","group":"2b79823a.5475ee","order":4,"width":0,"height":0,"passthru":false,"label":"Debug off","tooltip":"","color":"","bgcolor":"","icon":"","payload":"0","payloadType":"str","topic":"","x":230,"y":640,"wires":[["6a9a6efb.b59f9"]]},{"id":"9f1f2983.3d9cd8","type":"ui_button","z":"eb725c52.8260f","name":"","group":"2b79823a.5475ee","order":5,"width":0,"height":0,"passthru":false,"label":"Debug on","tooltip":"","color":"","bgcolor":"","icon":"","payload":"2","payloadType":"str","topic":"","x":230,"y":700,"wires":[["6a9a6efb.b59f9"]]},{"id":"6a9a6efb.b59f9","type":"mqtt out","z":"eb725c52.8260f","name":"","topic":"cmnd/SumpWaterSensorDebug","qos":"2","retain":"","broker":"e5102fc8.e43f8","x":750,"y":660,"wires":[]},{"id":"4a9d86f4.cd0798","type":"blynk-ws-in-read","z":"eb725c52.8260f","name":"","pin":"16","pin_all":0,"client":"fcb61c07.82a5f","x":1040,"y":320,"wires":[["b7ba70ba.cc1d"]]},{"id":"aad72b13.630d58","type":"blynk-ws-in-read","z":"eb725c52.8260f","name":"","pin":"17","pin_all":0,"client":"fcb61c07.82a5f","x":1040,"y":380,"wires":[["28eacd24.bc3602"]]},{"id":"eaa13bf5.3e8ab8","type":"blynk-ws-out-write","z":"eb725c52.8260f","name":"","pin":"20","pinmode":0,"client":"fcb61c07.82a5f","x":500,"y":120,"wires":[]},{"id":"5e6da9eb.5cbfb8","type":"blynk-ws-out-notify","z":"eb725c52.8260f","name":"Blynk notify","client":"fcb61c07.82a5f","queue":false,"rate":"60","x":810,"y":60,"wires":[]},{"id":"fe47b18a.048c1","type":"debug","z":"eb725c52.8260f","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":810,"y":180,"wires":[]},{"id":"993aff48.2cc51","type":"change","z":"eb725c52.8260f","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"ONLINE","fromt":"str","to":"SumpPump online","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"WET","fromt":"str","to":"Sump wet","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"DRY","fromt":"str","to":"Sump dry","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"Offline","fromt":"str","to":"Sump offline","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":60,"wires":[["5e6da9eb.5cbfb8"]]},{"id":"de88f389.8e238","type":"mqtt out","z":"eb725c52.8260f","name":"Buzzer disable","topic":"cmnd/SumpWaterSensorBeepFreq","qos":"2","retain":"","broker":"e5102fc8.e43f8","x":700,"y":760,"wires":[]},{"id":"f02ed013.4e915","type":"ui_button","z":"eb725c52.8260f","name":"","group":"2b79823a.5475ee","order":4,"width":0,"height":0,"passthru":false,"label":"Buzzer off","tooltip":"","color":"","bgcolor":"","icon":"","payload":"0","payloadType":"str","topic":"","x":260,"y":760,"wires":[["de88f389.8e238","2e6a46f5.603b9a"]]},{"id":"80c9fcfb.8f966","type":"ui_button","z":"eb725c52.8260f","name":"","group":"2b79823a.5475ee","order":5,"width":0,"height":0,"passthru":false,"label":"Buzzer on","tooltip":"","color":"","bgcolor":"","icon":"","payload":"1","payloadType":"str","topic":"","x":260,"y":820,"wires":[["de88f389.8e238","2e6a46f5.603b9a"]]},{"id":"2e6a46f5.603b9a","type":"debug","z":"eb725c52.8260f","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":570,"y":820,"wires":[]},{"id":"613c9c6.d054664","type":"counter","z":"eb725c52.8260f","name":"counter","init":"0","step":"1","lower":null,"upper":null,"mode":"increment","outputs":2,"x":1100,"y":120,"wires":[["669f8383.1cca9c","5f598744.fefdf8"],[]]},{"id":"669f8383.1cca9c","type":"ui_text","z":"eb725c52.8260f","group":"2b79823a.5475ee","order":1,"width":"0","height":"0","name":"PumpCount","label":"PumpCount: ","format":"{{msg.payload}}","layout":"row-center","x":1290,"y":120,"wires":[]},{"id":"5f598744.fefdf8","type":"debug","z":"eb725c52.8260f","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1130,"y":200,"wires":[]},{"id":"ad24e44.40f3d18","type":"change","z":"eb725c52.8260f","name":"change WET to 1","rules":[{"t":"change","p":"payload","pt":"msg","from":"WET","fromt":"str","to":"1","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":730,"y":120,"wires":[["9a00798b.799728"]]},{"id":"9a00798b.799728","type":"switch","z":"eb725c52.8260f","name":"if DRY then stop","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"DRY","vt":"str"}],"checkall":"false","repair":false,"outputs":1,"x":920,"y":120,"wires":[["613c9c6.d054664"]]},{"id":"2b79823a.5475ee","type":"ui_group","z":"","name":"Sump Water Sensor","tab":"8a73ac79.e9e7","order":3,"disp":true,"width":"6"},{"id":"e5102fc8.e43f8","type":"mqtt-broker","z":"","name":"localhost:1883","broker":"localhost:1883","port":"1883","clientid":"","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"76aa9641.587b98","type":"nexmobasic","z":""},{"id":"fcb61c07.82a5f","type":"blynk-ws-client","z":"","name":"Blynk cloud","path":"ws://blynk-cloud.com/websockets","key":"blah","dbg_all":true,"dbg_read":false,"dbg_write":false,"dbg_notify":false,"dbg_mail":false,"dbg_prop":false,"dbg_sync":false,"dbg_bridge":false,"dbg_low":false,"dbg_pins":"","multi_cmd":false,"proxy_type":"no","proxy_url":"","enabled":true},{"id":"8a73ac79.e9e7","type":"ui_tab","z":"","name":"Sump","icon":"dashboard","order":5,"disabled":false,"hidden":false}]