There is a sum in the statistics helper but that holds all values in memory. This is useful for a gliding sum of the last n values or m days, but I want the total sum. I.e. each incoming value is to be added to the previous sum value indefinitely. Probably a simple template using some variation of “this”, but I don’t know how.
Danke
What is the nature of the incoming data?
You could probably do what you want with a trigger-based template sensor, but without more information, I am not on a good position to tell you if that’s the best way or how to do it.
Use the delta_values: true
option with no cycle
defined and it will add your sensor values together forever.
Thank you. I had seen that, but not read carefully enough.
It is the value of my solar production. At every 59th minute, shortly before the price changes, I take the difference between the current meter reading and that of an hour ago and multiply that with the current price, which can be negative.