Compare inside temp to outside

UPDATE:
Added some UI tabs to manually set temperatures
Added time to High & Low temperatures (Thanks to my brother)

[{"id":"a5a73581.054de8","type":"tab","label":"DIY thermostat","disabled":false,"info":""},{"id":"d2d67575.2331b8","type":"mqtt in","z":"a5a73581.054de8","name":"TEMPin","topic":"clima/THin/temperature","qos":"2","broker":"87de71eb.4a609","x":70,"y":580,"wires":[[]]},{"id":"93e7988e.5ca618","type":"mqtt in","z":"a5a73581.054de8","name":"HUMIDITY in","topic":"clima/THin/humidity","qos":"2","broker":"87de71eb.4a609","x":90,"y":1440,"wires":[[]]},{"id":"c01839cf.3c67a8","type":"switch","z":"a5a73581.054de8","name":"compare IN current vs target","property":"payload","propertyType":"msg","rules":[{"t":"lt","v":"minTargettemp","vt":"global"},{"t":"btwn","v":"minTargettemp","vt":"global","v2":"maxTargettemp","v2t":"global"},{"t":"gt","v":"maxTargettemp","vt":"global"}],"checkall":"true","repair":false,"outputs":3,"x":520,"y":560,"wires":[["26da2bbe.095034"],["87e9dfd1.674d"],["81e13fbd.fefb1"]]},{"id":"a346eee7.ced05","type":"change","z":"a5a73581.054de8","name":"Make global and enrich","rules":[{"t":"set","p":"inCurrentTemp","pt":"global","to":"payload","tot":"msg"},{"t":"set","p":"currentIN","pt":"msg","to":"payload","tot":"msg"},{"t":"set","p":"currentOUT","pt":"msg","to":"outCurrentTemp","tot":"global"}],"action":"","property":"","from":"","to":"","reg":false,"x":270,"y":560,"wires":[["c01839cf.3c67a8"]]},{"id":"80348693.453638","type":"inject","z":"a5a73581.054de8","name":"mintarget","topic":"","payload":"minTargettemp","payloadType":"global","repeat":"2","crontab":"","once":true,"onceDelay":0.1,"x":130,"y":200,"wires":[["d9f3a6f4.772808"]]},{"id":"87d0f447.858f98","type":"change","z":"a5a73581.054de8","name":"minTargettemp","rules":[{"t":"set","p":"minTargettemp","pt":"global","to":"payload","tot":"msg"},{"t":"set","p":"payload","pt":"msg","to":"","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":200,"wires":[["8d97d9ce.61a4c8"]]},{"id":"26da2bbe.095034","type":"change","z":"a5a73581.054de8","name":"low","rules":[{"t":"set","p":"insideStatus","pt":"msg","to":"LOW","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":710,"y":500,"wires":[["ef919ea.9b3726"]]},{"id":"87e9dfd1.674d","type":"change","z":"a5a73581.054de8","name":"ok","rules":[{"t":"set","p":"insideStatus","pt":"msg","to":"OK","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":710,"y":560,"wires":[["ef919ea.9b3726"]]},{"id":"81e13fbd.fefb1","type":"change","z":"a5a73581.054de8","name":"high","rules":[{"t":"set","p":"insideStatus","pt":"msg","to":"HIGH","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":710,"y":620,"wires":[["ef919ea.9b3726"]]},{"id":"5c119931.016448","type":"change","z":"a5a73581.054de8","name":"maxTargettemp","rules":[{"t":"set","p":"maxTargettemp","pt":"global","to":"payload","tot":"msg"},{"t":"set","p":"payload","pt":"msg","to":"","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":160,"wires":[["e5325b15.3f1d48"]]},{"id":"406d2664.918018","type":"inject","z":"a5a73581.054de8","name":"maxTarget","topic":"","payload":"maxTargettemp","payloadType":"global","repeat":"2","crontab":"","once":true,"onceDelay":0.1,"x":130,"y":160,"wires":[["ced68327.57f07"]]},{"id":"ef919ea.9b3726","type":"change","z":"a5a73581.054de8","name":"","rules":[{"t":"set","p":"inTempStatus","pt":"global","to":"insideStatus","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1110,"y":420,"wires":[["df252ca9.98e16","8e85d420.b519c8"]]},{"id":"df252ca9.98e16","type":"template","z":"a5a73581.054de8","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"The IN temperature is {{insideStatus}} and equals to {{payload}} ","output":"str","x":1060,"y":480,"wires":[["4dc60ad1.15c3c4"]]},{"id":"f43e1241.aca98","type":"ui_toast","z":"a5a73581.054de8","position":"top right","displayTime":"3","highlight":"","outputs":0,"ok":"OK","cancel":"","topic":"INSIDE TEMPERATURE CHANGED","name":"","x":1390,"y":480,"wires":[]},{"id":"4dc60ad1.15c3c4","type":"rbe","z":"a5a73581.054de8","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":1210,"y":480,"wires":[["f43e1241.aca98"]]},{"id":"8d3e078b.08d498","type":"ui_text","z":"a5a73581.054de8","group":"914a70c9.6b0b","order":1,"width":0,"height":0,"name":"","label":"TEMPERATURA IN:","format":"{{msg.payload}}ÂșC  {{msg.insideStatus}}","layout":"col-center","x":1460,"y":420,"wires":[]},{"id":"d6ab6019.3fe7c","type":"switch","z":"a5a73581.054de8","name":"max&min switch","property":"payload","propertyType":"msg","rules":[{"t":"gt","v":"maxINrecTemp","vt":"global"},{"t":"lt","v":"minINrecTemp","vt":"global"}],"checkall":"true","repair":false,"outputs":2,"x":180,"y":340,"wires":[["dacc9d76.9d8b4"],["30674aec.586096"]]},{"id":"dacc9d76.9d8b4","type":"change","z":"a5a73581.054de8","name":"","rules":[{"t":"set","p":"maxINrecTemp","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":320,"wires":[["6de334c5.2094dc"]]},{"id":"30674aec.586096","type":"change","z":"a5a73581.054de8","name":"","rules":[{"t":"set","p":"minINrecTemp","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":360,"wires":[["296158a.2fe1fa8"]]},{"id":"1a69a63d.dc689a","type":"ui_button","z":"a5a73581.054de8","name":"","group":"185c8e21.2d6b42","order":7,"width":"0","height":"0","passthru":false,"label":"RESET max&min","color":"","bgcolor":"#FF0000","icon":"","payload":"inCurrentTemp","payloadType":"global","topic":"","x":170,"y":300,"wires":[["30674aec.586096","dacc9d76.9d8b4"]]},{"id":"79ff3914.549568","type":"ui_text","z":"a5a73581.054de8","group":"185c8e21.2d6b42","order":5,"width":0,"height":0,"name":"","label":"HIGHEST TEMP:","format":"{{msg.payload}}ÂșC     {{msg.time}}","layout":"row-spread","x":810,"y":320,"wires":[]},{"id":"35604e55.3982d2","type":"ui_text","z":"a5a73581.054de8","group":"185c8e21.2d6b42","order":6,"width":0,"height":0,"name":"","label":"LOWEST TEMP:","format":"{{msg.payload}}ÂșC     {{msg.time}}","layout":"row-spread","x":810,"y":360,"wires":[]},{"id":"d9f3a6f4.772808","type":"ui_text_input","z":"a5a73581.054de8","name":"","label":"Target MIN temp","group":"574f14fd.321a4c","order":3,"width":"3","height":"1","passthru":true,"mode":"number","delay":"30","topic":"","x":300,"y":200,"wires":[["87d0f447.858f98"]]},{"id":"ced68327.57f07","type":"ui_text_input","z":"a5a73581.054de8","name":"","label":"Target MAX temp","group":"574f14fd.321a4c","order":1,"width":"3","height":"1","passthru":true,"mode":"number","delay":"30","topic":"","x":310,"y":160,"wires":[["5c119931.016448"]]},{"id":"4088488d.872998","type":"comment","z":"a5a73581.054de8","name":"Set HYSTERESIS","info":"In order to recreate some HYSTERESIS my solution is\nto set MAX & MIN target temperatures, \nleaving a \"comfort zone\" between them to prevent oscillation.","x":110,"y":120,"wires":[]},{"id":"3b73181e.b27118","type":"comment","z":"a5a73581.054de8","name":"HIGHEST & LOWEST TEMPERATURES","info":"This part of the flow stores and displays in the UI\nthe HIGH and LOW temperatures as well as\nthe RESET button, when pressed sets both MAX & MIN\nas the current temperature.\n\nTO DO: \n-Log it propperly?","x":160,"y":260,"wires":[]},{"id":"f7e5aa0a.05f0a8","type":"comment","z":"a5a73581.054de8","name":"OUTSIDE TEMPERATURE INPUT","info":"","x":160,"y":740,"wires":[]},{"id":"3b3eb4dc.b7b3ec","type":"inject","z":"a5a73581.054de8","name":"","topic":"","payload":"outCurrentTemp","payloadType":"global","repeat":"2","crontab":"","once":true,"onceDelay":0.1,"x":170,"y":780,"wires":[["20358370.b39f8c"]]},{"id":"20358370.b39f8c","type":"switch","z":"a5a73581.054de8","name":"compare out current vs out limit","property":"payload","propertyType":"msg","rules":[{"t":"lt","v":"outLimitTemp","vt":"global"},{"t":"eq","v":"outLimitTemp","vt":"global"},{"t":"gt","v":"outLimitTemp","vt":"global"}],"checkall":"true","repair":false,"outputs":3,"x":510,"y":820,"wires":[["7ae223d7.f0513c"],["c4a296a7.39d7f8"],["dccb88d1.b21668"]]},{"id":"7ae223d7.f0513c","type":"change","z":"a5a73581.054de8","name":"LOW","rules":[{"t":"set","p":"outsideStatus","pt":"msg","to":"LOW","tot":"str"},{"t":"set","p":"outTempStatus","pt":"global","to":"LOW","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":730,"y":760,"wires":[["d39906b3.8124e8","e2e077c2.beae38","3a021925.03cd06"]]},{"id":"c4a296a7.39d7f8","type":"change","z":"a5a73581.054de8","name":"LIMIT REACHED","rules":[{"t":"set","p":"outsideStatus","pt":"msg","to":"LIMIT REACHED","tot":"str"},{"t":"set","p":"outTempStatus","pt":"global","to":"LIMIT REACHED","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":770,"y":820,"wires":[["d39906b3.8124e8","e2e077c2.beae38","3a021925.03cd06"]]},{"id":"dccb88d1.b21668","type":"change","z":"a5a73581.054de8","name":"HELL MODE","rules":[{"t":"set","p":"outsideStatus","pt":"msg","to":"HELL MODE","tot":"str"},{"t":"set","p":"outTempStatus","pt":"global","to":"HELL MODE","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":750,"y":880,"wires":[["d39906b3.8124e8","e2e077c2.beae38","3a021925.03cd06"]]},{"id":"d39906b3.8124e8","type":"change","z":"a5a73581.054de8","name":"Current OUT made global","rules":[{"t":"set","p":"outCurrentTemp","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1050,"y":800,"wires":[[]]},{"id":"ab54e0cd.c38c1","type":"change","z":"a5a73581.054de8","name":"out limit temp made global","rules":[{"t":"set","p":"outLimitTemp","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":610,"y":60,"wires":[["f4d887b1.7f6f88"]]},{"id":"57dec835.e186a8","type":"inject","z":"a5a73581.054de8","name":"","topic":"","payload":"outLimitTemp","payloadType":"global","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":210,"y":60,"wires":[["73eed587.cda84c"]]},{"id":"1f9e9eb0.d68fa1","type":"ui_switch","z":"a5a73581.054de8","name":"","label":"extractor","group":"185c8e21.2d6b42","order":8,"width":0,"height":0,"passthru":false,"decouple":"true","topic":"","style":"","onvalue":"1","onvalueType":"num","onicon":"","oncolor":"","offvalue":"0","offvalueType":"num","officon":"","offcolor":"","x":1920,"y":680,"wires":[[]]},{"id":"fade8ab5.865f38","type":"ui_switch","z":"a5a73581.054de8","name":"","label":"intractor","group":"185c8e21.2d6b42","order":9,"width":0,"height":0,"passthru":false,"decouple":"true","topic":"","style":"","onvalue":"1","onvalueType":"num","onicon":"","oncolor":"","offvalue":"0","offvalueType":"num","officon":"","offcolor":"","x":1920,"y":720,"wires":[[]]},{"id":"7a1c0b06.250124","type":"ui_switch","z":"a5a73581.054de8","name":"","label":"aircon","group":"185c8e21.2d6b42","order":10,"width":0,"height":0,"passthru":false,"decouple":"true","topic":"","style":"","onvalue":"1","onvalueType":"num","onicon":"","oncolor":"","offvalue":"0","offvalueType":"num","officon":"","offcolor":"","x":1910,"y":760,"wires":[[]]},{"id":"c004ca01.283ea8","type":"comment","z":"a5a73581.054de8","name":"Set OUT LIMIT TEMPERATURE","info":"The max outside temperature acceptable.\nHigher values mean that we can't get to \nthe target temperature by air exchange.\nIf outside temp raises above this point,\nHELL MODE will turn on:\nturning OFF the intractor, ON the AC, \nand after some minutes, turn OFF the extractor","x":170,"y":20,"wires":[]},{"id":"f81862e9.90f52","type":"comment","z":"a5a73581.054de8","name":"TO DO....","info":"WORK IN PROGRESS....","x":80,"y":1400,"wires":[]},{"id":"9b3867d8.2cb508","type":"comment","z":"a5a73581.054de8","name":"Dummies","info":"Theese are the representation of \nwhat we want to trigger with our thermostat.... \nBy the momment...(until we add humidity control, \nbut let's make it work first XD )","x":1920,"y":640,"wires":[]},{"id":"c5044936.9bdd38","type":"comment","z":"a5a73581.054de8","name":"INSIDE TEMPERATURE INPUT","info":"","x":130,"y":520,"wires":[]},{"id":"fff9761c.210468","type":"comment","z":"a5a73581.054de8","name":"WORK IN PROGRESS OVER HERE...","info":"","x":990,"y":720,"wires":[]},{"id":"60d7aa0a.552cb4","type":"comment","z":"a5a73581.054de8","name":"WORK IN PROGRESS OVER HERE...","info":"","x":1030,"y":580,"wires":[]},{"id":"fd6529ce.ff6b68","type":"comment","z":"a5a73581.054de8","name":"WORK IN PROGRESS OVER HERE...","info":"","x":1390,"y":560,"wires":[]},{"id":"e5325b15.3f1d48","type":"ui_text","z":"a5a73581.054de8","group":"574f14fd.321a4c","order":2,"width":"2","height":"1","name":"","label":"SET MAX:","format":"{{msg.payload}}ÂșC","layout":"row-left","x":710,"y":160,"wires":[]},{"id":"8d97d9ce.61a4c8","type":"ui_text","z":"a5a73581.054de8","group":"574f14fd.321a4c","order":4,"width":"2","height":"1","name":"","label":"SET MIN:","format":"{{msg.payload}}ÂșC","layout":"row-left","x":720,"y":200,"wires":[]},{"id":"b77e91bb.e616b","type":"inject","z":"a5a73581.054de8","name":"","topic":"","payload":"outCurrentTemp","payloadType":"global","repeat":"2","crontab":"","once":true,"onceDelay":0.1,"x":130,"y":1060,"wires":[["f2005c8d.ebce3"]]},{"id":"f2005c8d.ebce3","type":"ui_text_input","z":"a5a73581.054de8","name":"","label":"OUTSIDE TEMP DUMMY","group":"4460014f.62417","order":3,"width":"3","height":"1","passthru":true,"mode":"number","delay":"30","topic":"","x":370,"y":1060,"wires":[["85f47ead.2dca4"]]},{"id":"85f47ead.2dca4","type":"change","z":"a5a73581.054de8","name":"global out current","rules":[{"t":"set","p":"outCurrentTemp","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":1060,"wires":[["2d2042a8.ce740e"]]},{"id":"2d2042a8.ce740e","type":"ui_text","z":"a5a73581.054de8","group":"4460014f.62417","order":4,"width":"2","height":"1","name":"","label":"current out:","format":"{{msg.payload}}ÂșC","layout":"row-left","x":790,"y":1060,"wires":[]},{"id":"ab0dc2d5.48282","type":"comment","z":"a5a73581.054de8","name":"UI TEMPERATURE SIMULATOR","info":"","x":150,"y":1000,"wires":[]},{"id":"73eed587.cda84c","type":"ui_text_input","z":"a5a73581.054de8","name":"","label":"OUT LIMIT","group":"574f14fd.321a4c","order":5,"width":"3","height":"1","passthru":true,"mode":"number","delay":"30","topic":"","x":390,"y":60,"wires":[["ab54e0cd.c38c1"]]},{"id":"f4d887b1.7f6f88","type":"ui_text","z":"a5a73581.054de8","group":"574f14fd.321a4c","order":6,"width":"2","height":"1","name":"","label":"SET:","format":"{{msg.payload}}ÂșC","layout":"row-left","x":810,"y":60,"wires":[]},{"id":"32d91d62.7002b2","type":"comment","z":"a5a73581.054de8","name":"STATUS UI TAB","info":"","x":1140,"y":380,"wires":[]},{"id":"e2e077c2.beae38","type":"ui_text","z":"a5a73581.054de8","group":"914a70c9.6b0b","order":1,"width":0,"height":0,"name":"","label":"TEMPERATURA OUT:","format":"{{msg.payload}}ÂșC  {{msg.outsideStatus}}","layout":"col-center","x":1040,"y":960,"wires":[]},{"id":"3a021925.03cd06","type":"template","z":"a5a73581.054de8","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"The OUT temperature is {{outsideStatus}} and equals to {{payload}} ","output":"str","x":1000,"y":920,"wires":[["b5e900c9.9319b"]]},{"id":"cc71729f.5a1a1","type":"ui_toast","z":"a5a73581.054de8","position":"top right","displayTime":"3","highlight":"","outputs":0,"ok":"OK","cancel":"","topic":"OUTSIDE TEMPERATURE CHANGED","name":"","x":1300,"y":920,"wires":[]},{"id":"b5e900c9.9319b","type":"rbe","z":"a5a73581.054de8","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":1150,"y":920,"wires":[["cc71729f.5a1a1"]]},{"id":"62c44f31.09fb4","type":"inject","z":"a5a73581.054de8","name":"","topic":"","payload":"inCurrentTemp","payloadType":"global","repeat":"2","crontab":"","once":true,"onceDelay":0.1,"x":120,"y":1120,"wires":[["75e6dca7.e5d734"]]},{"id":"75e6dca7.e5d734","type":"ui_text_input","z":"a5a73581.054de8","name":"","label":"INSIDE TEMP DUMMY","group":"4460014f.62417","order":1,"width":"3","height":"1","passthru":true,"mode":"number","delay":"30","topic":"","x":370,"y":1120,"wires":[["d6a5a88d.de1b18"]]},{"id":"d6a5a88d.de1b18","type":"change","z":"a5a73581.054de8","name":"global out current","rules":[{"t":"set","p":"inCurrentTemp","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":1120,"wires":[["26857f5a.41816"]]},{"id":"26857f5a.41816","type":"ui_text","z":"a5a73581.054de8","group":"4460014f.62417","order":2,"width":"2","height":"1","name":"","label":"current in:","format":"{{msg.payload}}ÂșC","layout":"row-left","x":780,"y":1120,"wires":[]},{"id":"d5068ee5.8b84e","type":"inject","z":"a5a73581.054de8","name":"","topic":"","payload":"inCurrentTemp","payloadType":"global","repeat":"2","crontab":"","once":true,"onceDelay":0.1,"x":100,"y":480,"wires":[["a346eee7.ced05","d6ab6019.3fe7c"]]},{"id":"8e85d420.b519c8","type":"rbe","z":"a5a73581.054de8","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":1290,"y":420,"wires":[["8d3e078b.08d498"]]},{"id":"bb308989.4f2e38","type":"comment","z":"a5a73581.054de8","name":"STATUS UI TAB","info":"","x":1020,"y":880,"wires":[]},{"id":"6de334c5.2094dc","type":"function","z":"a5a73581.054de8","name":"Add time","func":"function padLeft(nr, str){\nreturn Array(2-String(nr).length+1).join(str||'0')+nr;\n}\nvar d = new Date();\n\nmsg.time = padLeft(d.getDate()) + \"/\" + padLeft(d.getMonth()) + \" \" + padLeft(d.getHours()) + \":\" + padLeft(d.getMinutes()) + \":\" + padLeft(d.getSeconds());\n\nreturn msg;","outputs":1,"noerr":0,"x":620,"y":320,"wires":[["79ff3914.549568"]]},{"id":"296158a.2fe1fa8","type":"function","z":"a5a73581.054de8","name":"Add time","func":"function padLeft(nr, str){\nreturn Array(2-String(nr).length+1).join(str||'0')+nr;\n}\nvar d = new Date();\n\nmsg.time = padLeft(d.getDate()) + \"/\" + padLeft(d.getMonth()) + \" \" + padLeft(d.getHours()) + \":\" + padLeft(d.getMinutes()) + \":\" + padLeft(d.getSeconds());\n\nreturn msg;","outputs":1,"noerr":0,"x":620,"y":360,"wires":[["35604e55.3982d2"]]},{"id":"87de71eb.4a609","type":"mqtt-broker","z":"","name":"mosquitto","broker":"192.168.1.200","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"MQTTinfo/mosquitto","birthQos":"2","birthPayload":"Mosquitto is up and runnig!!!","willTopic":"MQTTinfo/mosquitto","willQos":"2","willPayload":"Mosquitto is down!!!!"},{"id":"914a70c9.6b0b","type":"ui_group","z":"","name":"TEMPERATURE STATUS","tab":"fb9e7d3d.87629","order":5,"disp":true,"width":"6","collapse":false},{"id":"185c8e21.2d6b42","type":"ui_group","z":"","name":"CLIMA","tab":"fb9e7d3d.87629","disp":true,"width":"6","collapse":false},{"id":"574f14fd.321a4c","type":"ui_group","z":"","name":"CLIMA vars","tab":"fb9e7d3d.87629","disp":true,"width":"6","collapse":false},{"id":"4460014f.62417","type":"ui_group","z":"","name":"SENSOR SIMULATOR","tab":"fb9e7d3d.87629","order":4,"disp":true,"width":"6","collapse":false},{"id":"fb9e7d3d.87629","type":"ui_tab","z":"","name":"DEV","icon":"dashboard"}]
``

UPDATE: Seems like I’m on the right path
but any help would be appreciated.

[{"id":"a5a73581.054de8","type":"tab","label":"DIY thermostat","disabled":false,"info":""},{"id":"d2d67575.2331b8","type":"mqtt in","z":"a5a73581.054de8","name":"TEMPin","topic":"clima/THin/temperature","qos":"2","broker":"87de71eb.4a609","x":70,"y":720,"wires":[[]]},{"id":"93e7988e.5ca618","type":"mqtt in","z":"a5a73581.054de8","name":"HUMIDITY in","topic":"clima/THin/humidity","qos":"2","broker":"87de71eb.4a609","x":130,"y":2000,"wires":[[]]},{"id":"c01839cf.3c67a8","type":"switch","z":"a5a73581.054de8","name":"compare IN current vs target","property":"payload","propertyType":"msg","rules":[{"t":"lt","v":"minTargettemp","vt":"global"},{"t":"btwn","v":"minTargettemp","vt":"global","v2":"maxTargettemp","v2t":"global"},{"t":"gt","v":"maxTargettemp","vt":"global"}],"checkall":"true","repair":false,"outputs":3,"x":520,"y":700,"wires":[["26da2bbe.095034"],["87e9dfd1.674d"],["81e13fbd.fefb1"]]},{"id":"a346eee7.ced05","type":"change","z":"a5a73581.054de8","name":"Make global and beautiful","rules":[{"t":"set","p":"inCurrentTemp","pt":"global","to":"payload","tot":"msg"},{"t":"set","p":"currentIN","pt":"msg","to":"payload","tot":"msg"},{"t":"set","p":"currentOUT","pt":"msg","to":"outCurrentTemp","tot":"global"}],"action":"","property":"","from":"","to":"","reg":false,"x":270,"y":700,"wires":[["c01839cf.3c67a8"]]},{"id":"80348693.453638","type":"inject","z":"a5a73581.054de8","name":"mintarget","topic":"","payload":"minTargettemp","payloadType":"global","repeat":"2","crontab":"","once":true,"onceDelay":0.1,"x":130,"y":340,"wires":[["d9f3a6f4.772808"]]},{"id":"87d0f447.858f98","type":"change","z":"a5a73581.054de8","name":"minTargettemp","rules":[{"t":"set","p":"minTargettemp","pt":"global","to":"payload","tot":"msg"},{"t":"set","p":"payload","pt":"msg","to":"","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":340,"wires":[["8d97d9ce.61a4c8"]]},{"id":"26da2bbe.095034","type":"change","z":"a5a73581.054de8","name":"low","rules":[{"t":"set","p":"insideStatus","pt":"msg","to":"LOW","tot":"str"},{"t":"set","p":"outsideStatus","pt":"msg","to":"outTempStatus","tot":"global"}],"action":"","property":"","from":"","to":"","reg":false,"x":710,"y":640,"wires":[["ef919ea.9b3726","5bd3f79d.68da88"]]},{"id":"87e9dfd1.674d","type":"change","z":"a5a73581.054de8","name":"ok","rules":[{"t":"set","p":"insideStatus","pt":"msg","to":"OK","tot":"str"},{"t":"set","p":"outsideStatus","pt":"msg","to":"outTempStatus","tot":"global"}],"action":"","property":"","from":"","to":"","reg":false,"x":710,"y":700,"wires":[["ef919ea.9b3726","cae28e7a.151c7"]]},{"id":"81e13fbd.fefb1","type":"change","z":"a5a73581.054de8","name":"high","rules":[{"t":"set","p":"insideStatus","pt":"msg","to":"HIGH","tot":"str"},{"t":"set","p":"outsideStatus","pt":"msg","to":"outTempStatus","tot":"global"}],"action":"","property":"","from":"","to":"","reg":false,"x":710,"y":760,"wires":[["ef919ea.9b3726","a0091b9c.164c48"]]},{"id":"5c119931.016448","type":"change","z":"a5a73581.054de8","name":"maxTargettemp","rules":[{"t":"set","p":"maxTargettemp","pt":"global","to":"payload","tot":"msg"},{"t":"set","p":"payload","pt":"msg","to":"","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":500,"y":300,"wires":[["e5325b15.3f1d48"]]},{"id":"406d2664.918018","type":"inject","z":"a5a73581.054de8","name":"maxTarget","topic":"","payload":"maxTargettemp","payloadType":"global","repeat":"2","crontab":"","once":true,"onceDelay":0.1,"x":130,"y":300,"wires":[["ced68327.57f07"]]},{"id":"ef919ea.9b3726","type":"change","z":"a5a73581.054de8","name":"","rules":[{"t":"set","p":"inTempStatus","pt":"global","to":"insideStatus","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":530,"y":900,"wires":[["df252ca9.98e16","8e85d420.b519c8"]]},{"id":"df252ca9.98e16","type":"template","z":"a5a73581.054de8","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"The IN temperature is {{insideStatus}} and equals to {{payload}} ","output":"str","x":480,"y":960,"wires":[["4dc60ad1.15c3c4"]]},{"id":"f43e1241.aca98","type":"ui_toast","z":"a5a73581.054de8","position":"top right","displayTime":"3","highlight":"","outputs":0,"ok":"OK","cancel":"","topic":"INSIDE TEMPERATURE CHANGED","name":"","x":810,"y":960,"wires":[]},{"id":"4dc60ad1.15c3c4","type":"rbe","z":"a5a73581.054de8","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":630,"y":960,"wires":[["f43e1241.aca98"]]},{"id":"8d3e078b.08d498","type":"ui_text","z":"a5a73581.054de8","group":"914a70c9.6b0b","order":1,"width":0,"height":0,"name":"","label":"TEMPERATURA IN:","format":"{{msg.payload}}ÂșC  {{msg.insideStatus}}","layout":"col-center","x":880,"y":900,"wires":[]},{"id":"d6ab6019.3fe7c","type":"switch","z":"a5a73581.054de8","name":"max&min switch","property":"payload","propertyType":"msg","rules":[{"t":"gt","v":"maxINrecTemp","vt":"global"},{"t":"lt","v":"minINrecTemp","vt":"global"}],"checkall":"false","repair":false,"outputs":2,"x":120,"y":480,"wires":[["dacc9d76.9d8b4"],["30674aec.586096"]]},{"id":"dacc9d76.9d8b4","type":"change","z":"a5a73581.054de8","name":"","rules":[{"t":"set","p":"maxINrecTemp","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":460,"wires":[["6de334c5.2094dc"]]},{"id":"30674aec.586096","type":"change","z":"a5a73581.054de8","name":"","rules":[{"t":"set","p":"minINrecTemp","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":500,"wires":[["db9de42b.825ad8"]]},{"id":"1a69a63d.dc689a","type":"ui_button","z":"a5a73581.054de8","name":"","group":"185c8e21.2d6b42","order":7,"width":"0","height":"0","passthru":false,"label":"RESET max&min","color":"","bgcolor":"#FF0000","icon":"","payload":"inCurrentTemp","payloadType":"global","topic":"","x":130,"y":440,"wires":[["30674aec.586096","dacc9d76.9d8b4"]]},{"id":"79ff3914.549568","type":"ui_text","z":"a5a73581.054de8","group":"185c8e21.2d6b42","order":5,"width":0,"height":0,"name":"","label":"HIGHEST TEMP:","format":"{{msg.payload}}ÂșC     {{msg.time}}","layout":"row-spread","x":770,"y":460,"wires":[]},{"id":"35604e55.3982d2","type":"ui_text","z":"a5a73581.054de8","group":"185c8e21.2d6b42","order":6,"width":0,"height":0,"name":"","label":"LOWEST TEMP:","format":"{{msg.payload}}ÂșC     {{msg.time}}","layout":"row-spread","x":770,"y":500,"wires":[]},{"id":"d9f3a6f4.772808","type":"ui_text_input","z":"a5a73581.054de8","name":"","label":"Target MIN temp","group":"574f14fd.321a4c","order":3,"width":"3","height":"1","passthru":true,"mode":"number","delay":"30","topic":"","x":300,"y":340,"wires":[["87d0f447.858f98"]]},{"id":"ced68327.57f07","type":"ui_text_input","z":"a5a73581.054de8","name":"","label":"Target MAX temp","group":"574f14fd.321a4c","order":1,"width":"3","height":"1","passthru":true,"mode":"number","delay":"30","topic":"","x":310,"y":300,"wires":[["5c119931.016448"]]},{"id":"4088488d.872998","type":"comment","z":"a5a73581.054de8","name":"Set HYSTERESIS","info":"In order to recreate some HYSTERESIS my solution is\nto set MAX & MIN target temperatures, \nleaving a \"comfort zone\" between them to prevent oscillation.","x":110,"y":260,"wires":[]},{"id":"3b73181e.b27118","type":"comment","z":"a5a73581.054de8","name":"HIGHEST & LOWEST TEMPERATURES","info":"This part of the flow stores and displays in the UI\nthe HIGH and LOW temperatures as well as\nthe RESET button, when pressed sets both MAX & MIN\nas the current temperature.\n\nTO DO: \n-Log it propperly?","x":160,"y":400,"wires":[]},{"id":"f7e5aa0a.05f0a8","type":"comment","z":"a5a73581.054de8","name":"OUTSIDE TEMPERATURE INPUT","info":"","x":160,"y":1020,"wires":[]},{"id":"3b3eb4dc.b7b3ec","type":"inject","z":"a5a73581.054de8","name":"","topic":"","payload":"outCurrentTempDummy","payloadType":"global","repeat":"2","crontab":"","once":true,"onceDelay":0.1,"x":90,"y":1080,"wires":[["d39906b3.8124e8"]]},{"id":"20358370.b39f8c","type":"switch","z":"a5a73581.054de8","name":"compare out current vs out limit","property":"payload","propertyType":"msg","rules":[{"t":"lt","v":"outLimitTemp","vt":"global"},{"t":"eq","v":"outLimitTemp","vt":"global"},{"t":"gt","v":"outLimitTemp","vt":"global"}],"checkall":"true","repair":false,"outputs":3,"x":530,"y":1140,"wires":[["7ae223d7.f0513c"],["c4a296a7.39d7f8"],["dccb88d1.b21668"]]},{"id":"7ae223d7.f0513c","type":"change","z":"a5a73581.054de8","name":"LOW","rules":[{"t":"set","p":"outsideStatus","pt":"msg","to":"LOW","tot":"str"},{"t":"set","p":"outTempStatus","pt":"global","to":"LOW","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":750,"y":1080,"wires":[["e2e077c2.beae38","3a021925.03cd06"]]},{"id":"c4a296a7.39d7f8","type":"change","z":"a5a73581.054de8","name":"LIMIT REACHED","rules":[{"t":"set","p":"outsideStatus","pt":"msg","to":"LIMIT REACHED","tot":"str"},{"t":"set","p":"outTempStatus","pt":"global","to":"LIMIT REACHED","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":790,"y":1140,"wires":[["e2e077c2.beae38","3a021925.03cd06"]]},{"id":"dccb88d1.b21668","type":"change","z":"a5a73581.054de8","name":"HELL MODE","rules":[{"t":"set","p":"outsideStatus","pt":"msg","to":"HELL MODE","tot":"str"},{"t":"set","p":"outTempStatus","pt":"global","to":"HELL MODE","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":770,"y":1200,"wires":[["e2e077c2.beae38","3a021925.03cd06"]]},{"id":"d39906b3.8124e8","type":"change","z":"a5a73581.054de8","name":"Current OUT made global","rules":[{"t":"set","p":"outCurrentTemp","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":250,"y":1140,"wires":[["20358370.b39f8c"]]},{"id":"ab54e0cd.c38c1","type":"change","z":"a5a73581.054de8","name":"out limit temp made global","rules":[{"t":"set","p":"outLimitTemp","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":610,"y":200,"wires":[["f4d887b1.7f6f88"]]},{"id":"57dec835.e186a8","type":"inject","z":"a5a73581.054de8","name":"","topic":"","payload":"outLimitTemp","payloadType":"global","repeat":"3","crontab":"","once":true,"onceDelay":0.1,"x":160,"y":200,"wires":[["73eed587.cda84c"]]},{"id":"1f9e9eb0.d68fa1","type":"ui_switch","z":"a5a73581.054de8","name":"","label":"extractor","group":"df6763f0.0932d","order":1,"width":0,"height":0,"passthru":false,"decouple":"true","topic":"","style":"","onvalue":"1","onvalueType":"str","onicon":"","oncolor":"","offvalue":"0","offvalueType":"str","officon":"","offcolor":"","x":1900,"y":500,"wires":[[]]},{"id":"fade8ab5.865f38","type":"ui_switch","z":"a5a73581.054de8","name":"","label":"intractor","group":"df6763f0.0932d","order":2,"width":0,"height":0,"passthru":false,"decouple":"true","topic":"","style":"","onvalue":"1","onvalueType":"str","onicon":"","oncolor":"","offvalue":"0","offvalueType":"str","officon":"","offcolor":"","x":1900,"y":560,"wires":[[]]},{"id":"7a1c0b06.250124","type":"ui_switch","z":"a5a73581.054de8","name":"","label":"aircon","group":"df6763f0.0932d","order":3,"width":0,"height":0,"passthru":false,"decouple":"true","topic":"","style":"","onvalue":"1","onvalueType":"str","onicon":"","oncolor":"","offvalue":"0","offvalueType":"str","officon":"","offcolor":"","x":1890,"y":640,"wires":[[]]},{"id":"c004ca01.283ea8","type":"comment","z":"a5a73581.054de8","name":"Set OUT LIMIT TEMPERATURE","info":"The max outside temperature acceptable.\nHigher values mean that we can't get to \nthe target temperature by air exchange.\nIf outside temp raises above this point,\nHELL MODE will turn on:\nturning OFF the intractor, ON the AC, \nand after some minutes, turn OFF the extractor","x":170,"y":160,"wires":[]},{"id":"f81862e9.90f52","type":"comment","z":"a5a73581.054de8","name":"TO DO....","info":"WORK IN PROGRESS....","x":120,"y":1960,"wires":[]},{"id":"9b3867d8.2cb508","type":"comment","z":"a5a73581.054de8","name":"OUTPUTS","info":"Theese are the representation of \nwhat we want to trigger with our thermostat.... \nBy the momment...(until we add humidity control, \nbut let's make it work first XD )","x":1920,"y":440,"wires":[]},{"id":"c5044936.9bdd38","type":"comment","z":"a5a73581.054de8","name":"INSIDE TEMPERATURE INPUT","info":"","x":130,"y":660,"wires":[]},{"id":"fff9761c.210468","type":"comment","z":"a5a73581.054de8","name":"WORK IN PROGRESS OVER HERE...","info":"","x":1550,"y":1180,"wires":[]},{"id":"60d7aa0a.552cb4","type":"comment","z":"a5a73581.054de8","name":"WORK IN PROGRESS OVER HERE...","info":"","x":1850,"y":880,"wires":[]},{"id":"fd6529ce.ff6b68","type":"comment","z":"a5a73581.054de8","name":"WHEN AC IS ENABLED: (WORK IN PROGRESS)","info":"","x":1550,"y":740,"wires":[]},{"id":"e5325b15.3f1d48","type":"ui_text","z":"a5a73581.054de8","group":"574f14fd.321a4c","order":2,"width":"2","height":"1","name":"","label":"SET MAX:","format":"{{msg.payload}}ÂșC","layout":"row-left","x":710,"y":300,"wires":[]},{"id":"8d97d9ce.61a4c8","type":"ui_text","z":"a5a73581.054de8","group":"574f14fd.321a4c","order":4,"width":"2","height":"1","name":"","label":"SET MIN:","format":"{{msg.payload}}ÂșC","layout":"row-left","x":720,"y":340,"wires":[]},{"id":"b77e91bb.e616b","type":"inject","z":"a5a73581.054de8","name":"","topic":"","payload":"outCurrentTempDummy","payloadType":"global","repeat":"2","crontab":"","once":true,"onceDelay":0.1,"x":110,"y":1460,"wires":[["f2005c8d.ebce3"]]},{"id":"f2005c8d.ebce3","type":"ui_text_input","z":"a5a73581.054de8","name":"","label":"OUTSIDE TEMP DUMMY","group":"4460014f.62417","order":3,"width":"3","height":"1","passthru":true,"mode":"number","delay":"30","topic":"","x":410,"y":1460,"wires":[["85f47ead.2dca4"]]},{"id":"85f47ead.2dca4","type":"change","z":"a5a73581.054de8","name":"global out current","rules":[{"t":"set","p":"outCurrentTempDummy","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":630,"y":1460,"wires":[["2d2042a8.ce740e"]]},{"id":"2d2042a8.ce740e","type":"ui_text","z":"a5a73581.054de8","group":"4460014f.62417","order":4,"width":"2","height":"1","name":"","label":"current out:","format":"{{msg.payload}}ÂșC","layout":"row-left","x":830,"y":1460,"wires":[]},{"id":"ab0dc2d5.48282","type":"comment","z":"a5a73581.054de8","name":"UI TEMPERATURE SIMULATOR","info":"","x":190,"y":1400,"wires":[]},{"id":"73eed587.cda84c","type":"ui_text_input","z":"a5a73581.054de8","name":"","label":"OUT LIMIT","group":"574f14fd.321a4c","order":5,"width":"3","height":"1","passthru":true,"mode":"number","delay":"30","topic":"","x":390,"y":200,"wires":[["ab54e0cd.c38c1"]]},{"id":"f4d887b1.7f6f88","type":"ui_text","z":"a5a73581.054de8","group":"574f14fd.321a4c","order":6,"width":"2","height":"1","name":"","label":"SET:","format":"{{msg.payload}}ÂșC","layout":"row-left","x":810,"y":200,"wires":[]},{"id":"32d91d62.7002b2","type":"comment","z":"a5a73581.054de8","name":"INSIDE STATUS UI TAB","info":"","x":590,"y":860,"wires":[]},{"id":"e2e077c2.beae38","type":"ui_text","z":"a5a73581.054de8","group":"914a70c9.6b0b","order":1,"width":0,"height":0,"name":"","label":"TEMPERATURA OUT:","format":"{{msg.payload}}ÂșC  {{msg.outsideStatus}}","layout":"col-center","x":560,"y":1340,"wires":[]},{"id":"3a021925.03cd06","type":"template","z":"a5a73581.054de8","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"The OUT temperature is {{outsideStatus}} and equals to {{payload}} ","output":"str","x":520,"y":1300,"wires":[["b5e900c9.9319b"]]},{"id":"cc71729f.5a1a1","type":"ui_toast","z":"a5a73581.054de8","position":"top right","displayTime":"3","highlight":"","outputs":0,"ok":"OK","cancel":"","topic":"OUTSIDE TEMPERATURE CHANGED","name":"","x":820,"y":1300,"wires":[]},{"id":"b5e900c9.9319b","type":"rbe","z":"a5a73581.054de8","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":670,"y":1300,"wires":[["cc71729f.5a1a1"]]},{"id":"62c44f31.09fb4","type":"inject","z":"a5a73581.054de8","name":"","topic":"","payload":"inCurrentTempDummy","payloadType":"global","repeat":"2","crontab":"","once":true,"onceDelay":0.1,"x":110,"y":1520,"wires":[["75e6dca7.e5d734"]]},{"id":"75e6dca7.e5d734","type":"ui_text_input","z":"a5a73581.054de8","name":"","label":"INSIDE TEMP DUMMY","group":"4460014f.62417","order":1,"width":"3","height":"1","passthru":true,"mode":"number","delay":"30","topic":"","x":410,"y":1520,"wires":[["d6a5a88d.de1b18"]]},{"id":"d6a5a88d.de1b18","type":"change","z":"a5a73581.054de8","name":"global out current","rules":[{"t":"set","p":"inCurrentTempDummy","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":630,"y":1520,"wires":[["26857f5a.41816"]]},{"id":"26857f5a.41816","type":"ui_text","z":"a5a73581.054de8","group":"4460014f.62417","order":2,"width":"2","height":"1","name":"","label":"current in:","format":"{{msg.payload}}ÂșC","layout":"row-left","x":820,"y":1520,"wires":[]},{"id":"d5068ee5.8b84e","type":"inject","z":"a5a73581.054de8","name":"","topic":"","payload":"inCurrentTempDummy","payloadType":"global","repeat":"2","crontab":"","once":true,"onceDelay":"1","x":50,"y":620,"wires":[["a346eee7.ced05","d6ab6019.3fe7c"]]},{"id":"8e85d420.b519c8","type":"rbe","z":"a5a73581.054de8","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":710,"y":900,"wires":[["8d3e078b.08d498"]]},{"id":"bb308989.4f2e38","type":"comment","z":"a5a73581.054de8","name":"OUTSIDE STATUS UI TAB","info":"","x":570,"y":1260,"wires":[]},{"id":"6de334c5.2094dc","type":"function","z":"a5a73581.054de8","name":"Add time","func":"function padLeft(nr, str){\nreturn Array(2-String(nr).length+1).join(str||'0')+nr;\n}\nvar d = new Date();\n\nmsg.time = padLeft(d.getDate()) + \"/\" + padLeft(d.getMonth()+1) + \" \" + padLeft(d.getHours()) + \":\" + padLeft(d.getMinutes()) + \":\" + padLeft(d.getSeconds());\n\nreturn msg;","outputs":1,"noerr":0,"x":580,"y":460,"wires":[["79ff3914.549568"]]},{"id":"a4235ca3.28daf","type":"switch","z":"a5a73581.054de8","name":"check outside status","property":"outTempStatus","propertyType":"global","rules":[{"t":"eq","v":"LOW","vt":"str"},{"t":"eq","v":"LIMIT REACHED","vt":"str"},{"t":"eq","v":"HELL MODE","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":1380,"y":1040,"wires":[["c6794649.29f278"],["6e62b9af.bf7988"],["3750e477.d06a1c"]],"outputLabels":["LOW","LIMIT REACHED","HELL MODE"]},{"id":"87ef58ce.06d8e8","type":"switch","z":"a5a73581.054de8","name":"check outside status","property":"outTempStatus","propertyType":"global","rules":[{"t":"eq","v":"LOW","vt":"str"},{"t":"eq","v":"LIMIT REACHED","vt":"str"},{"t":"eq","v":"HELL MODE","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":1380,"y":940,"wires":[["46c8b8c5.0f8e58"],["ab9621b0.1cef"],["f4fefd66.21862"]],"outputLabels":["LOW","LIMIT REACHED","HELL MODE"]},{"id":"ef418566.ee5ec8","type":"switch","z":"a5a73581.054de8","name":"check outside status","property":"outTempStatus","propertyType":"global","rules":[{"t":"eq","v":"LOW","vt":"str"},{"t":"eq","v":"LIMIT REACHED","vt":"str"},{"t":"eq","v":"HELL MODE","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":1380,"y":840,"wires":[["9f749ef7.1e3cf"],["3557e39b.edae8c"],["deff48b.85ffbb8"]],"outputLabels":["LOW","LIMIT REACHED","HELL MODE"]},{"id":"c6794649.29f278","type":"debug","z":"a5a73581.054de8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1610,"y":1060,"wires":[]},{"id":"46c8b8c5.0f8e58","type":"debug","z":"a5a73581.054de8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1610,"y":920,"wires":[]},{"id":"ab9621b0.1cef","type":"debug","z":"a5a73581.054de8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1610,"y":960,"wires":[]},{"id":"3557e39b.edae8c","type":"debug","z":"a5a73581.054de8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1610,"y":820,"wires":[]},{"id":"9f749ef7.1e3cf","type":"debug","z":"a5a73581.054de8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1610,"y":780,"wires":[]},{"id":"f4fefd66.21862","type":"debug","z":"a5a73581.054de8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1610,"y":1000,"wires":[]},{"id":"6e62b9af.bf7988","type":"debug","z":"a5a73581.054de8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1610,"y":1100,"wires":[]},{"id":"3750e477.d06a1c","type":"debug","z":"a5a73581.054de8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1610,"y":1140,"wires":[]},{"id":"deff48b.85ffbb8","type":"debug","z":"a5a73581.054de8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1610,"y":860,"wires":[]},{"id":"e0e5fdf3.a292c","type":"ui_switch","z":"a5a73581.054de8","name":"","label":"Use Air Conditioner","group":"574f14fd.321a4c","order":0,"width":"4","height":"1","passthru":true,"decouple":"false","topic":"","style":"","onvalue":"yes","onvalueType":"str","onicon":"","oncolor":"","offvalue":"no","offvalueType":"str","officon":"","offcolor":"","x":1290,"y":220,"wires":[["90e0ba16.c3fe58"]]},{"id":"467eb2c2.df878c","type":"change","z":"a5a73581.054de8","name":"","rules":[{"t":"set","p":"useAC","pt":"global","to":"no","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1330,"y":140,"wires":[["e0e5fdf3.a292c","17edef6f.9c1d21"]]},{"id":"37791d3d.327c72","type":"change","z":"a5a73581.054de8","name":"","rules":[{"t":"set","p":"useAC","pt":"global","to":"yes","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1330,"y":100,"wires":[["e0e5fdf3.a292c","17edef6f.9c1d21"]]},{"id":"24b36ad3.bab376","type":"switch","z":"a5a73581.054de8","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"yes","vt":"str"},{"t":"eq","v":"no","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":1170,"y":120,"wires":[["37791d3d.327c72"],["467eb2c2.df878c"]]},{"id":"17edef6f.9c1d21","type":"ui_text","z":"a5a73581.054de8","group":"574f14fd.321a4c","order":0,"width":"2","height":"1","name":"","label":"","format":"{{msg.payload}}","layout":"row-spread","x":1570,"y":100,"wires":[]},{"id":"90944619.128ab8","type":"inject","z":"a5a73581.054de8","name":"","topic":"","payload":"yes","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1050,"y":180,"wires":[["e0e5fdf3.a292c"]]},{"id":"113cce50.039252","type":"inject","z":"a5a73581.054de8","name":"","topic":"","payload":"no","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1050,"y":220,"wires":[["e0e5fdf3.a292c"]]},{"id":"b5f70d0b.f9527","type":"comment","z":"a5a73581.054de8","name":"USE AIR CONDITIONER OR NOT","info":"If set to \"NO\" the thermostat will ignore outside status.","x":1120,"y":40,"wires":[]},{"id":"5bd3f79d.68da88","type":"switch","z":"a5a73581.054de8","name":"AC or not","property":"useAC","propertyType":"global","rules":[{"t":"eq","v":"no","vt":"str"},{"t":"eq","v":"yes","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":900,"y":600,"wires":[["4dd4ae01.77ece"],["ef418566.ee5ec8"]],"outputLabels":["no","yes"]},{"id":"cae28e7a.151c7","type":"switch","z":"a5a73581.054de8","name":"AC or not","property":"useAC","propertyType":"global","rules":[{"t":"eq","v":"no","vt":"str"},{"t":"eq","v":"yes","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":900,"y":700,"wires":[["5afe01cb.64516"],["87ef58ce.06d8e8"]]},{"id":"a0091b9c.164c48","type":"switch","z":"a5a73581.054de8","name":"AC or not","property":"useAC","propertyType":"global","rules":[{"t":"eq","v":"no","vt":"str"},{"t":"eq","v":"yes","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":880,"y":780,"wires":[["1a13ca.9d0b7c36","17a8fb64.da6545"],["a4235ca3.28daf"]]},{"id":"21ed6ef6.6009b2","type":"debug","z":"a5a73581.054de8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1590,"y":340,"wires":[]},{"id":"90e0ba16.c3fe58","type":"rbe","z":"a5a73581.054de8","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":1470,"y":220,"wires":[["24b36ad3.bab376"]]},{"id":"db9de42b.825ad8","type":"function","z":"a5a73581.054de8","name":"Add time","func":"function padLeft(nr, str){\nreturn Array(2-String(nr).length+1).join(str||'0')+nr;\n}\nvar d = new Date();\n\nmsg.time = padLeft(d.getDate()) + \"/\" + padLeft(d.getMonth()+1) + \" \" + padLeft(d.getHours()) + \":\" + padLeft(d.getMinutes()) + \":\" + padLeft(d.getSeconds());\n\nreturn msg;","outputs":1,"noerr":0,"x":580,"y":500,"wires":[["35604e55.3982d2"]]},{"id":"1a13ca.9d0b7c36","type":"trigger","z":"a5a73581.054de8","op1":"1","op2":"","op1type":"str","op2type":"nul","duration":"10","extend":false,"units":"ms","reset":"","bytopic":"all","name":"TURN ON","x":1350,"y":660,"wires":[["42489d6a.17e754","bcac38a0.d3e948"]]},{"id":"4dd4ae01.77ece","type":"trigger","z":"a5a73581.054de8","op1":"0","op2":"1","op1type":"str","op2type":"str","duration":"15","extend":false,"units":"min","reset":"","bytopic":"all","name":"TURN OFF 20","x":1360,"y":400,"wires":[["42489d6a.17e754","bcac38a0.d3e948","21ed6ef6.6009b2","dd076114.74faa"]]},{"id":"17a8fb64.da6545","type":"trigger","z":"a5a73581.054de8","op1":"0","op2":"","op1type":"str","op2type":"nul","duration":"10","extend":false,"units":"ms","reset":"","bytopic":"all","name":"TURN OFF","x":1350,"y":700,"wires":[["b3574f53.30bf8"]]},{"id":"5090cc49.283904","type":"trigger","z":"a5a73581.054de8","op1":"1","op2":"","op1type":"str","op2type":"nul","duration":"10","extend":false,"units":"ms","reset":"","bytopic":"all","name":"TURN ON","x":1350,"y":580,"wires":[[]]},{"id":"5afe01cb.64516","type":"trigger","z":"a5a73581.054de8","op1":"0","op2":"","op1type":"str","op2type":"nul","duration":"10","extend":false,"units":"ms","reset":"","bytopic":"all","name":"TURN OFF","x":1350,"y":620,"wires":[["b3574f53.30bf8"]]},{"id":"b3574f53.30bf8","type":"rbe","z":"a5a73581.054de8","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":1770,"y":640,"wires":[["7a1c0b06.250124"]]},{"id":"42489d6a.17e754","type":"rbe","z":"a5a73581.054de8","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":1770,"y":560,"wires":[["fade8ab5.865f38"]]},{"id":"bcac38a0.d3e948","type":"rbe","z":"a5a73581.054de8","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":1770,"y":500,"wires":[["1f9e9eb0.d68fa1"]]},{"id":"dd076114.74faa","type":"trigger","z":"a5a73581.054de8","op1":"","op2":"1","op1type":"nul","op2type":"str","duration":"5","extend":false,"units":"min","reset":"","bytopic":"all","name":"ON every 15","x":1370,"y":460,"wires":[["bcac38a0.d3e948","42489d6a.17e754","21ed6ef6.6009b2"]]},{"id":"5ded8bb3.b6fcf4","type":"comment","z":"a5a73581.054de8","name":"WHEN AC IS NOT ENABLED (WORK IN PROGRESS)","info":"","x":1300,"y":320,"wires":[]},{"id":"5c3d552e.78cc0c","type":"comment","z":"a5a73581.054de8","name":"WORK IN PROGRESS OVER HERE...","info":"","x":1690,"y":400,"wires":[]},{"id":"6f6502eb.3c0ccc","type":"comment","z":"a5a73581.054de8","name":"WORK IN PROGRESS OVER HERE...","info":"","x":1350,"y":540,"wires":[]},{"id":"87de71eb.4a609","type":"mqtt-broker","z":"","name":"mosquitto","broker":"192.168.1.200","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"MQTTinfo/mosquitto","birthQos":"2","birthPayload":"Mosquitto is up and runnig!!!","willTopic":"MQTTinfo/mosquitto","willQos":"2","willPayload":"Mosquitto is down!!!!"},{"id":"914a70c9.6b0b","type":"ui_group","z":"","name":"TEMPERATURE STATUS","tab":"fb9e7d3d.87629","order":5,"disp":true,"width":"6","collapse":false},{"id":"185c8e21.2d6b42","type":"ui_group","z":"","name":"CLIMA","tab":"fb9e7d3d.87629","disp":true,"width":"6","collapse":false},{"id":"574f14fd.321a4c","type":"ui_group","z":"","name":"CLIMA vars","tab":"fb9e7d3d.87629","disp":true,"width":"6","collapse":false},{"id":"df6763f0.0932d","type":"ui_group","z":"","name":"TEST OUTPUTS","tab":"fb9e7d3d.87629","disp":true,"width":"6","collapse":false},{"id":"4460014f.62417","type":"ui_group","z":"","name":"SENSOR SIMULATOR","tab":"fb9e7d3d.87629","order":4,"disp":true,"width":"6","collapse":false},{"id":"fb9e7d3d.87629","type":"ui_tab","z":"","name":"DEV","icon":"dashboard"}]
``

Maybe if you specified what the current issue is?? That is a big flow for someone to dig tru when they don’t know what result you are looking for.

The flow need a "Init values" node in order to put the initial values on all variables needed. Or a definition that detect itself if the value was previously declared an set.

Farma92, how are you liking this flow and have you made any updates? I am new to node-red but had a great WebCore automation I previously used. Would compare if smoke alarms, hvac, how many windows open, how close to comfort temp, humidity etc.it would also ramp fan speed up or down depending how close inside temp was to comfort temp as well as compare outside temp to inside. If outside temp was cooler by x degrees run 10, if close run speed 3. Once it hit comfort speed 1. It turned off when inside temp got to min comfort temperature.
Can you share your flow and updates?