Skip to content

Improve sensor graph algorithm#2069

Merged
balloob merged 1 commit intohome-assistant:devfrom
kalkih:sensor-algorithm-fix
Nov 20, 2018
Merged

Improve sensor graph algorithm#2069
balloob merged 1 commit intohome-assistant:devfrom
kalkih:sensor-algorithm-fix

Conversation

@kalkih
Copy link
Copy Markdown
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.

3 participants