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
Bug: points_per_hour
artificially creates "fake" data points
#1007
Comments
This is not a bug. This is called “interpolation”. |
Sorry Ildar, I respect your work and the support you give on the forum A LOT, but you are not objective if you think this is a feature and not a bug. The point of this points_per_hour is to reduce system load. Clearly, for this function to work properly, it should never ever create additional work load by creating additional data points. It should always be upper limit and not forced. So, a sensible implementation would either be Since b) is very complicated, a) is the reasonable approach. |
I absolutely have no intention to offend you. I would be happy to have an option like ”use raw data without processing”. There was a FR for this, but it was postponed like “needs a design change”. |
Yes, use raw data is a valid alternative also. So evenly spreading data points is probably the least ideal approach to solving the issue. A better approach is grouping in means or grouping around delta values. A raw data option would make most sense if combined with piints per hour in a "simple" I love the look and slickness of mini-graph-card. I just feel that it lacks the ability for representing the data. |
Agree. For me, displaying raw data (with "step" transitions) will make this card 100% useful... |
As a conclusion: I propose to convert this issue into a FR, may be even 3 separate FR:
|
Then show a standard Defining a high value (at least equal to a real freq) for |
I've done some further digging this is more complex than I thought. Many entities do not record values if the values have not changed. That makes a lot of sense for performance and storage reasons as values that don't change seem redundant. However once a value actually changes, there's a large gap between the data points. There's no good way to plot this unless you know the update frequency of the entity. On a side note - it seems that home assistant once linearly interpolated the data points but this behaviour was changed with home-assistant/core#10590. History (roughly the same time period): Coming back to the 'ugly graph' - it's easy to see in history graph explorer why spline or linear interpolation is not a good way to plot both "Outdoor" = pm25 and "Indoor" = "U.S. Air Quality Index" of the same time period. The blue line just before the peak of pm25 is incorrect and only stepped interpolation makes sense here. This is because (in this case) esphome does not send unchanged values (by default unless a heartbeat filter is used). And I believe home assistant also does not record unchanged values in the data base. So there's essentially no way to tell at what time the value was last at 0 right before the first value of the peak. For entities that update regularly (do not skip recording values if unchanged) but in large intervals - I think linear or spline interpolation does make sense as that may more accurately represent the measured reality (ie air temperature does not change in steps). There's a lot of low power zigbee devices that only update sporadically or when a value has changed that could benefit from a representation of the interpolated (linear or spline) raw data. Currently the only way I see to make a mini-graph-card of data points with large intervals and big changes NOT show the steps given by home assistant is to under-sample the data using points_per_hour or group_by - which greatly reduces the fidelity of the graph. So I guess - as a FR: having the option to display raw data with configurable interpolation would be nice in some cases but incorrect in others. |
Here I stopped reading since this is not a standard card which was requested. |
Updated my previous response with a screenshot of the history (I assume this is equivalent to the history card but makes it easier to adjust the time period). All I'm saying is that after some more investigation, mini-graph-card does plot the sparse data more accurately than if it was interpolated (see incorrect blue line History Graph Explorer's default spline interpolation in my previous reply). |
@filmkorn The Since The "enriched" SUPERSET allows to mimic a stepline method. So, using high Imho the best solution could be supporting "actual data" (#366, #126, #538) - along with added "stepline" method (no dedicated FR so far). As for you graphs: Imho the "history graph explorer" graph is "ugly" since it is not as accurate as |
Completely agree with you. To explain why I stumbled across this 'bug' report - I was trying to have a smooth / subsampled representation of the 'US air pollution indeex' (upper line) while keeping the accurate spike in pm25. This doesn't seem possible at the moment as the only way to do this is using the raw data and interpolate it vaguely like history graph explorer. But - like you said -
And I fully agree. The spline before the spike of pm25 is simply wrong as I wasn't slowly burning butter on the pan starting midnight for several hours like the h-g-e would suggest. This is because in this case as the raw data cannot be accurately linearly or bi-linearly interpolated. So having the option to limit the array to the raw data and not create an 'enriched SUPERSET' is pointless in my particular case. |
Imho (said it already) this is not called a "bug" since the "enriched SUPERSET" is a "designed thing".
I do not think I understood this expression... |
This is my preferred option as m-g-c does look much nicer than other cards. I don't want to use a mix of history-graph and m-g-c on the same dashboard. Here's my three feature requests for m-g-c:
That said, I don't care enough about this to bother making feature requests. |
I am sorry, this thread should not be closed. Nothing is completed. So the user has to chose between "loss of information" or excessive system load. Please read my posts before closing as those issues are not resolved and the card remains unusable for real data tracking until it is. It is just a "fun", pretty card with absolutely no data analysis usability. |
I may reopen, no problem. If #366 will be implemented - then we'll have 2 options: |
Hello Ildar, they are fake because if the data point is at 7 pm and the card creates one at 8 pm, then that data point is fake. If, e.g. your PowerDelta is 20, then you might not get an updated value for 2 hours. That does not mean that the value remained the same. It means that it did not change significantly enough. So it is not a feature. And it makes no sense either. Creating lots of fake data points does not result in a better fit. That is simply false. If you want a better fit then you need more fit options. Fake data points are not that. The best representation is always the maximum of data points. Any fake additional points will be biased and less accurate. The best approach would be a setting that lets you specify an upper limit. |
Assume a device is polled every XX minutes. Answer: no, it is an acceptable assumption. Repeat the 100th time: nobody says the current method is 100% true; one more #366 method should be added - as an addition, not a replacement. But then BOTH methods will be an assumption ANYWAY. |
Hello everyone,
I am new to this card but noticed that the feature
points_per_hour
artificially creates data points of the value is above the real value.So if the database contains 20 data points in hour x but you set
points_per_hour
to 40, mini-graph-card will create 20 "fake" data points and create unnecessary system load.A lot of entities (almost all of mine) update on value change and not on time basis. So it is not possible for the user to know how many points a given hour will have.
As mini-graph-card access the database and "knows" how many points there are in one hour, would it be possible to update the function to use
points_per_hour
as an upper limit rather than a forced absolute?Thank you for your consideration. :)
Alex
The text was updated successfully, but these errors were encountered: