Helper entities do not support long term statistics as they don't have a state_class

Hi,

I’ve been searching but could not find a very clear answer.
I’ve noticed that my helper entities in Home Assistant do not have long term statistics.
I believe the reason is that for helper entities it is not possible to set the state_class, which is a requirement for enabling such statistics. Sensor entity | Home Assistant Developer Docs

I believe it might be possible (but haven’t tested it) to get it working using the manual customisation feature Home Assistant Core Integration - Home Assistant

I just wanted to check whether my understanding is correct, or whether I’m missing something :slight_smile:
Thanks!

You are half right. Input helpers are not recorded for statistics, because they are intended for manual input and not expected to be used as measurements.
Statistics helpers for example do get the state class measurement, so they are recorded for long term statistics.
You could add a measurement state class to an input helper through customize, that should indeed set them up for LTS, but I too have not tried it.

Thank you for that clarification and context.
I will then try the customisation feature, as I actually would want to have the history of the input I provide in some instances :slight_smile:

Hi quizzical,
Like he said, or you can create a template sensor with the helper as the data source and add a state_class to it I think.

2 Likes

Ah yes that could probably work as well.
Thanks