Is there a better / more efficient way to write this flow?

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

There's nothing inherently bad about it, but a couple of observations:

  • The "State for Davis Outside Temp Sensor" node should node need the "<= 50". Either way (true/false), it still ends up at the switch node. And I'm not sure why true is causing it to get the state again, as it already has it. You could change the condition to "<= 65" to just bail out early if it's over 65, but the switch node does that anyway (so I don't think it's a good idea).

  • Your "Davis temp switch" has "<= 50" and "between 51 and 65". Can it be 50.5? Maybe not with Farenheit. I would code it as "<= 50" and "<= 65" and change "checking all rules" to "stopping after first match". That way, if you want to change the boundaries, you only need to do it once. I think this is very much a personal preference though.

  • The nodes after the two conditions are basically identical, so they could be combined. So, for example, if a "change" node after "<= 50" sets "msg.preset_mode = Warm LR" and the other condition sets it to "Home", then they can join into the same set of nodes where "set thermostat" then uses this value (using a JSONata expression):

       { "preset_mode": preset_mode }
  • You might want to also check that it's not already in the desired state. For example, if the temperature goes to 55 it will turn on the heat and set it to "Home". But if the temperature then changes up or down by 1, it will do the same thing, desite already being in that state.

  • Do you want to care about the temperature going 50-51-50-51 and flip-flopping between the two presets? You could put in something like "for 10 minutes" into the "State for Davis Outside Temp Sensor" node to minimize that.

