I already thought of that too. However, this sensor is not included there.
I may have to explain the story again.
First I set up the counter described above in the configuration.yaml.
Then I noticed that this also works much easier with a “consumption counter” helper. As a result, I set up such a helper with the same function via the UI - it just had a slightly different name. And since I created both counters at different times, other values ​​were also output.
Since I only need one and I prefer the UI, I deleted one counter in the configuration.yaml.