Set Thermostat To Previous MANUAL Temperature

So imagine I set a temperature to 70 on my ecobee thermostat.

I create an automation which turns the thermostat to away mode when I leave, in case I forget. That’s the easy part. It’s also easy to set the thermostat back to home mode when I return, or set a specific temperature when I return.

What I can’t figure out is how to set it back to the LAST MANUALLY SET temperature. Everything revolves around preset modes, but in some cases I want it to ignore presets and go back to the last temperature I was comfortable and set myself. Some days just feel chillier than others.

Any ideas how I could accomplish this?

Thanks!

Store the value in a helper.

That’s where I’m gonna need some help. I realize that the first step is creating a sensor to store the last value I manually set, but I’m not sure how. I am assuming some form of template helper, but I need it to extract the manually set temperature, not any of the temperatures set by all the modes (home, away, etc…). That part, I’m not sure how to do…

The second part of the puzzle is to automate setting the temperature to the value of that helper.

Make an automation that trigger when the temperature is set, but add a condition for mode to only activate on manual.
Then make it do a service call that set the value of the helper equal to the temperature.

I have noticed that when the HVAC mode it set back to the previous mode (I have a Nest Learning Thermostat), it remembers the previously set temperature (whether manually done or not).

I also have an input helper that will store the most recent HVAC mode (Heat, Cool, Heat/Cool) only when it switches to “Off”. Currently as we are empty nestors, part of the time only two of us are here. I have five related automations - two for when each of us leaves, and two for when each of us return. For the automation when each of us leaves, only if the other is not home as well then just turn the HVAC to “Off”. When either of us return, just turn it back to the previous state it had in the input helper for the HVAC mode.

I still ran into an issue anyway. While we are both away it would turn back on and change the temps because I had programmed the nest itself to reset the temp to agreed upon specific values once each hour on the top of the hour (because sometimes people set it to whacky temps by mistake). So, I have a fifth that when the HVAC goes back on, if we are both away, it just immediately switches if back to Off.

If yours does not remember the last manually set temp then you would need an input helper to store the temp that is set each time you change it manually as well. Use the trigger variables to determine if it is set manually when that value is being stored.

Hope this helps