Thank you. That makes a lot of sense. I have changed the flow but kinfa hit a brick wall.
What changed:
State change for outdoor temp set to 1 hour.
Sending output from outdoor temp to switch <=50 >=65 (for testing, getting warmer), stopping after 1st match.
Output from switch into change (Set HVAC Mode) with {"hvac_mode":"warm LR"}, {"hvac_mode":"heat}
I am using a join to get result from change and thermostat current state.

This is where I am stuck. Not sure how to do something like
if Set HVAC Mode Value & Downstairs Current State Check are ==, do nothing, else, call a change to hvac_mode. Does this make sense? Am I heading in the right direction?

Here is what I put together so far. The Davis Outside Tempreture current state node is there just so I can use the inject button. Probably a better way, only there for testing.

[{"id":"2956a07abd1ebff3","type":"tab","label":"Flow 2","disabled":false,"info":"","env":[]},{"id":"24dcc208459be02b","type":"switch","z":"2956a07abd1ebff3","name":"Davis Temp Switch","property":"payload","propertyType":"msg","rules":[{"t":"lte","v":"50","vt":"str"},{"t":"gte","v":"65","vt":"str"}],"checkall":"false","repair":false,"outputs":2,"x":450,"y":240,"wires":[["82ce861517f5824d","6c201baf905224bd"],["82ce861517f5824d","6c201baf905224bd"]]},{"id":"b3cff19df7df3f89","type":"server-state-changed","z":"2956a07abd1ebff3","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":"","halt_if_type":"num","halt_if_compare":"lte","outputs":1,"output_only_on_state_change":true,"for":"1","forType":"num","forUnits":"hours","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":240,"wires":[["24dcc208459be02b"]]},{"id":"c55209156186b147","type":"api-call-service","z":"2956a07abd1ebff3","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":120,"wires":[[]]},{"id":"346c6ca83eb13b60","type":"debug","z":"2956a07abd1ebff3","name":"Set HVAC Mode Value","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":680,"y":180,"wires":[]},{"id":"81db6f544f91ebd9","type":"api-current-state","z":"2956a07abd1ebff3","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":330,"y":160,"wires":[["24dcc208459be02b"]]},{"id":"4b4fb796e7df1080","type":"inject","z":"2956a07abd1ebff3","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":100,"y":160,"wires":[["81db6f544f91ebd9"]]},{"id":"82ce861517f5824d","type":"change","z":"2956a07abd1ebff3","name":"Set HVAC Mode Value","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"hvac_mode\":\"warm LR\"}","tot":"jsonata"},{"t":"set","p":"payload","pt":"msg","to":"{\"hvac_mode\":\"heat\"}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":680,"y":240,"wires":[["346c6ca83eb13b60","e105458c0bb9a5de","adddc143bd466140"]]},{"id":"e105458c0bb9a5de","type":"api-current-state","z":"2956a07abd1ebff3","name":"Downstairs Current State Check","server":"9ff7fca303cf2b25","version":3,"outputs":1,"halt_if":"","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":"payload","propertyType":"msg","value":"payload.attributes.{\"preset_mode\":**.preset_mode}","valueType":"jsonata"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":950,"y":240,"wires":[["e36cebbd280ecb0d","adddc143bd466140"]]},{"id":"e36cebbd280ecb0d","type":"debug","z":"2956a07abd1ebff3","name":"Downstairs Current State Check","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1050,"y":180,"wires":[]},{"id":"6c201baf905224bd","type":"debug","z":"2956a07abd1ebff3","name":"SW","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":570,"y":60,"wires":[]},{"id":"adddc143bd466140","type":"join","z":"2956a07abd1ebff3","name":"Join mode set & current state","mode":"custom","build":"merged","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":1070,"y":320,"wires":[["095edcbfd3189733"]]},{"id":"095edcbfd3189733","type":"debug","z":"2956a07abd1ebff3","name":"Join Result","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1050,"y":380,"wires":[]},{"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}]

Here's what I was intending:


Here's the explanation:

  1. The "Set warm LR" and "Set home" just set "msg.preset_mode" for use later - which one is used depends on the temperature.
  2. I don't know if you can read the current preset mode, so assuming you cannot:
    • The last preset mode is going to be stored in a flow variable called flow.last_preset_mode.
    • The "Present changed" node compares msg.preset_mode to flow.last_preset_mode - the first time around the latter will not exist, so it will be different and go on to the next node.
    • The "Store preset" copies msg.preset_mode to flow.last_preset_mode for future runs.
    • On future runs, if msg.preset_mode now matches flow.last_preset_mode it will bail out.
    • This code assumes that your "turn off" code also deletes flow.last_preset_mode.
    • I've also put in an "Otherwise" in the "Preset changed" node because I find that switch nodes with only one condition look too much like a change node and confuse me visually.
  3. Alternatively, if you can read the current preset mode, the above two nodes can be replaced with one similar in logic to the next "Heating" node.
  4. The "Heating" node reads the current mode and if it's not "heat" it turns on the thermostat and sets it to heat mode. Note that I deleted the outputs from this node so they don't mess with subsequent nodes.
  5. The "Set Preset" node sets the preset to whatever is in msg.preset_mode.

Note that I cannot test this code because I don't have an HVAC I can control this way.

Here's the code:

[{"id":"c6d6c20246588647","type":"server-state-changed","z":"2956a07abd1ebff3","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":"","halt_if_type":"num","halt_if_compare":"lte","outputs":1,"output_only_on_state_change":true,"for":"1","forType":"num","forUnits":"hours","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":180,"y":480,"wires":[["8a1e6ad9247134c6"]]},{"id":"8a1e6ad9247134c6","type":"switch","z":"2956a07abd1ebff3","name":"Davis Temp Switch","property":"payload","propertyType":"msg","rules":[{"t":"lte","v":"50","vt":"str"},{"t":"gte","v":"65","vt":"str"}],"checkall":"false","repair":false,"outputs":2,"x":450,"y":480,"wires":[["cb864827be559cfd"],["c0de988cf3a2abbc"]]},{"id":"cb864827be559cfd","type":"change","z":"2956a07abd1ebff3","name":"Set warm LR","rules":[{"t":"set","p":"preset_mode","pt":"msg","to":"warm LR","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":650,"y":460,"wires":[["b66b05c6919c8cf6"]]},{"id":"c0de988cf3a2abbc","type":"change","z":"2956a07abd1ebff3","name":"Set home","rules":[{"t":"set","p":"preset_mode","pt":"msg","to":"home","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":640,"y":500,"wires":[["b66b05c6919c8cf6"]]},{"id":"b66b05c6919c8cf6","type":"switch","z":"2956a07abd1ebff3","name":"Preset changed ?","property":"last_preset_mode","propertyType":"flow","rules":[{"t":"neq","v":"preset_mode","vt":"msg"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":850,"y":480,"wires":[["4e6970c2aac82f42"],[]]},{"id":"4e6970c2aac82f42","type":"change","z":"2956a07abd1ebff3","name":"Store preset","rules":[{"t":"set","p":"last_preset_mode","pt":"flow","to":"preset_mode","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":270,"y":620,"wires":[["43e6f24b58a68749"]]},{"id":"43e6f24b58a68749","type":"api-current-state","z":"2956a07abd1ebff3","name":"Heating ?","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":[],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":440,"y":620,"wires":[["3c3966bebd89d6a0"],["82e62d68d22f7091"]]},{"id":"3c3966bebd89d6a0","type":"api-call-service","z":"2956a07abd1ebff3","name":"Set Preset","server":"9ff7fca303cf2b25","version":5,"debugenabled":false,"domain":"climate","service":"set_preset_mode","areaId":["downstairs"],"deviceId":["cf64ea11fdf974e38a88fe87ae4a1408"],"entityId":["climate.downstairs"],"data":"{ \"preset_mode\": preset_mode }","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","output_location":"","output_location_type":"none","x":890,"y":620,"wires":[["a88909267704129e"]]},{"id":"a88909267704129e","type":"api-call-service","z":"2956a07abd1ebff3","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":1050,"y":620,"wires":[[]]},{"id":"82e62d68d22f7091","type":"api-call-service","z":"2956a07abd1ebff3","name":"Turn on","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":600,"y":680,"wires":[["72234c91ab0f8613"]]},{"id":"72234c91ab0f8613","type":"api-call-service","z":"2956a07abd1ebff3","name":"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":730,"y":680,"wires":[["3c3966bebd89d6a0"]]},{"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}]

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.