When automating with Home Assistant, you can use elements like:
- input_select to create a picklist
- input_boolean or switch to control a binary input or switch
- input_text to input a text.
- input_number to input a number or any other numeric control
They can be set through the config at be set to initial values. The current state will be reset to the initial value. You can use ha-entity-cache to recover to the last value set. Be aware that Home Assistant already restores certain values at restart.
If you have other properties or attributes you want to make persistent, then have a look at this project.
P.s. when you do not supply an initial value, Home assistant will recover state as well.
See my project that enables caching the state and attributes of custom controls within Home Assistant.