Temperature monitoring for watering system

Hello,

I am fairly new to Home assistant and could use some help.

I start saplings from seed in a greenhouse. I have got misting cycles (which keep the foliage from drying out) set up and working well. This takes lux from an outdoor sensor and temp from open weather and has 8 options that execute from one of 3 misting scripts. Hotter weather and cloud cover effect evaporation rates.

I am trying to figure out watering cycles which would be when you soak the soil. Seedlings are grown in trays too small to get a moisture sensor in the soil (which is how I water them once they get transplanted into larger containers)

The way I manually water the saplings now is I take the sum of temperatures for several days. When that sum is greater than one 100 degrees Celsius, I manually run a script which waters for 5,7.5 or 10 minutes. Less days between cycles (hotter average temp) the longer the water cycle.

Here is what I don’t know:

-How to record the max temperature for the day (which I would take at 16:00)
-How to sum the temperatures up
-How to record the last watering day
-How to sum the number of days since last watering
-How to reset all counts when a watering cycle is complete

Can anyone help me out with this?

Thanks