Here is a shortened version of what I use now. It takes one outdoor temp (backyard_temp in this case… that hourly temp is an appendix I just forgot to delete), and compares it to several indoor temp sensors, but you can change these to whatever you like (just be sure to edit the function node and list nodes accordingly). It does require making a group of entities that contains all of your ‘perimeter’ nodes. In this context, ‘perimeter’ is defined as openings that will let outside air inside (so like not a garage cover for example). The parts on top are a bonus that I kept in there; those nodes will turn the ac or heater off if doors/windows stay open too long, then turn it back on to the correct mode when the perimeter is later closed. This version only shows a few door/window entities, but my actual flow has like 40 entities… just extend the delay chain on the bottom to add more.
[{"id":"2174f4f6.ffe5dc","type":"api-current-state","z":"e44a471b.b2ab38","name":"","server":"684e76d1.f36e78","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"sensor.thermostat_temperature","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":480,"y":500,"wires":[["92ba5710.095348"]]},{"id":"b26a86ee.f64498","type":"api-current-state","z":"e44a471b.b2ab38","name":"","server":"684e76d1.f36e78","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"sensor.master_slider_temp","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":460,"y":420,"wires":[["92ba5710.095348"]]},{"id":"3e61bf5b.c0a8","type":"api-current-state","z":"e44a471b.b2ab38","name":"","server":"684e76d1.f36e78","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"sensor.dining_slider_temp","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":460,"y":560,"wires":[["92ba5710.095348","e59d3815.ea9f58"]]},{"id":"d273f4bd.1ea208","type":"api-current-state","z":"e44a471b.b2ab38","name":"","server":"684e76d1.f36e78","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"sensor.backyard_temp","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":450,"y":360,"wires":[["92ba5710.095348","ca22ba4c.96ec68"]]},{"id":"ca22ba4c.96ec68","type":"delay","z":"e44a471b.b2ab38","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":170,"y":420,"wires":[["b26a86ee.f64498","ed3f714b.bb3e5"]]},{"id":"d445e398.54fd","type":"delay","z":"e44a471b.b2ab38","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":170,"y":500,"wires":[["2174f4f6.ffe5dc","6269b8f8.bb7298"]]},{"id":"6269b8f8.bb7298","type":"delay","z":"e44a471b.b2ab38","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":170,"y":560,"wires":[["3e61bf5b.c0a8"]]},{"id":"771de382.eca9ec","type":"change","z":"e44a471b.b2ab38","name":"","rules":[{"t":"set","p":"complete","pt":"msg","to":"1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":770,"y":560,"wires":[["92ba5710.095348"]]},{"id":"92ba5710.095348","type":"join","z":"e44a471b.b2ab38","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":790,"y":480,"wires":[["612b3709.b8b7a8"]]},{"id":"612b3709.b8b7a8","type":"function","z":"e44a471b.b2ab38","name":"Open the windows?","func":"// Takes an array of temperatures where payload[0]\n// is the outside temp, and the rest are inside\n// temps.\n\n// A payload of \"open_windows\" is sent on the 1st\n// output if it is warmer outside and outside is\n// <=80F, or if it is cooler outside and outside\n// is >66F.\n\n// A payload of \"close_windows\" is sent on\n// the 2nd output if it is warmer outside and\n// outside is >80F, or if it is cooler outside \n// and outside is <=66F. \n\nvar i = 0;\nvar maxTemp = 0;\nvar minTemp = 200;\n\n// Store the highest & lowest temps inside\nfor(i = 1; i < msg.payload.length; i++) {\n if(msg.payload[i] > maxTemp) {\n maxTemp = msg.payload[i];\n }\n if(msg.payload[i] < minTemp) {\n minTemp = msg.payload[i];\n }\n}\n\n// outside is warmer\nif(msg.payload[0] > maxTemp) {\n // hot outside\n if(msg.payload[0] > 85) {\n msg.payload = \"close_windows\";\n return [null,msg];\n }\n // comfy to cold outside (warm winter afternoon)\n else {\n msg.payload = \"open_windows\";\n return [msg,null];\n }\n}\n// outside cooler\nelse if(msg.payload[0] < minTemp) {\n // outside is comfy to hot (cool summer evenings)\n if(msg.payload[0] > 68) {\n msg.payload = \"open_windows\";\n return [msg,null];\n }\n // cold outside\n else {\n msg.payload = \"close_windows\";\n return [null,msg];\n }\n}\nelse {\n return [null,null]; // only if all 3 temps are equal\n}","outputs":2,"noerr":0,"x":990,"y":480,"wires":[["708b7d06.c43e24"],["1468880c.7d2d08"]],"outputLabels":["open_windows","close_windows"]},{"id":"708b7d06.c43e24","type":"api-current-state","z":"e44a471b.b2ab38","name":"","server":"684e76d1.f36e78","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"group.climate_perimeter","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":1070,"y":420,"wires":[[],["d8a8d20c.35507"]]},{"id":"1468880c.7d2d08","type":"api-current-state","z":"e44a471b.b2ab38","name":"","server":"684e76d1.f36e78","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"group.climate_perimeter","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":1070,"y":540,"wires":[["574192e1.06204c"],[]]},{"id":"7f08e638.5739a8","type":"bigtimer","z":"e44a471b.b2ab38","outtopic":"","outpayload1":"","outpayload2":"","name":"Big Timer","comment":"","lat":"38.59415","lon":"-121.36612","starttime":"0","endtime":"0","starttime2":0,"endtime2":0,"startoff":0,"endoff":0,"startoff2":0,"endoff2":0,"offs":0,"outtext1":"","outtext2":"","timeout":1440,"sun":true,"mon":true,"tue":true,"wed":true,"thu":true,"fri":true,"sat":true,"jan":true,"feb":true,"mar":true,"apr":true,"may":true,"jun":true,"jul":true,"aug":true,"sep":true,"oct":true,"nov":true,"dec":true,"day1":0,"month1":0,"day2":0,"month2":0,"day3":0,"month3":0,"day4":0,"month4":0,"day5":0,"month5":0,"day6":0,"month6":0,"d1":0,"w1":0,"d2":0,"w2":0,"d3":0,"w3":0,"d4":0,"w4":0,"d5":0,"w5":0,"d6":0,"w6":0,"xday1":0,"xmonth1":0,"xday2":0,"xmonth2":0,"xday3":0,"xmonth3":0,"xday4":0,"xmonth4":0,"xday5":0,"xmonth5":0,"xday6":0,"xmonth6":0,"xd1":0,"xw1":0,"xd2":0,"xw2":0,"xd3":0,"xw3":0,"xd4":0,"xw4":0,"xd5":0,"xw5":0,"xd6":0,"xw6":0,"suspend":false,"random":false,"repeat":true,"atstart":true,"odd":false,"even":false,"x":120,"y":280,"wires":[[],["2169a260.a0871e"],[]]},{"id":"503026b2.8f6968","type":"interval-length","z":"e44a471b.b2ab38","format":"json","bytopic":false,"minimum":"70","maximum":"","window":"","timeout":false,"msgTimeout":"","minimumunit":"secs","maximumunit":"msecs","windowunit":"msecs","msgTimeoutUnit":"msecs","reset":false,"startup":true,"msgField":"payload","timestampField":"timestamp","repeatTimeout":false,"name":">70sec","x":1380,"y":660,"wires":[["4f15fcf0.ac9994"],[]]},{"id":"accbbd16.ac353","type":"function","z":"e44a471b.b2ab38","name":"kev: Open window reminder","func":"msg.payload = {\n\tchatId:\"xxx\", //my phone\n\ttype:\"message\",\n\tcontent: \"OK to open windows\"\n};\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1440,"y":360,"wires":[[]]},{"id":"a7e262b6.8b2c2","type":"api-current-state","z":"e44a471b.b2ab38","name":"","server":"684e76d1.f36e78","version":1,"outputs":2,"halt_if":"home","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"person.kevin","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":1160,"y":660,"wires":[["503026b2.8f6968"],[]]},{"id":"1088cb53.c63da5","type":"api-current-state","z":"e44a471b.b2ab38","name":"","server":"684e76d1.f36e78","version":1,"outputs":2,"halt_if":"home","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"person.kevin","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":1220,"y":300,"wires":[["63d88b20.288bc4"],[]]},{"id":"2169a260.a0871e","type":"time-range-switch","z":"e44a471b.b2ab38","name":"","lat":"38.59415","lon":"-121.36612","startTime":"8:00","endTime":"0:00","startOffset":0,"endOffset":0,"x":150,"y":360,"wires":[["d273f4bd.1ea208","13448019.0d639"],[]]},{"id":"ffc7e39c.4d5cf","type":"change","z":"e44a471b.b2ab38","name":"stop","rules":[{"t":"set","p":"payload","pt":"msg","to":"stop","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":970,"y":360,"wires":[["d8a8d20c.35507"]]},{"id":"d8a8d20c.35507","type":"stoptimer","z":"e44a471b.b2ab38","duration":"20","units":"Second","payloadtype":"str","payloadval":"stop","name":"","x":1150,"y":360,"wires":[["1088cb53.c63da5"],[]]},{"id":"574192e1.06204c","type":"stoptimer","z":"e44a471b.b2ab38","duration":"20","units":"Second","payloadtype":"str","payloadval":"stop","name":"","x":1150,"y":600,"wires":[["a7e262b6.8b2c2"],[]]},{"id":"ac62ba47.6b17d8","type":"change","z":"e44a471b.b2ab38","name":"stop","rules":[{"t":"set","p":"payload","pt":"msg","to":"stop","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":970,"y":600,"wires":[["574192e1.06204c"]]},{"id":"b3700890.f34b08","type":"server-state-changed","z":"e44a471b.b2ab38","name":"","server":"684e76d1.f36e78","version":1,"entityidfilter":"group.climate_perimeter","entityidfiltertype":"exact","outputinitially":true,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"x":220,"y":140,"wires":[["ffc7e39c.4d5cf","ef16f3.de46e91"],["ac62ba47.6b17d8","4aa14b4f.4feeb4"]]},{"id":"acb402c.a92f7","type":"function","z":"e44a471b.b2ab38","name":"kev: Close these windows","func":"var text = msg.payload;\nmsg.payload = {\n\tchatId:\"xxx\", //my phone\n\ttype:\"message\",\n\tcontent: \"Please close:\\r\\n\"+text\n};\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1550,"y":1000,"wires":[[]]},{"id":"9c56e04b.098c5","type":"api-current-state","z":"e44a471b.b2ab38","name":"","server":"684e76d1.f36e78","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"binary_sensor.lauren_window_2","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":860,"y":920,"wires":[["97edc76d.8a2208","e96d3f9f.eeb44"],["97edc76d.8a2208"]]},{"id":"a5dba0d5.11063","type":"delay","z":"e44a471b.b2ab38","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":580,"y":920,"wires":[["9c56e04b.098c5"]]},{"id":"84a770c9.374c2","type":"join","z":"e44a471b.b2ab38","name":"","mode":"custom","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":1490,"y":940,"wires":[["acb402c.a92f7"]]},{"id":"97edc76d.8a2208","type":"delay","z":"e44a471b.b2ab38","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":1150,"y":960,"wires":[["c29f31a3.e87fd"]]},{"id":"c29f31a3.e87fd","type":"change","z":"e44a471b.b2ab38","name":"","rules":[{"t":"set","p":"complete","pt":"msg","to":"1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1170,"y":1000,"wires":[["b21219e4.937778"]]},{"id":"e96d3f9f.eeb44","type":"change","z":"e44a471b.b2ab38","name":"payload to friendly_name","rules":[{"t":"set","p":"payload","pt":"msg","to":"data.attributes.friendly_name","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1190,"y":920,"wires":[["84a770c9.374c2"]]},{"id":"b21219e4.937778","type":"change","z":"e44a471b.b2ab38","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1200,"y":1040,"wires":[["84a770c9.374c2"]]},{"id":"cc5668c6.a82538","type":"api-current-state","z":"e44a471b.b2ab38","name":"","server":"684e76d1.f36e78","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"binary_sensor.master_window_2","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":850,"y":740,"wires":[["fae426f3.5502a8"],[]]},{"id":"4f15fcf0.ac9994","type":"delay","z":"e44a471b.b2ab38","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":570,"y":740,"wires":[["cc5668c6.a82538","cdda4d14.49e21"]]},{"id":"fae426f3.5502a8","type":"change","z":"e44a471b.b2ab38","name":"payload to friendly_name","rules":[{"t":"set","p":"payload","pt":"msg","to":"data.attributes.friendly_name","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1180,"y":740,"wires":[["84a770c9.374c2"]]},{"id":"bd359611.caf7f8","type":"api-current-state","z":"e44a471b.b2ab38","name":"","server":"684e76d1.f36e78","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"binary_sensor.master_window_3","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":850,"y":800,"wires":[["5f3e7260.43e3bc"],[]]},{"id":"cdda4d14.49e21","type":"delay","z":"e44a471b.b2ab38","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":570,"y":800,"wires":[["bd359611.caf7f8","ec431a99.804598"]]},{"id":"5f3e7260.43e3bc","type":"change","z":"e44a471b.b2ab38","name":"payload to friendly_name","rules":[{"t":"set","p":"payload","pt":"msg","to":"data.attributes.friendly_name","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1180,"y":800,"wires":[["84a770c9.374c2"]]},{"id":"ffcb7cda.5e4a6","type":"api-current-state","z":"e44a471b.b2ab38","name":"","server":"684e76d1.f36e78","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"binary_sensor.lauren_window_1","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":850,"y":860,"wires":[["b04ded47.dab8"],[]]},{"id":"ec431a99.804598","type":"delay","z":"e44a471b.b2ab38","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":570,"y":860,"wires":[["ffcb7cda.5e4a6","a5dba0d5.11063"]]},{"id":"b04ded47.dab8","type":"change","z":"e44a471b.b2ab38","name":"payload to friendly_name","rules":[{"t":"set","p":"payload","pt":"msg","to":"data.attributes.friendly_name","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1180,"y":860,"wires":[["84a770c9.374c2"]]},{"id":"63d88b20.288bc4","type":"interval-length","z":"e44a471b.b2ab38","format":"json","bytopic":false,"minimum":"70","maximum":"","window":"","timeout":false,"msgTimeout":"","minimumunit":"secs","maximumunit":"msecs","windowunit":"msecs","msgTimeoutUnit":"msecs","reset":false,"startup":true,"msgField":"payload","timestampField":"timestamp","repeatTimeout":false,"name":">70sec","x":1440,"y":300,"wires":[["accbbd16.ac353"],[]]},{"id":"13448019.0d639","type":"api-current-state","z":"e44a471b.b2ab38","name":"","server":"684e76d1.f36e78","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"weather.weather_hourly","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":450,"y":280,"wires":[["82008715.c393b8"]]},{"id":"6ad89635.1e7258","type":"api-current-state","z":"e44a471b.b2ab38","name":"Thermostat heat?","server":"684e76d1.f36e78","version":1,"outputs":2,"halt_if":"heat","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"climate.thermostat_mode","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":950,"y":220,"wires":[["ddbb7748.70ffe8"],[]]},{"id":"ddbb7748.70ffe8","type":"api-call-service","z":"e44a471b.b2ab38","name":"","server":"684e76d1.f36e78","version":1,"debugenabled":false,"service_domain":"climate","service":"turn_off","entityId":"climate.thermostat_mode","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1340,"y":160,"wires":[["ed036348.8ac29"]]},{"id":"9483d248.2c4da","type":"api-call-service","z":"e44a471b.b2ab38","name":"","server":"684e76d1.f36e78","version":1,"debugenabled":false,"service_domain":"climate","service":"set_hvac_mode","entityId":"climate.thermostat_mode","data":"{\"hvac_mode\":\"heat\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1820,"y":160,"wires":[[]]},{"id":"ed036348.8ac29","type":"ha-wait-until","z":"e44a471b.b2ab38","name":"Wait for perimeter to close","server":"684e76d1.f36e78","outputs":1,"entityId":"group.climate_perimeter","property":"state","comparator":"is","value":"off","valueType":"str","timeout":0,"timeoutUnits":"seconds","entityLocation":"","entityLocationType":"none","checkCurrentState":true,"blockInputOverrides":true,"x":1570,"y":160,"wires":[["9483d248.2c4da"]]},{"id":"ef16f3.de46e91","type":"stoptimer","z":"e44a471b.b2ab38","duration":"120","units":"Second","payloadtype":"num","payloadval":"0","name":"","x":690,"y":200,"wires":[["6ad89635.1e7258","977a6a08.ecdbe8"],[]]},{"id":"4aa14b4f.4feeb4","type":"change","z":"e44a471b.b2ab38","name":"stop","rules":[{"t":"set","p":"payload","pt":"msg","to":"stop","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":470,"y":200,"wires":[["ef16f3.de46e91"]]},{"id":"24a2091.06660f6","type":"api-current-state","z":"e44a471b.b2ab38","name":"","server":"684e76d1.f36e78","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"sensor.master_temperature","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":460,"y":460,"wires":[["92ba5710.095348"]]},{"id":"ed3f714b.bb3e5","type":"delay","z":"e44a471b.b2ab38","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":170,"y":460,"wires":[["24a2091.06660f6","d445e398.54fd"]]},{"id":"e59d3815.ea9f58","type":"delay","z":"e44a471b.b2ab38","name":"","pauseType":"delay","timeout":"5","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":750,"y":600,"wires":[["771de382.eca9ec"]]},{"id":"82008715.c393b8","type":"change","z":"e44a471b.b2ab38","name":"Current Temperature","rules":[{"t":"set","p":"payload","pt":"msg","to":"data.attributes.temperature","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":720,"y":280,"wires":[[]]},{"id":"8db7f3d4.c7468","type":"trigger-state","z":"e44a471b.b2ab38","name":"Thermostat Mode","server":"684e76d1.f36e78","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityid":"climate.thermostat_mode","entityidfiltertype":"exact","debugenabled":false,"constraints":[],"constraintsmustmatch":"all","outputs":4,"customoutputs":[{"outputId":"olf1u8jzh5c","messageType":"default","messageValue":"","messageValueType":"json","comparatorPropertyType":"current_state","comparatorPropertyValue":"new_state.state","comparatorType":"is","comparatorValue":"heat"},{"outputId":"i52lss6i20q","messageType":"default","messageValue":"","messageValueType":"json","comparatorPropertyType":"current_state","comparatorPropertyValue":"new_state.state","comparatorType":"is","comparatorValue":"cool"}],"outputinitially":false,"state_type":"str","x":690,"y":120,"wires":[[],[],[],["4d0d15d5.d4b3fc"]]},{"id":"1a4c762c.dbbdaa","type":"api-call-service","z":"e44a471b.b2ab38","name":"","server":"684e76d1.f36e78","version":1,"debugenabled":false,"service_domain":"climate","service":"set_hvac_mode","entityId":"climate.thermostat_mode","data":"{\"hvac_mode\":\"cool\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1820,"y":220,"wires":[[]]},{"id":"79a8bbdd.2d42f4","type":"ha-wait-until","z":"e44a471b.b2ab38","name":"Wait for perimeter to close","server":"684e76d1.f36e78","outputs":1,"entityId":"group.climate_perimeter","property":"state","comparator":"is","value":"off","valueType":"str","timeout":0,"timeoutUnits":"seconds","entityLocation":"","entityLocationType":"none","checkCurrentState":true,"blockInputOverrides":true,"x":1570,"y":220,"wires":[["1a4c762c.dbbdaa"]]},{"id":"de351d7b.c58da","type":"api-call-service","z":"e44a471b.b2ab38","name":"","server":"684e76d1.f36e78","version":1,"debugenabled":false,"service_domain":"climate","service":"turn_off","entityId":"climate.thermostat_mode","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1340,"y":220,"wires":[["79a8bbdd.2d42f4"]]},{"id":"4d0d15d5.d4b3fc","type":"api-current-state","z":"e44a471b.b2ab38","name":"","server":"684e76d1.f36e78","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"group.climate_perimeter","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":1010,"y":160,"wires":[["de351d7b.c58da"],[]]},{"id":"977a6a08.ecdbe8","type":"api-current-state","z":"e44a471b.b2ab38","name":"Thermostat cool?","server":"684e76d1.f36e78","version":1,"outputs":2,"halt_if":"cool","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"climate.thermostat_mode","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":950,"y":280,"wires":[["de351d7b.c58da"],[]]},{"id":"684e76d1.f36e78","type":"server","z":"","name":"Home Assistant","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true}]
Most of the flow uses pretty standard methods that I’ve learned here and there on these forums. Like creating the list using delay+join nodes, and repeated message prevention with interval nodes… those are good things to know in general. The bigtimer is just feeding a pulse every minute to the time range node; it’s doing other stuff on the flow that I didn’t upload, but if you don’t need it just a repeat node may be more efficient there. The function in the middle is doing all of the magic… and it leaves a lot of room for improvement (like feeding it a text sensor so you can adjust the set points from the HA dashboard, factoring in humidity, etc). Please share if you come up with better code for that function.
What’s missing of course, is my Telegram node at the ends to send the actual open/close window notifications (too much private info to remove on that one). If you have Telegram setup in nodered, this should be pretty simple to complete. You can see where to fill in your chatid in the 2 ending function nodes… then feed that to your working Telegram node et voila. If you use other systems to send notifications to your phone, then you may have to adjust the function nodes so they send payloads that are compatible with your system.