Newbie question: how to calculatet monthly values

Hi,
I am relatively new to home assistant and got stuck with a simple task. Hopefully some can help me.
Problem;
I have a helper wich is a counter value that counts the number of defrosting of my heat pump via an automation. This value increases over time now.

How do I show statistics of that value?
I would like to get the number of defrosting per month / per year and so on.
How can this be done?

All help is welcome!
Thanks.

Statistics graph card?

Counters do not store LTS (long term statistics).

Follow your counter value with a template sensor helper.

State:

{{ states('counter.your_counter_here') }}

Make sure it has a state_class of total_increasing and some sort of unit of measurement (anything) so that it generates long term statistics.

You can then use the statistics graph card.

Or you can feed the template sensor to a Utility Meter helper with a monthly cycle if you need to use the value in your automations.

1 Like

For a counter that always increases, you’d want a state_class of total_increasing to generate the appropriate statistics.

1 Like

Yes indeed. Good catch. I’ve corrected the post.

1 Like