Question about how to make code resume with power failure

I have the code written for my outdoor hydroponic pump control using an esp32 with 4 port relay switch. What i am trying to figure out is how to code it so if power die it will resume. I have 3 total automations that are built with the logic at 6am check the daily max temp and then run one of the 3 automations based on the temp range to control the off duration of the pump. what i am trying to solve is how to make this resume in power failure.

alias: HydroSW001 Control for 80.1 And Up
description: ""
trigger:
  - platform: time
    at: "06:00:00"
condition:
  - condition: numeric_state
    entity_id: sensor.home_realfeel_temperature_max_today
    above: 80.1
    below: 130
action:
  - repeat:
      sequence:
        - type: turn_on
          device_id: e8c6b5e14438dea9f36bf75ba67bf5b7
          entity_id: 45d3926edf1cfd4fbcbac08818132f2b
          domain: switch
        - delay:
            hours: 0
            minutes: 15
            seconds: 0
            milliseconds: 0
        - type: turn_off
          device_id: e8c6b5e14438dea9f36bf75ba67bf5b7
          entity_id: 45d3926edf1cfd4fbcbac08818132f2b
          domain: switch
        - delay:
            hours: 0
            minutes: 15
            seconds: 0
            milliseconds: 0
      while:
        - condition: time
          after: "06:00:00"
          before: "19:00:00"
          weekday:
            - sun
            - mon
            - tue
            - wed
            - thu
            - fri
            - sat
mode: single

Add an second trigger for restart, and mirror your while condition in the main condition block to avoid running outside the desired time period.

Thanks for the reply this resolved the issue thanks