Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Long term statistics #36

Open
mnordstr opened this issue Sep 17, 2021 · 2 comments
Open

Long term statistics #36

mnordstr opened this issue Sep 17, 2021 · 2 comments

Comments

@mnordstr
Copy link

Hi,

The new version on Home Assistant supports long term statistics. This would be an excellent feature for the ruuvi sensors:
https://developers.home-assistant.io/docs/core/entity/sensor#long-term-statistics

Is this already supported? I can't seem to add my ruuvi sensors to a history graph.

Regards,
Mattias

@sergioisidoro
Copy link
Member

I think we might need to upgrade somethings to the latest version of HA. let me see what I can do.

@sergioisidoro
Copy link
Member

sergioisidoro commented Jan 17, 2022

I found what needs to be done. We just need to add the correct self._attr_state_class to the entity class.

Home Assistant has support for storing sensors as long-term statistics if the entity has the right properties. To opt-in for statistics, the sensor must have state_class set to one of the valid state classes: measurement, total or total_increasing. For certain device classes, the unit of the statistics is normalized to for example make it possible to plot several sensors in a single graph.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants