UPDATE:
I didn’t understand very well how to use norelite rules, so I’m trying to follow with the default nodes…
I just discovered how to add msg properties and payloads are starting to get messy, as well as variables (most of them are global)…
I documented it a bit to let others figure what I’m trying to do on each branch of the flow.
[{"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":560,"wires":[["d6ab6019.3fe7c","a346eee7.ced05"]]},{"id":"93e7988e.5ca618","type":"mqtt in","z":"a5a73581.054de8","name":"HUMIDITY in","topic":"clima/THin/humidity","qos":"2","broker":"87de71eb.4a609","x":110,"y":1140,"wires":[[]]},{"id":"c01839cf.3c67a8","type":"switch","z":"a5a73581.054de8","name":"compare current vs target","property":"payload","propertyType":"msg","rules":[{"t":"lte","v":"minTargettemp","vt":"global"},{"t":"btwn","v":"minTargettemp","vt":"global","v2":"maxTargettemp","v2t":"global"},{"t":"gte","v":"maxTargettemp","vt":"global"}],"checkall":"true","repair":false,"outputs":3,"x":510,"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":"22","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":260,"y":140,"wires":[["d9f3a6f4.772808"]]},{"id":"87d0f447.858f98","type":"change","z":"a5a73581.054de8","name":"minTargettemp","rules":[{"t":"set","p":"minTargettemp","pt":"global","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":640,"y":140,"wires":[[]]},{"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"}],"action":"","property":"","from":"","to":"","reg":false,"x":640,"y":180,"wires":[[]]},{"id":"406d2664.918018","type":"inject","z":"a5a73581.054de8","name":"maxTarget","topic":"","payload":"23","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":260,"y":180,"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","8d3e078b.08d498"]]},{"id":"df252ca9.98e16","type":"template","z":"a5a73581.054de8","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"The IN temperature is {{insideState}} 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":"2","highlight":"","outputs":0,"ok":"OK","cancel":"","topic":"","name":"","x":1390,"y":480,"wires":[]},{"id":"4dc60ad1.15c3c4","type":"rbe","z":"a5a73581.054de8","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":1190,"y":480,"wires":[["f43e1241.aca98"]]},{"id":"8d3e078b.08d498","type":"ui_text","z":"a5a73581.054de8","group":"185c8e21.2d6b42","order":3,"width":0,"height":0,"name":"","label":"TEMPERATURA IN:","format":"{{msg.payload}}ºC {{msg.insideStatus}}","layout":"col-center","x":1400,"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":[["79ff3914.549568"]]},{"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":[["35604e55.3982d2"]]},{"id":"1a69a63d.dc689a","type":"ui_button","z":"a5a73581.054de8","name":"","group":"185c8e21.2d6b42","order":9,"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":7,"width":0,"height":0,"name":"","label":"TEMP MAX:","format":"{{msg.payload}}ºC","layout":"row-left","x":630,"y":320,"wires":[]},{"id":"35604e55.3982d2","type":"ui_text","z":"a5a73581.054de8","group":"185c8e21.2d6b42","order":8,"width":0,"height":0,"name":"","label":"TEMP MIN:","format":"{{msg.payload}}ºC","layout":"row-left","x":630,"y":360,"wires":[]},{"id":"d9f3a6f4.772808","type":"ui_text_input","z":"a5a73581.054de8","name":"","label":"Target MIN temp","group":"185c8e21.2d6b42","order":10,"width":0,"height":0,"passthru":true,"mode":"number","delay":"30","topic":"","x":460,"y":140,"wires":[["87d0f447.858f98"]]},{"id":"ced68327.57f07","type":"ui_text_input","z":"a5a73581.054de8","name":"","label":"Target MAX temp","group":"185c8e21.2d6b42","order":11,"width":0,"height":0,"passthru":true,"mode":"number","delay":"30","topic":"","x":450,"y":180,"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":130,"y":100,"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-Add the time of the highest and lowest\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":"28","payloadType":"str","repeat":"10","crontab":"","once":false,"onceDelay":0.1,"x":110,"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":"flow"},{"t":"eq","v":"outLimitTemp","vt":"flow"},{"t":"gt","v":"outLimitTemp","vt":"flow"}],"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"}],"action":"","property":"","from":"","to":"","reg":false,"x":730,"y":760,"wires":[["d39906b3.8124e8"]]},{"id":"c4a296a7.39d7f8","type":"change","z":"a5a73581.054de8","name":"LIMIT REACHED","rules":[{"t":"set","p":"outsideStatus","pt":"msg","to":"LIMIT REACHED","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":770,"y":820,"wires":[["d39906b3.8124e8"]]},{"id":"dccb88d1.b21668","type":"change","z":"a5a73581.054de8","name":"HELL MODE","rules":[{"t":"set","p":"outsideStatus","pt":"msg","to":"HELL MODE","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":750,"y":880,"wires":[["d39906b3.8124e8"]]},{"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":1090,"y":800,"wires":[["20f9ce42.7a56e2"]]},{"id":"ab54e0cd.c38c1","type":"change","z":"a5a73581.054de8","name":"out limit temp made flow","rules":[{"t":"set","p":"outLimitTemp","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":550,"y":60,"wires":[[]]},{"id":"57dec835.e186a8","type":"inject","z":"a5a73581.054de8","name":"","topic":"","payload":"28,5","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":350,"y":60,"wires":[["ab54e0cd.c38c1"]]},{"id":"1f9e9eb0.d68fa1","type":"ui_switch","z":"a5a73581.054de8","name":"","label":"extractor","group":"185c8e21.2d6b42","order":0,"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":0,"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":0,"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":"22362af5.b1e326","type":"inject","z":"a5a73581.054de8","name":"","topic":"","payload":"outCurrentTemp","payloadType":"global","repeat":"5","crontab":"","once":false,"onceDelay":0.1,"x":190,"y":900,"wires":[[]]},{"id":"20f9ce42.7a56e2","type":"debug","z":"a5a73581.054de8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1330,"y":820,"wires":[]},{"id":"f81862e9.90f52","type":"comment","z":"a5a73581.054de8","name":"TO DO....","info":"WORK IN PROGRESS....","x":100,"y":1100,"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":"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":"185c8e21.2d6b42","type":"ui_group","z":"","name":"CLIMA","tab":"fb9e7d3d.87629","disp":true,"width":"6","collapse":false},{"id":"fb9e7d3d.87629","type":"ui_tab","z":"","name":"DEV","icon":"dashboard"}]
``