Max value of sensor value over a year

Not sure I can be any clearer; your version performs more work because it will always set the value of the input_number. Several entities will also have their last_updated, last_changed, and last_triggered properties updated.

True, so probably yes, my version takes more resources. I should change to your solution :slight_smile:

I have left the logic as is and it works like a charm. The peak energy stored is already over 100 kWh and it is only April. This is with two EVs regularly charging.

Remember this is a virtual battery. This is how much the meter has been running backwards and thus what I could recuperate for free.

This demonstrates to me that home battery storage does not make sense, too expensive or not enough capacity.