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"}]
``