How do I turn my daily energy values into a total?

I have a few solar panels on my roof and using the great hoymiles integration, I can read my current electricity production, produced energy etc. and other information about the inverter into Home Assistant.

The integration gives the produced energy as “daily sums” (in Wh) which resets to zero during the night. No problem, the sensor has the correct class (total_increasing), so the energy dashboard can calculate the correct values.

What I am struggling with: I want to use the total produced energy since installation in a grafana dashboard alongside my other utility meters (water and gas, which both give the total since installation, not daily values), and I also like to use the total produced energy since installation in other template sensors for calculating savings etc.

How do I turn this daily values (total_increasing) into a new sensor (?) that gives totals since installation?

Similarly to the energy dashboard, I would like to achieve that even if the daily sensor gives no value (e.g. during the night), my new totals sensor shows the current total.
Additionally, I want to have the total value updated on the fly, not every evening or something like that.

I tried using a utility meter and a template sensor, but failed miserably in both instances. I think this can’t be very complex, but somehow I am not able to find what I need to do.

A Utility meter does that if you do not set a reset cycle, so I wonder why you did not succeed. Use the example given in the docs, but leave out the entire line with the cycle. The only downside: it does so from when you create it, it cannot use history.

Thanks, will try again with a utility meter! I think form the docs I was under the impression that either cron or cycle was required, so I tried to put various things in the config.
Will try again without specifying those!

You can create one in the helpers section. Remember it takes some change to the source to start recording.

Thanks, that worked!

Guess me trying to specify a counter reset cycle messed up my values.

Side note: For me, this paragraph in the utility meter docs gave me the impression that either cycle or cron are required (It is unclear to me what happens when you omit cron). But maybe I am misunderstanding something.

Edit: My final utility meter looks simply like this:

stromproduktion:
  source: sensor.dtu_ac_daily_energy
  name: Stromproduktion
  always_available: true
1 Like