-
-
Notifications
You must be signed in to change notification settings - Fork 247
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
Charts is doing strange interpolation if period M or longer is choosen #3025
Comments
Charts for sitemap UIs are generated by the core framework. So it should not be specific to Basic UI. |
The last change of version for XChart (3.1.0) was in OH 3.2. So no recent changes. |
I see that problem is already in OH 4.1.0 and you are right problem seems to be in core framework. I guess problem came up when new sitemap chart period parameter were introduced: openhab/openhab-core@f71ebfb If I generated the chart using period 'M' If I use period '30D' But if I used '31D' it's bad again. @lolodomo Can this issue be moved to core repo or do I have to recreate there? |
I have no rights to do that. |
Me neither as I'm no webui maintainer. 😉 |
@lolodomo I am not sure this a a chart issue. It would be interesting to see if the same issue exists with another underlying database. I suspect it may be an rrd4j issue. There have been a number of PR's recently changing the way data is stored and/or retrieved. See:
|
I have now tried with my production system on OH 4.3, storing the same data in rrd4j and influxdb. I cannot see a noticable difference. For me, all the lines are interpolated, no steps. I tested with period definitions set to: 6M, 2M, M, 31D, 30D, 4W, 2W. There is no difference. |
@der-dag I get you have values stored for the day only once? Do you have some rule that also stores the same value at the end of the day? That could explain this kind of visualisation. As you change chart periods, RRD4J would be reading from another aggregation and may ignore these second stored values. The interpolation between datapoints is always linear. But it just doesn't see the other value anymore, so it is not visualized as a step anymore. openhab/openhab-core#4610 would allow you to configure this. |
@lolodomo Here is another observation. Here is the core default I don't know why that is the case. That may very well be for historic reasons. I don't know if it is used anywhere explicitely, or if it could just be removed. Both may fulfill the component requirements. The RRD4J version seems to not be in sync with the core version, therefore could generate different results. |
In RRD4J I have defined a persistence strategy "everyMinute" for such channels. The value is changed in a "midnight" rule only once a day. I'm using this setup for years now and just observed that my charts looked different after updating OH and then figured out that I could get my (good) old behaviour back if I change chart period from "M" to "30D". Thanks for pointing me to the new interpolation parameter, I'll try that out. |
It's not merged yet, and will only be in OH 5.0.0.
So, it is strange I don't see the same for all my tests. There must be something fundamentally different in our systems.
The test I did was with a You don't have any specific RRD4J configuration impacting these default? |
I have Number items only, no units defined and I guess I have no special RRD4J config, my services/rrd4j.cfg is empty. The only difference between our systems is the changes per day for the items. I have other items that only change once a month and there the charts are fine (with steps) as long as the choosen period is less one year: 365D, 9M are good, 1Y, 2Y are interpolating |
OK, I have been able to reproduce it to some extent with my data, but this time on an hour timescale. If you look at the image, it looks like I have pure steps when looking at 1h (or 60min), and there are some slopes when I look at 2h (or 120min) time setting. Yours only happens on much longer timescales as your data is updated much less frequently. In my reading, this is caused by the way RRD4J is querying the data. It looks at data with a specific granularity and applies a consolidation function on it when returning the results. The granularity and consolidation function depend on the time horizon selected and the item type. The charting tool will only interpolate between data points for Number times at the moment. And while it looks like a step in your example, it is because what is returned from RRD4J has consecutive datapoints with constant value, and then a step. Slightly changing the time selection can force RRD4J to retrieve values with another granularity, leading to different results. The period parameter is converted to a begin- end endate for the query to RRD4J. Also this has an impact. If these dates are more or less aligned to the buckets, the results will be different. The one change that may have impacted your results is indeed the introduction of the period parameter. A You could actually check this without charting by just doing a query on the RRD4J with begin and end dates set, and see what values come back. You can use the REST API or persistence extensions for this. Overall, I don't think this is easy to solve with RRD4J as an underlying DB. I don't see any of this with InfluxDB, that's always interpolated. The interpolation parameter may help for visualization. |
Which UI are you reporting an issue for?
The problem
Just upgraded my openhab from 4.0.4 to 4.3.2 and now some charts are looking strange. I’m using Chart in BasicUI sitemap:
E.g. I have a chart showing the daily gas consumption of the last month. Values are from rrd4j. Every night the value is updated with the consumption of the previous day.
Chart item=Consum_Gas24h period=M refresh=300000
The chart for one month (period=M) now looks like this, somehow it is interpolating:

Expected behavior
If I switch the chart period to show the values of the past two weeks only chart looks as it was in the older openhab versions and in my eyes it is correctly displayed:

Steps to reproduce
Your environment
The text was updated successfully, but these errors were encountered: