Suggestions to Improve Node Red Ecobee Flow

Hi guys. I have been so aggravated with my climate in my office. I finally took the time today to build a solution. However, I feel that I could do better and wonder what you all think.

The main thing I don’t like is that I am triggering an update to Ecobee every minute (or however often I check the Office Temp) which I don’t think is necessary.

Basically what I am trying to do is WHEN the office light is on, check the office temp and set the thermostat to either heat or cool based on the temp in the office, and then at some interval monitor the temp and change to cool later if needed. Sometimes the office is cold in the morning but gets hot in the middle of the day. I like 69 degrees of heat and 70 degrees of cool. Ecobee seems to think no one should like that and only lets you set your heat/cool range at 5 degree difference I think.

It would be nice, with this flow I have, to only check the office temp IF the light is on, but do so at an interval. Then, it would be nice to ONLY send a message to the Ecobee if the mode actually needs to change. I tried and googled till my eyes hurt to try to figure out how to do either of these and am stuck.

Any help or tips are greatly appreciated!