"Variable" / item to hold past value of "sensor"

Finally, I am getting a good hang of items and sitemaps.
Working with VSCode and Openhab extensions has sped up my understanding and flexibility.

So, now time to step into tougher territories.

How to make variables?

Basically I have several Max! Thermostats. They have an “Actual Temperature” that is not really updated in real time, it is rather updated whenever the Thermostat receives a new command and/or random-ness.
(This is a limitation of Max! Rather than the UI).

But it means that whenever the UI is reloaded, the channel is loaded with a null value.
To prevent that, I want to make some sort of rule?

If Max_Actual_Temp state changed
Max_Actual_Temp_Accumulator = Max_Actual_Temp

Then I want to display the Max_Actual_Temp_Accumulator in the sitemap.

Thanks in advance.

I don’t know, how MAX! Binding works, but items keep their state until they are given a new one, they don’t lose the value, even if the UI is reloaded*). I don’t see, how a channel gets nulled by reading a value from a item.
Please post your items and sitemap files and if you define it via file your Thing file, so we can have a look on it. (please put the files in Code fences ``` - or use on of the Icons on the top right)

…besides that, you are on the right way of understanding proxy items. Their use is needed, if you want something like a state engine or need an item representing something mixed from multiple items or things like that.
you would write a rule:

rule "Temp accumulator"
	Item Max_Actual_Temp changed

provided, you already defined Max_Actual_Temp_Accumulator also as Number like Max_Actual_Temp.

See more on rules:

*) Disclaimer
If you restart OH2/change item files, all items’ states are lost, except you defined a “Keep-items-persisted” in persistence, they will then be recovered if configured in the persistence file.
Items can also loose the values if there are ERRORs or misplaced configuration, but that’s not loading a UI.

Could it be that the states are null’ed because I am editing the sitemap and items?
Maybe it is not the UI but the rebuild of the sitemap that causes it?

of Course! Not Building the sitemap is causing this - but the reloading of the item-file. Everytime an item file gets changed/touched (regardles which one, if you have multiple files), all items get reloaded - and therefore NULLed.