How to keep the state of a template sensor after restart HA

Hi,

I have a question regarding the new template sensors. I have the following code:

- trigger:
    - platform: numeric_state
      entity_id: sun.sun
      attribute: elevation
      above: 24
  sensor:
    - name: "Sun above 24 deg"
      state: "{{ now() }}"

After a restart of Home Assistant, the state of the sensor is gone. Is there a way to keep this persistent?

Make an automation which is triggered by the sun elevation and set an input_number.
(I hope that this solution is independend of the posting date)