The right logic for this task

Did a redo of the entire thing. Not quite there, but getting closer. A lot of trial and error.
Especially, the logic in the main component, and the timers to run, and to pause are causing me headaches.

[{"id":"854d80b8.4c26c8","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"bf725bcb.d224b8","type":"comment","z":"854d80b8.4c26c8","name":"HELPERS FOR TESTING","info":"","x":350,"y":560,"wires":[]},{"id":"3e78bcf8.23a05c","type":"comment","z":"854d80b8.4c26c8","name":"PANEL INPUT","info":"","x":310,"y":840,"wires":[]},{"id":"c7906194.3443","type":"comment","z":"854d80b8.4c26c8","name":"TIMERS","info":"","x":1060,"y":900,"wires":[]},{"id":"e787bd04.e2168","type":"inject","z":"854d80b8.4c26c8","name":"","topic":"","payload":"7","payloadType":"num","repeat":"","crontab":"","once":true,"onceDelay":"","x":250,"y":1140,"wires":[["5b39ee37.10f1e8","2377d224.f6ecf6"]]},{"id":"dcb98768.4c3018","type":"comment","z":"854d80b8.4c26c8","name":"timerInput","info":"","x":260,"y":1060,"wires":[]},{"id":"5b39ee37.10f1e8","type":"ui_numeric","z":"854d80b8.4c26c8","name":"","label":"setWaitTime","tooltip":"Time to wait between runs","group":"ee056679.c00758","order":12,"width":0,"height":0,"passthru":true,"topic":"","format":"{{value}}","min":"5","max":"180","step":"5","x":430,"y":1140,"wires":[["ffa5dfb9.cb9c4"]]},{"id":"2377d224.f6ecf6","type":"ui_numeric","z":"854d80b8.4c26c8","name":"","label":"setRunTime","tooltip":"Time to wait between runs","group":"ee056679.c00758","order":12,"width":0,"height":0,"passthru":true,"topic":"","format":"{{value}}","min":"5","max":"180","step":"5","x":430,"y":1200,"wires":[["d1a3ff94.743c08"]]},{"id":"c2cd1fd1.25d2e8","type":"inject","z":"854d80b8.4c26c8","name":"","topic":"","payload":"14","payloadType":"num","repeat":"","crontab":"","once":true,"onceDelay":"","x":250,"y":1200,"wires":[["2377d224.f6ecf6","5b39ee37.10f1e8"]]},{"id":"81a0b80d.2a81a","type":"comment","z":"854d80b8.4c26c8","name":"PANEL OUTPUT","info":"","x":1460,"y":320,"wires":[]},{"id":"ffa5dfb9.cb9c4","type":"function","z":"854d80b8.4c26c8","name":"Set Timer (later to be Minutes*60)","func":"global.set('setWaitTime', msg.payload * 1); // seconds to minutes\nreturn msg;","outputs":1,"noerr":0,"x":680,"y":1140,"wires":[[]]},{"id":"d1a3ff94.743c08","type":"function","z":"854d80b8.4c26c8","name":"Set Timer (later to be Minutes*60)","func":"global.set('setRunTime', msg.payload * 1); // seconds to minutes\nreturn msg;","outputs":1,"noerr":0,"x":680,"y":1200,"wires":[[]]},{"id":"8669658.7fd3b98","type":"mytimeout","z":"854d80b8.4c26c8","name":"timerWait","outtopic":"timerWait","outsafe":"on","outwarning":"","outunsafe":"off","warning":"0","timer":"6","debug":false,"ndebug":false,"ignoreCase":false,"repeat":false,"again":false,"x":1240,"y":1000,"wires":[["8b5215cc.843158"],["baca5ca8.d4a75"]]},{"id":"2d486d58.812b92","type":"switch","z":"854d80b8.4c26c8","name":"True/False","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":1070,"y":1000,"wires":[[],["8669658.7fd3b98"]]},{"id":"6f078e7b.845b4","type":"dsm","z":"854d80b8.4c26c8","name":"Main","sm_config":"{\n    \"currentState\": \"undefined\",\n    \"data\": {\n        \"timerWait\": false,\n        \"timerRun\": true,\n        \"toggle_Ah\": false,\n        \"toggle_Manual\": false\n    },\n    \"methods\": {\n        \n        \"timerWait\": \"sm.data.timerWait = msg.payload;\",\n        \"timerRun\": \"sm.data.timerRun = msg.payload;\",\n        \"toggle_Ah\": \"sm.data.toggle_Ah = msg.payload;\",\n        \"toggle_Manual\": \"sm.data.toggle_Manual = msg.payload;\",\n        \"onTransition\": [\n            \"if ((sm.data.toggle_Manual && sm.data.timerRun) && !sm.data.timerWait) {\",\n            \"   sm.currentState = true;\",\n            \"   sm.fill = 'green';\",\n            \"} else if ((sm.data.toggle_Ah && sm.data.timerRun) && !sm.data.timerWait){\",\n            \"   sm.currentState = true;\",\n            \"   sm.fill = 'green';\",\n            \"} else {\",\n            \"   sm.currentState = false;\",\n            \"   sm.fill = 'yellow';\",\n            \"}\",\n            \"msg.payload = sm.currentState;\",\n            \"output = true;\"\n        ],\n        \"status\": {\n            \"fill\": {\n                \"get\": \"sm.fill;\"\n            },\n            \"shape\": \"dot\",\n            \"text\": {\n                \"get\": \"sm.currentState;\"\n            }\n        }\n    }\n}","x":980,"y":720,"wires":[["9be4141d.71af58","293b58d6.e75ab8","a8ff0dc3.8a0cb8"]]},{"id":"a8ff0dc3.8a0cb8","type":"debug","z":"854d80b8.4c26c8","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1270,"y":720,"wires":[]},{"id":"d40a2d12.4863e8","type":"function","z":"854d80b8.4c26c8","name":"renamer","func":"msg.topic = \"timerRun\"\nmsg.name = \"timerRun\"\nreturn msg;","outputs":1,"noerr":0,"x":1400,"y":940,"wires":[["6f078e7b.845b4"]]},{"id":"f6c86f8a.16534","type":"switch","z":"854d80b8.4c26c8","name":"True/False","property":"payload","propertyType":"msg","rules":[{"t":"true"},{"t":"false"}],"checkall":"true","repair":false,"outputs":2,"x":730,"y":720,"wires":[["6f078e7b.845b4","9be4141d.71af58"],[]]},{"id":"293b58d6.e75ab8","type":"function","z":"854d80b8.4c26c8","name":"Test","func":"msg.color = (msg.payload === true)?\"lime\":\"grey\";\nmsg.topic = (msg.payload === true)?\n\"fa fa-chrome fa-spin fa-2x fa-fw\":\"fa fa-chrome fa-2x\";\nreturn msg;","outputs":1,"noerr":0,"x":1430,"y":360,"wires":[["c92ace41.7bd718"]]},{"id":"92bc3485.65f888","type":"change","z":"854d80b8.4c26c8","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"on","fromt":"str","to":"true","tot":"bool"},{"t":"change","p":"payload","pt":"msg","from":"off","fromt":"str","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":1220,"y":940,"wires":[["d40a2d12.4863e8"]]},{"id":"774f783c.909b3","type":"ui_switch","z":"854d80b8.4c26c8","name":"","label":"toggle_Ah","tooltip":"The absolute humidity trigger. True if the water content outside is less than inside","group":"b37cbe7b.05118","order":5,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"toggle_Ah","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","x":500,"y":620,"wires":[["f6c86f8a.16534","c697c7cf.2073a"]]},{"id":"58bea6c7.2c2978","type":"ui_switch","z":"854d80b8.4c26c8","name":"","label":"toggle_Manual","tooltip":"","group":"b37cbe7b.05118","order":5,"width":0,"height":0,"passthru":true,"decouple":"false","topic":"toggle_Manual","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","x":480,"y":720,"wires":[["f6c86f8a.16534"]]},{"id":"97d43745.870298","type":"ui_button","z":"854d80b8.4c26c8","name":"toggle_Manual","group":"ee056679.c00758","order":3,"width":0,"height":0,"passthru":false,"label":"ON","tooltip":"","color":"","bgcolor":"","icon":"","payload":"true","payloadType":"bool","topic":"toggle_Manual","x":320,"y":880,"wires":[["f6c86f8a.16534"]]},{"id":"c92ace41.7bd718","type":"ui_text","z":"854d80b8.4c26c8","group":"ee056679.c00758","order":1,"width":"2","height":"1","name":"","label":"FAN","format":"<font color={{msg.color}} ><i class=\"{{msg.topic}} \" style=\"font-size:2px;\"></i></font>","layout":"row-spread","x":1570,"y":360,"wires":[]},{"id":"58e10519.1ae174","type":"mytimeout","z":"854d80b8.4c26c8","name":"timerRun","outtopic":"timerRun","outsafe":"on","outwarning":"","outunsafe":"off","warning":"0","timer":"3","debug":false,"ndebug":false,"ignoreCase":false,"repeat":false,"again":false,"x":1060,"y":940,"wires":[["92bc3485.65f888"],["5275572d.d2809"]]},{"id":"f75264ca.a74a7","type":"inject","z":"854d80b8.4c26c8","name":"","topic":"","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":310,"y":600,"wires":[["774f783c.909b3"]]},{"id":"1fe0fd5a.7d3a63","type":"inject","z":"854d80b8.4c26c8","name":"","topic":"","payload":"false","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":310,"y":640,"wires":[["774f783c.909b3"]]},{"id":"945fb43e.c88318","type":"inject","z":"854d80b8.4c26c8","name":"","topic":"","payload":"false","payloadType":"bool","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":310,"y":740,"wires":[["58bea6c7.2c2978"]]},{"id":"3ffab50c.e24a62","type":"inject","z":"854d80b8.4c26c8","name":"","topic":"","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":310,"y":700,"wires":[["58bea6c7.2c2978"]]},{"id":"63a6fd0e.283e2c","type":"function","z":"854d80b8.4c26c8","name":"Get global time settings","func":"// Need to change the on to\n// { \"payload\": \"on\", \"timeout\": 69, \"warning\": 10 }\n\nif(msg.payload == true) {\n    msg.payload = { \n        \"payload\": \"on\", \n        \"timeout\": global.get('setRunTime'),\n        \"warning\": 0\n    };\n} else {\n    msg.payload = {  \"payload\": \"off\" };\n}\nreturn msg;","outputs":1,"noerr":0,"x":730,"y":980,"wires":[["58e10519.1ae174"]]},{"id":"cf619d60.61014","type":"ui_text","z":"854d80b8.4c26c8","group":"ee056679.c00758","order":2,"width":"0","height":"0","name":"","label":"REMAINING RUN TIME","format":"{{msg.payload}}","layout":"row-spread","x":1690,"y":420,"wires":[]},{"id":"a60942b0.98258","type":"ui_text","z":"854d80b8.4c26c8","group":"ee056679.c00758","order":2,"width":"0","height":"0","name":"","label":"REMAINING WAIT TIME","format":"{{msg.payload}}","layout":"row-spread","x":1690,"y":480,"wires":[]},{"id":"c697c7cf.2073a","type":"function","z":"854d80b8.4c26c8","name":"Test","func":"msg.color = (msg.payload === true)?\"lime\":\"grey\";\nreturn msg;","outputs":1,"noerr":0,"x":1430,"y":540,"wires":[["6ae50df8.36c434"]]},{"id":"6ae50df8.36c434","type":"ui_text","z":"854d80b8.4c26c8","group":"ee056679.c00758","order":1,"width":"2","height":"1","name":"","label":"AH","format":"<font color={{msg.color}} ><i class=\"fa fa-circle\" style=\"font-size:36px;\"></i></font>","layout":"row-spread","x":1570,"y":540,"wires":[]},{"id":"59fab0fb.d34c9","type":"function","z":"854d80b8.4c26c8","name":"renamer","func":"msg.topic = \"timerWait\"\nmsg.name = \"timerWait\"\nreturn msg;","outputs":1,"noerr":0,"x":1560,"y":1000,"wires":[["6f078e7b.845b4"]]},{"id":"8b5215cc.843158","type":"change","z":"854d80b8.4c26c8","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"on","fromt":"str","to":"true","tot":"bool"},{"t":"change","p":"payload","pt":"msg","from":"off","fromt":"str","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":1400,"y":1000,"wires":[["59fab0fb.d34c9"]]},{"id":"9be4141d.71af58","type":"rbe","z":"854d80b8.4c26c8","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":870,"y":880,"wires":[["63a6fd0e.283e2c","2d486d58.812b92"]]},{"id":"5275572d.d2809","type":"function","z":"854d80b8.4c26c8","name":"[s] to [hh:mm:ss]","func":"// Message from preceeding node is in seconds - should be less than 24 hours (86400 seconds).\nvar time = (new Date(msg.payload * 1000)).toUTCString().match(/(\\d\\d:\\d\\d:\\d\\d)/)[0];\n// Pass on the string to the next node, what ever that may be. (groov Data Store for example).\nmsg.payload = time;\nreturn msg;","outputs":1,"noerr":0,"x":1460,"y":420,"wires":[["cf619d60.61014"]]},{"id":"baca5ca8.d4a75","type":"function","z":"854d80b8.4c26c8","name":"[s] to [hh:mm:ss]","func":"// Message from preceeding node is in seconds - should be less than 24 hours (86400 seconds).\nvar time = (new Date(msg.payload * 1000)).toUTCString().match(/(\\d\\d:\\d\\d:\\d\\d)/)[0];\n// Pass on the string to the next node, what ever that may be. (groov Data Store for example).\nmsg.payload = time;\nreturn msg;","outputs":1,"noerr":0,"x":1460,"y":480,"wires":[["a60942b0.98258"]]},{"id":"73987b5c.b44f8c","type":"throttle","z":"854d80b8.4c26c8","name":"sensitivityThottle","throttleType":"time","timeLimit":"10","timeLimitType":"seconds","countLimit":0,"blockSize":0,"locked":false,"x":650,"y":900,"wires":[[]]},{"id":"7dcefdab.289b84","type":"comment","z":"854d80b8.4c26c8","name":"ISSUE","info":"How to get this variable (if true) to continue to start the fan after timerWait.","x":550,"y":580,"wires":[]},{"id":"58512333.5591cc","type":"comment","z":"854d80b8.4c26c8","name":"ISSUE","info":"This is a test to try to stop the timer to restart if true is sent while counting down.... not quite working, though","x":890,"y":840,"wires":[]},{"id":"a171bbaf.fcfc98","type":"comment","z":"854d80b8.4c26c8","name":"ISSUE","info":"Timer that should block the fan from starting to allow for a pause between runs, no matter the AH condition. However, manual override should allways override...","x":1230,"y":1060,"wires":[]},{"id":"debe9f67.37087","type":"comment","z":"854d80b8.4c26c8","name":"ISSUE","info":"Main block... some logic are not quite there yet...","x":990,"y":680,"wires":[]},{"id":"ee056679.c00758","type":"ui_group","z":"","name":"Panel","tab":"7b5010b.9c77c7","disp":true,"width":"6","collapse":false},{"id":"b37cbe7b.05118","type":"ui_group","z":"","name":"Test_Buttons","tab":"7b5010b.9c77c7","order":1,"disp":true,"width":"6","collapse":false},{"id":"7b5010b.9c77c7","type":"ui_tab","z":"","name":"Home","icon":"dashboard","order":1}]