Basic And logic
[{"id":"8873a4ec73fd74e6","type":"inject","z":"120358abd7c22d30","name":"start","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":222,"y":4656,"wires":[["b22adb4aa49dbfaa"]]},{"id":"b22adb4aa49dbfaa","type":"switch","z":"120358abd7c22d30","name":"condition A","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":390,"y":4656,"wires":[["9d2dfd73b55f24bf"],["0b35603e9c945d3d"]]},{"id":"9d2dfd73b55f24bf","type":"switch","z":"120358abd7c22d30","name":"condition B","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":566,"y":4656,"wires":[["cdda14473a7604bf"],["0b35603e9c945d3d"]]},{"id":"cdda14473a7604bf","type":"debug","z":"120358abd7c22d30","name":"both condition were valid","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":806,"y":4656,"wires":[]},{"id":"0b35603e9c945d3d","type":"debug","z":"120358abd7c22d30","name":"one or both condition were invalid","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":836,"y":4704,"wires":[]}]
I don’t fully follow your chart but here’s an example I came up with. I am assuming your temperature and occupancy sensors are in Home Assistant.
[{"id":"e3cd031708f597a1","type":"server-state-changed","z":"120358abd7c22d30","name":"Temp / Occupancy changed","server":"","version":5,"outputs":1,"exposeAsEntityConfig":"","entityId":["sensor.temperature","person.person1"],"entityIdType":"list","outputInitially":false,"stateType":"str","ifState":"","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[],"x":264,"y":4848,"wires":[["af87ee9d39f0c788"]]},{"id":"af87ee9d39f0c788","type":"api-current-state","z":"120358abd7c22d30","name":"current temperature","server":"","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.temperature","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":506,"y":4848,"wires":[["f0a0e0703b73d1dc"]]},{"id":"f0a0e0703b73d1dc","type":"api-current-state","z":"120358abd7c22d30","name":"home?","server":"","version":3,"outputs":2,"halt_if":"home","halt_if_type":"str","halt_if_compare":"is","entity_id":"person.person1","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":674,"y":4848,"wires":[["e664c28638568cd4"],["484ca66eeb05d705"]]},{"id":"e664c28638568cd4","type":"switch","z":"120358abd7c22d30","name":"home set point","property":"payload","propertyType":"msg","rules":[{"t":"lt","v":"68","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":848,"y":4848,"wires":[["b217a53e271806da"],["aeb090080ebb6cdc"]]},{"id":"b217a53e271806da","type":"api-call-service","z":"120358abd7c22d30","name":"turn on","server":"","version":5,"debugenabled":false,"domain":"switch","service":"turn_on","areaId":[],"deviceId":[],"entityId":["switch.heater"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1040,"y":4848,"wires":[[]]},{"id":"484ca66eeb05d705","type":"switch","z":"120358abd7c22d30","name":"away set point","property":"payload","propertyType":"msg","rules":[{"t":"lt","v":"62","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":848,"y":4896,"wires":[["b217a53e271806da"],["aeb090080ebb6cdc"]]},{"id":"aeb090080ebb6cdc","type":"api-call-service","z":"120358abd7c22d30","name":"turn off","server":"","version":5,"debugenabled":false,"domain":"switch","service":"turn_off","areaId":[],"deviceId":[],"entityId":["switch.heater"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1033,"y":4897,"wires":[[]]}]
Personally what I would do is create a generic thermostat in Home Assistant. Do it this way will allow the thermostat component to handle the basic operations, Then use Node-RED to set the target temperature.
[{"id":"193b9d79ca600319","type":"server-state-changed","z":"120358abd7c22d30","name":"Occupancy changed","server":"","version":5,"outputs":2,"exposeAsEntityConfig":"","entityId":"person.person1","entityIdType":"exact","outputInitially":false,"stateType":"str","ifState":"home","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[],"x":394,"y":4368,"wires":[["2cd54accdf85f1fe"],["06080031e75f41ca"]]},{"id":"06080031e75f41ca","type":"api-call-service","z":"120358abd7c22d30","name":"set away temp","server":"","version":5,"debugenabled":false,"domain":"climate","service":"set_temperature","areaId":[],"deviceId":[],"entityId":["climate.heater"],"data":"{temperature: 62}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":611,"y":4417,"wires":[[]]},{"id":"2cd54accdf85f1fe","type":"api-call-service","z":"120358abd7c22d30","name":"set home temp","server":"","version":5,"debugenabled":false,"domain":"climate","service":"set_temperature","areaId":[],"deviceId":[],"entityId":["climate.heater"],"data":"{temperature: 68}","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":608,"y":4368,"wires":[[]]},{"id":"dc734795ada92586","type":"comment","z":"120358abd7c22d30","name":"example 1","info":"","x":372,"y":4320,"wires":[]},{"id":"0d259c86022e23ad","type":"comment","z":"120358abd7c22d30","name":"example 2 - using JSONata and input overrides","info":"","x":492,"y":4464,"wires":[]},{"id":"7a4ce338e7f90833","type":"server-state-changed","z":"120358abd7c22d30","name":"Occupancy changed","server":"","version":5,"outputs":1,"exposeAsEntityConfig":"","entityId":"person.person1","entityIdType":"exact","outputInitially":false,"stateType":"str","ifState":"","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"{\"data\": {\"temperature\": $entity().state = \"home\" ? 68 : 62}}","valueType":"jsonata"}],"x":394,"y":4512,"wires":[["18427503b16928fa"]]},{"id":"18427503b16928fa","type":"api-call-service","z":"120358abd7c22d30","name":"set climate temp","server":"","version":5,"debugenabled":false,"domain":"climate","service":"set_temperature","areaId":[],"deviceId":[],"entityId":["climate.heater"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":608,"y":4512,"wires":[[]]}]
edit: fixed some issues and realized some of the import might not import correctly due to me running a beta version