Yeah you can clearly see what karwosts is talking about in that graph.
Every time the energy surges upward at all those spikes it adds the energy amount equivalent to the height of the spike. The downward movement does nothing to the total, only upward.
You can create ever increasing energy sensors using the utility meter helper with no cycle defined. Then sum those.
Also an availability template for your new template sensor will be required for preventing this sort of thing if one of the sensors is unavailable. Why an availability template is important for energy template sensors