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

Improve sensor graph algorithm #2069

Merged
merged 1 commit into from
Nov 20, 2018

Conversation

kalkih
Copy link
Contributor

@kalkih kalkih commented Nov 19, 2018

As discussed in #2064

The current calculation of the graph is flawed, the data points are just spread out over the x-axis and doesn't take the actual time of the history entry into account. Works fairly well for sensors that update regularly but not for sensors that updates sporadically or sensors that fluctuate a lot.

This PR includes a rework of the graph calculation algorithm which now calculates the data points based on time and plots them out accordingly. Would have to replace the accuracy option with something like detail: 1 or 2, 1 for one point every hour, 2 for one point every 10 minute.

The new implementation will also assign the data points with a moving average for that hour/ten minutes, instead of just the value of a single history entry, which should result in a better representation of the actual history.

Should solve these issues:
#2038
#2010

@balloob balloob merged commit 07cf114 into home-assistant:dev Nov 20, 2018
@ghost ghost removed the in progress label Nov 20, 2018
@balloob balloob added the Breaking Change Needs Special Documentation to let users know about Change label Nov 20, 2018
@github-actions github-actions bot locked and limited conversation to collaborators Jul 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Breaking Change Needs Special Documentation to let users know about Change cla-signed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants