Node Red and Heating Schedule(presence/time based)

What I am trying to accomplish is if my wife or a guest is home turn on the heat based on a schedule. The reason I do not like the above is because I need to repeat this 11 times for each thermostat in the house that has a different schedule and different rules as to whether or not I care about guests.

It cannot fire every 5min etc because I want to allow manual override at the thermostat.

Main Question I have is there a better way to do the above? Mainly the beginning where I have to check if my wife is home and iif not do we have guests? Then since I want it to fire even if she is not home and then I toggle the guest switch it still needs to turn the timer(heat) back to auto.

[{"id":"a72ba67e43e73206","type":"server-state-changed","z":"c89d915bdff0f798","name":"","server":"","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":["input_boolean.guest_mode","person.chandra"],"entityidfiltertype":"list","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"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":"$entities(\"person.chandra\").state != \"home\" and $entities(\"input_boolean.guest_mode\").state = \"off\" ? \"off\" : \"auto\"","valueType":"jsonata"}],"x":278,"y":976,"wires":[["1ab6a1df6b76adc0"]]},{"id":"254b4b99c459caea","type":"trigger-state","z":"c89d915bdff0f798","name":"","server":"","version":2,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityid":["input_boolean.guest_mode","person.chandra"],"entityidfiltertype":"list","debugenabled":false,"constraints":[{"targetType":"entity_id","targetValue":"person.chandra","propertyType":"current_state","propertyValue":"new_state.state","comparatorType":"is_not","comparatorValueDatatype":"str","comparatorValue":"home"},{"targetType":"entity_id","targetValue":"input_boolean.guest_mode","propertyType":"current_state","propertyValue":"new_state.state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"off"}],"inputs":0,"outputs":2,"customoutputs":[],"outputinitially":false,"state_type":"str","enableInput":false,"x":274,"y":1072,"wires":[["6739acbe036aa668"],["4bcdf7714a2ff76d"]]},{"id":"6739acbe036aa668","type":"change","z":"c89d915bdff0f798","name":"off","rules":[{"t":"set","p":"payload","pt":"msg","to":"off","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":582,"y":1072,"wires":[["5f9c6ce16ede78a4"]]},{"id":"4bcdf7714a2ff76d","type":"change","z":"c89d915bdff0f798","name":"auto","rules":[{"t":"set","p":"payload","pt":"msg","to":"auto","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":582,"y":1120,"wires":[["5f9c6ce16ede78a4"]]},{"id":"35332f63137c4ed8","type":"link in","z":"c89d915bdff0f798","name":"heat schedule","links":[],"x":138,"y":880,"wires":[["457560890777dcb8"]],"l":true},{"id":"5f9c6ce16ede78a4","type":"link out","z":"c89d915bdff0f798","name":"to heat schedule","mode":"link","links":[],"x":774,"y":1072,"wires":[],"l":true},{"id":"457560890777dcb8","type":"debug","z":"c89d915bdff0f798","name":"Heat Schedule/Temp","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":348,"y":880,"wires":[]},{"id":"1ef2f44620e232e3","type":"comment","z":"c89d915bdff0f798","name":"example 1","info":"","x":124,"y":928,"wires":[]},{"id":"634cd81f6a293e73","type":"comment","z":"c89d915bdff0f798","name":"example 2","info":"","x":124,"y":1024,"wires":[]},{"id":"1ab6a1df6b76adc0","type":"link out","z":"c89d915bdff0f798","name":"to heat schedule","mode":"link","links":[],"x":604,"y":976,"wires":[],"l":true}]

thanks, quite simple. In between I came up with this…

I’ll change it a bit to use the state_changed node you did, not sure if it was my recent updating(everything was 2yrs old) or I just didn’t notice the list option.

That helps a lot, Thank you.

Final Form(few more rooms to add). The triggers will be moving to Presence flow so they can be used on other flows.

Can you export you entire flow?
I think at least the call service nodes can be made dynamic and maybe also the temp nodes.

i couldnt figure out how to post the code without it being 1000s of lines… aka not sure how to do a one line code box

you make a line with ``` before and after the code.
You can mark the text too and click the </> icon, but make sure there is a blank line before and after included in the markings or it will be marked differently.