Store entity state at specific time

I recently stumbled upon a standardized method to calculate summer / winter for heating purposes.
The calculation looks like this:
T1 = outside temperature at 07:00 / 07:00am
T2 = outside temperature at 14:00 / 02:00pm
T3 = outside temperature at 22:00 / 10:00pm

T = (T1+T2+T3+T3) / 4
Summer = T >= 16

I would like to implement this logic in home assistant and my idea was to store each time specific temperature in its own entity. Then an automation could calculate and set the value of the summer / winter entity once a day.

Is this possible or is there a better approach to this?
Thanks in advance

Trigger-based template sensor:

1 Like

Yes it is possible. Use a triggered template sensor. Trigger it at whatever time you want the calculation done.

Edit: Too slow.

1 Like

Thank you :slight_smile: