Save data through reboot

I have an alarm clock, that is set using a combination of two sliders (hours and minutes). It works great. The problem is that if I restart HA or if my pi reboots, then the sliders reset to their default values. How can I get the slider values to be persistent through a restart of HA?

i can think off 2 options:

  1. you write a pyscript that sets the values after reboot and you call that script after restarting hass.
  2. you install appdaemon to do that and many other things for you.