ESPHome Sprinkler - Seconds to minutes and run_duration Values That Survive a Reboot

In an earlier topic, @lordzid shared this segment of Sprinkler code;

I’m attempting to write something similar but I’m stuck on what to include in the valve section. @lordzid, if you see this posting would you post your entire code so I may see how you handled conversion of seconds to minutes and run_duration under the valve: section of your sprinkler code.

With appreciation