Closed jvcsw closed 2 months ago
I think the comment in https://community.home-assistant.io/t/long-term-statistics-max-value-not-available/423889/4 is valid here.
These energy sensor are implemented as sensors with the energy
device class, which need to have a state class of total
or total_increasing
.
From the Home Assistant Documentation:
Similar to total, with the restriction that the state represents a monotonically increasing positive total which periodically restarts counting from 0, e.g. a daily amount of consumed gas, weekly water consumption or lifetime energy consumption. Statistics of the accumulated growth of the sensor's value since it was first added is updated every 5 minutes. A decreasing value is interpreted as the start of a new meter cycle or the replacement of the meter.
The sensors are using total_increasing
as they reset when the value is lower, which happens at the start of a new periode.
I suspect you want to display the average over a larger period? What you could try is use a helper (template) which uses the state of the energy sensor you want and set the device class to measurement
. But this is untested.
What I want is to always show the maximum value of daily, monthly, annual production in kW.
I don't understand what you are trying to do:
Yes, the h was missing.
I have this (daily peak, daily production, max daily production):
To get the third one I had to create a helper (template) of the "measurement" type. And of course, if it works, but I have to do the same for the weekly, monthly, annual and other integration sensors. Everything multiplies.
Is there a solution? Yes But it would be nice if it were not necessary to create the helpers.
I don't understand what you expect?
Are you asking me to change the sensors against how Home Assistant has documented? Are you asking to create extra entities with duplicate data?
In my opinion this is a feature request for Home Assistant, to make the average, max, mean, ... available for energy sensors with a state class of total_increasing
.
Ok.
I don't know if it's possible, I proposed change the sensors to "measurement" type so that they could be used directly in the statistics cards.
Only sensors that reset, for exemple: Total Current Day Energy.
Describe the bug All numerical sensors do not allow to be used completely in the statistics cards. For exemple, these sensors:
these sensors have the max, min, mean options disabled
In this link there is some explanation, but in this sensors the value returns to 0. https://community.home-assistant.io/t/long-term-statistics-max-value-not-available/423889/3?u=jvsystelab
To Reproduce Create a statistics card and select an entity (from the previos list).
Expected behavior The card can be used as a sensor with all the configuration options
Screenshots Above