Setting a thermostat back to its former temperature setting?

Hi folks,

I currently have an automation where the heating in the bathroom gets turned down to 7°C when the bathroom window is open for a minute (minimum possible temperature setting for this Danfoss LC13 Z-Wave thermostat) and back up again when the window has been closed for five minutes.

Now, when I turn the heat back up I’d prefer to have it set back to the former setting. Would it be possible to save the state from before and set it again? I know the thermostat does not report the current temperature but I’ll be having a separate temp/humidity/pressure sensor in the room soon.

I guess it could be done via a script?

Best,
Axel

You could use an input_number as a temporary variable to set to the current temperature in the room just before turning down the thermostat.