[RM] Save variable in rule for use later

Is there a way to save a variable at runtime that can be referenced the next time the rule is run?

What I am trying to do is set my thermostat / TRV temperature when a window or door opens/closes. In itself that is easy, but I want to increase/decrease temperature based on the current heatSetpoint and not use a static temperature.
Currently in ST I set static temperatures. But that has the drawback if wifey manually sets the heatSetpoint on the thermostat then a windows open and close sets it back to my static temperature. So, I want to set the temperature back to what it was before the automation kicked in.

Here an example:
My thermostat is set to 20 degrees celsius when the window is closed. When the Window is opened it should either be decreased by 10 degrees or set to a static low temperature. Now, when the window closes again it should be set back to 20 degrees, whereby that 20 degrees could have been set to 18 manually before the window opened in which case closing the window should set it back to 18 degrees where it was before the window was opened.
Basically I want to save the current state (heatSetPoint) when the window is opened and reset it to that value when it is closed again.

Another issue I would like to avoid is when the hub didn't register that the window open (and therefore is still at 20 degrees) and closing it increases that by 10 again to 30 degrees.

So, I would like to add some conditions or limits to avoid a cold house or even having a sauna. :wink:

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.