If you don’t want to average the values, then just set a one hour or daily persistence strategy for the Item… no rule needed. Although, most power meters also report a cumulative energy value too, which is probably what you’d want to be viewing. If your meter doesn’t report energy, you’d need a rule to calculate it.
I have a new rrd4j strategy everyHour and i postUpdate the value of the last hour inside a rule to my item every hour. But my chart is empty… Do i have to persist the value everyMinute? So the same value every Minute until i postUpdate a new Value to this item at the beginning of the next hour?
Is this need for the everyMinute strategy really a limitation caused by the simplistic sitemap? Creating a chart for archives with larger timeframes ( i.e. data only for houres or days) is working!
I understood that the version 1 rrd4j persistence service would not persist without that strategy.
I want the value at that time, it was uses. --> When the next hour begins, i want to change the value of the last hour, to get the real value at the real time inside my chart. And a chart-line is the wrong image. I need a bar graph - one bar for every hour - or only 1 value point at the middle of the hour with cahrt-line. But what i get on the included chart, this is not the right thing…
That depends wether the data is shown from an archive keeping the data by minute or by hour. If you show the data from an archive that has only a value per hour it will show the line point of that hour and connect to the next hour point. That may look odd for a couple of days, looking onto 30+ days is looks ok to me ( using such atm).
If you really want a bar display you have to look for other charting possibilities ( habpanel?, grafana).
Well, openhab persistence is geared up to record data for “now”. It would be especially hard to record data from the future.
There are difficult ways to fiddle the data, i.e. record your hourly reading as though it was half-hour earlier. I’m not even sure if you could do that with rrd4j at all though. And I really do not advise ever making “faked” data in general, it’s stupid. This is just a presentation problem.
I think you need a bar-charting solution. The Chart widget is just too (deliberately) simple for this use.
EDIT - cheapskate approach to faking the “look” with simple Chart.
Run a rule on the half-hour. This rule to calculate actual usage over previous half-hour, and predict the next half-hour. At it’s simplest that’s just double. At the fanciest, you look at trends from today and yesterday and last week and the weather forecast etc.
Now record that value and persist every minute until the next half-hour. Any errors you made in your prediction will then get taken care of, but we can’t go back and fix a poor prediction.
Result - a steppy Chart looking like a bar chart centred on the hours.
EDIT - nah, the detail here is rubbish, isn’t it. You need to predict the full hour ahead from the half-past-hour time.