Input_number - interogate its previous value

I have an input_number which is set to zero when a switch becomes ‘unavailable’. When the switch becomes available again I want to revert the input_number back to the previous value.

I can see a way to do this by using another input_number which stores the old value but is there a more elegant solution using (for example) History?