This is my first time using Node-Red, created last night, so please excuse my ignorance.
Node-Red v3.0.2 on Homeassistant installed via HACS
This flow is checking the state of thermometer from an outside weather station. If outside temp is below 50F, make sure thermostat is on, set to heat mode and change preset mode. If between 51F-65F do the same but use a different preset mode.
I was wondering if there is a better / more efficient way to accomplish what this flow is doing.
Eventually I would like to add more functionality such as getting temperature from an interior remote thermostat and presence detection to turn on heat/ac until that thermostat reaches a threshold of X.
[{"id":"6e97255055adf97b","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"699fc8b7307b65eb","type":"api-current-state","z":"6e97255055adf97b","name":"Davis Outside Tempreture","server":"9ff7fca303cf2b25","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.meteobridge_air_temperature","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":310,"y":180,"wires":[["2b42967bee8c5fa2"]]},{"id":"3163e9ee9866796d","type":"inject","z":"6e97255055adf97b","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":80,"y":180,"wires":[["699fc8b7307b65eb"]]},{"id":"89deb0d39f0b1554","type":"debug","z":"6e97255055adf97b","name":"Above 50","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":740,"y":300,"wires":[]},{"id":"2b42967bee8c5fa2","type":"switch","z":"6e97255055adf97b","name":"Davis Temp Switch","property":"payload","propertyType":"msg","rules":[{"t":"lte","v":"50","vt":"str"},{"t":"btwn","v":"51","vt":"num","v2":"65","v2t":"num"}],"checkall":"true","repair":false,"outputs":2,"x":530,"y":240,"wires":[["0ff05ab12923bdd3","d88221834de2b2dc"],["89deb0d39f0b1554","9c18debbe22b8282"]]},{"id":"0a145056f8919b85","type":"api-call-service","z":"6e97255055adf97b","name":"Set Thermostat Preset to Warm LR","server":"9ff7fca303cf2b25","version":5,"debugenabled":false,"domain":"climate","service":"set_preset_mode","areaId":["downstairs"],"deviceId":["cf64ea11fdf974e38a88fe87ae4a1408"],"entityId":["climate.downstairs"],"data":"{\"preset_mode\":\"warm LR\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","output_location":"","output_location_type":"none","x":1760,"y":140,"wires":[["e0099ce58c2585c8"]]},{"id":"0ff05ab12923bdd3","type":"api-current-state","z":"6e97255055adf97b","name":"Downstairs Check Mode (Heat)","server":"9ff7fca303cf2b25","version":3,"outputs":2,"halt_if":"heat","halt_if_type":"str","halt_if_compare":"is","entity_id":"climate.downstairs","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entity"},{"property":"data","propertyType":"msg","value":"","valueType":"config"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":790,"y":140,"wires":[["0a145056f8919b85"],["b8e66a8b7b806db5"]]},{"id":"b8e66a8b7b806db5","type":"api-call-service","z":"6e97255055adf97b","name":"Turn on thermostat","server":"9ff7fca303cf2b25","version":5,"debugenabled":false,"domain":"climate","service":"turn_on","areaId":["downstairs"],"deviceId":["cf64ea11fdf974e38a88fe87ae4a1408"],"entityId":["climate.downstairs"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1150,"y":180,"wires":[["9c52bafbfa32c780"]]},{"id":"9c52bafbfa32c780","type":"api-call-service","z":"6e97255055adf97b","name":"Set Thermostat Mode to Heat","server":"9ff7fca303cf2b25","version":5,"debugenabled":false,"domain":"climate","service":"set_hvac_mode","areaId":["downstairs"],"deviceId":["cf64ea11fdf974e38a88fe87ae4a1408"],"entityId":["climate.downstairs"],"data":"{\"hvac_mode\":\"heat\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","output_location":"","output_location_type":"none","x":1450,"y":180,"wires":[["0a145056f8919b85"]]},{"id":"748aa2268421b53b","type":"server-state-changed","z":"6e97255055adf97b","name":"State for Davis Outside Temp Sensor","server":"9ff7fca303cf2b25","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.meteobridge_air_temperature","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"50","halt_if_type":"num","halt_if_compare":"lte","outputs":2,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":150,"y":260,"wires":[["699fc8b7307b65eb"],["2b42967bee8c5fa2"]]},{"id":"9c18debbe22b8282","type":"api-current-state","z":"6e97255055adf97b","name":"Climate Downstairs is not heat","server":"9ff7fca303cf2b25","version":3,"outputs":2,"halt_if":"heat","halt_if_type":"str","halt_if_compare":"is_not","entity_id":"climate.downstairs","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entity"},{"property":"data","propertyType":"msg","value":"","valueType":"config"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":810,"y":360,"wires":[["0e62a81ea02c5891"],["3793f556548ab0ba"]]},{"id":"fb8dd7f0a976e667","type":"inject","z":"6e97255055adf97b","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":580,"y":420,"wires":[["9c18debbe22b8282"]]},{"id":"0e62a81ea02c5891","type":"api-call-service","z":"6e97255055adf97b","name":"","server":"9ff7fca303cf2b25","version":5,"debugenabled":false,"domain":"climate","service":"turn_on","areaId":["downstairs"],"deviceId":["cf64ea11fdf974e38a88fe87ae4a1408"],"entityId":["climate.downstairs"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1040,"y":320,"wires":[["3793f556548ab0ba"]]},{"id":"3793f556548ab0ba","type":"api-call-service","z":"6e97255055adf97b","name":"Set Thermostat Heat Mode","server":"9ff7fca303cf2b25","version":5,"debugenabled":false,"domain":"climate","service":"set_hvac_mode","areaId":["downstairs"],"deviceId":["cf64ea11fdf974e38a88fe87ae4a1408"],"entityId":["climate.downstairs"],"data":"{\"hvac_mode\":\"heat\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","output_location":"","output_location_type":"none","x":1280,"y":380,"wires":[["7582f57ded1e6889"]]},{"id":"7582f57ded1e6889","type":"api-call-service","z":"6e97255055adf97b","name":"Set Thermostat Preset to Home","server":"9ff7fca303cf2b25","version":5,"debugenabled":false,"domain":"climate","service":"set_preset_mode","areaId":["downstairs"],"deviceId":["cf64ea11fdf974e38a88fe87ae4a1408"],"entityId":["climate.downstairs"],"data":"{\"preset_mode\":\"home\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","output_location":"","output_location_type":"none","x":1590,"y":380,"wires":[["6830981b93bfc688"]]},{"id":"6830981b93bfc688","type":"api-call-service","z":"6e97255055adf97b","name":"Set Fan Auto","server":"9ff7fca303cf2b25","version":5,"debugenabled":false,"domain":"climate","service":"set_fan_mode","areaId":["downstairs"],"deviceId":["cf64ea11fdf974e38a88fe87ae4a1408"],"entityId":["climate.downstairs"],"data":"{\"fan_mode\":\"auto\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","output_location":"","output_location_type":"none","x":1830,"y":380,"wires":[[]]},{"id":"e0099ce58c2585c8","type":"api-call-service","z":"6e97255055adf97b","name":"Set Fan Auto","server":"9ff7fca303cf2b25","version":5,"debugenabled":false,"domain":"climate","service":"set_fan_mode","areaId":["downstairs"],"deviceId":["cf64ea11fdf974e38a88fe87ae4a1408"],"entityId":["climate.downstairs"],"data":"{\"fan_mode\":\"auto\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","output_location":"","output_location_type":"none","x":2050,"y":140,"wires":[[]]},{"id":"d88221834de2b2dc","type":"debug","z":"6e97255055adf97b","name":"Below 50","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":740,"y":260,"wires":[]},{"id":"990a13b4f29a18cd","type":"inject","z":"6e97255055adf97b","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":540,"y":100,"wires":[["0ff05ab12923bdd3"]]},{"id":"9ff7fca303cf2b25","type":"server","name":"Default Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":": ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"default","statusTimeFormat":"h:m","enableGlobalContextStore":false}]