Hi all
Please help me to build a statistics card that shows the average number of Processor restarts per week/month etc.
I thought I should use the statistics card but the sensor does not show up to select.
Anyone help?
Hi all
Please help me to build a statistics card that shows the average number of Processor restarts per week/month etc.
I thought I should use the statistics card but the sensor does not show up to select.
Anyone help?
Statistics card may be only used for entities with Long term statistics gathered (LTS).
When configured in UI (not in yaml), an “Entity” selector is filled only by entities with LTS.
If your entity is not there - probably it does not have LTS stored.
Go to Dev tools - State, select this entity and check if it has “state_class” defined (should be “measurement”, “total” or “total_increasing”).
If your entity does not have defined “state_class”’ - try to set it manually via “customize” (yaml only):
homeassistant:
customize:
sensor.xxx:
state_class: xxx
Guess “total_increasing” would be a proper class for “number of starts”.
Do not set attributes in Dev tools - State. Use customize in yaml as I said.
Or are you showing me a result of your customization in yaml? Then these quotes around a value should not be there.
Hi Ildar, I have added the state_class to configuration.yaml
Unfortunately the sensor still does not show up in the statistics card. Any guidance what I am missing?
You should either reboot HA or reload integrations (for you simpler reboot)
I did restart HA as part of your guidance but for some reason this sensor does not show up in the dropdown list
Wait at least for an hour after a reboot.
But imho this sensor should be selectable in this card right after reboot.
Just in case: go to “Dev tools - State” and check if this sensor got a valid state class.
Checked again
State class is set to “total_increasing” for the sensor (shows in Dev tools - State)
sensor.compressor_number_of_starts_eb100_ep14_31535 is still not shown using the Mushroom Statistics card. Many other S1155 entities show up nicely, this one does not.
Have you ever mentioned that it is a custom card???
Take a standard Statistics Graph card and try to add this entity.
If it is not present in a dropdown list - remove quotes from «customize” just in case.
Just noticed that you even used different quotes… get rid of them.
And check your log - if it contains anything about this entity.
Thanks for all your help, I am getting there. I removed the quotes. Now the sensor shows up in the Statistics card. Now I would like to display the average number of restarts per month or year but that number does not show. It says “0”. Mean/Min/Max is greyed out.
You said that this entity is “number of runs”. This is a constantly increasing value. That is why I suggested you to set total_increasing. Min/max are not applicable things for a constantly increasing value.
Correct, the entity is indeed an increasing number for which I would like to calculate the average increase per month based upon the historical data
Average values are not calculated for total and total_increasing.
What you can try to do is changing state class to measurement:
But not sure that mean/max/min has any sense for a constantly increasing value.
I made all the changes, now I get the actual number, not the average number for a specific timeframe (week/month/year). I guess this requires some custom code?
Since you entity became “LTS supporting” and now LTS is gathered - then standard cards (Statistics graph & Statistics) should process this entity based on it’s state_class w/o additional coding. But if you are trying to use some custom card - no idea…
Can you test with “day”?
Since you got data only for a day - then may be it does not show data for week?
I am not using this card, only guessing…
That could be, if the statistics configuration first needs to build up data over time to show the values for week/month/year, I assume you are right that I need to wait.
The value for “day” shows indeed the current number. I will let it collect data and revert back in one week. Thanks.