Power meter usage: persistent data gap

Hey!

i have created a page similart to the demo temp page.

Now if have adapted the configuration to my needs, but the diagram is missing monday stats.

my used persistence service is influxdb2. the data for all mondays exist in the database.

here is my code from the page:

config:
  chartType: isoWeek
  label: House Usage
  period: W
  sidebar: true
slots:
  grid:
    - component: oh-chart-grid
      config: {}
  legend:
    - component: oh-chart-legend
      config:
        bottom: bottom
        orient: horizontal
        show: true
  series:
    - component: oh-aggregate-series
      config:
        aggregationFunction: diff_first
        dimension1: isoWeekday
        gridIndex: 0
        item: SmartMeter_10180
        lineStyle:
          opacity: 0.5
          type: dotted
        markLine:
          data:
            - type: average
        name: Verbrauch Woche zuvor
        offsetAmount: 1
        offsetUnit: week
        service: influxdb
        smooth: true
        type: bar
        xAxisIndex: 0
        yAxisIndex: 0
    - component: oh-aggregate-series
      config:
        aggregationFunction: diff_first
        areaStyle:
          opacity: 0.2
        dimension1: isoWeekday
        gridIndex: 0
        item: SmartMeter_10180
        lineStyle:
          width: 3
        markLine:
          data:
            - type: average
        markPoint:
          data:
            - name: min
              type: min
            - name: max
              type: max
        name: Verbrauch aktuell
        service: influxdb
        smooth: true
        type: bar
        xAxisIndex: 0
        yAxisIndex: 0
  title:
    - component: oh-chart-title
      config:
        show: true
        subtext: Sampled every hour
        text: Average Usage [Wh]
  toolbox:
    - component: oh-chart-toolbox
      config:
        presetFeatures:
          - saveAsImage
          - restore
          - dataView
          - dataZoom
          - magicType
        show: true
  tooltip:
    - component: oh-chart-tooltip
      config:
        confine: true
        orient: vertical
        show: true
  xAxis:
    - component: oh-category-axis
      config:
        axisPointer:
          handle:
            backgroundColor: blue
            show: true
          label:
            backgroundColor: "#2196f3"
            show: true
          snap: true
        categoryType: week
        gridIndex: 0
        monthFormat: default
        weekdayFormat: default
  yAxis:
    - component: oh-value-axis
      config:
        gridIndex: 0

Hello. Could you solve this issue?

I had the same issue and played with the offset unit. For displaying eg my monthly chart (1 bar for every day), I’ve set the offsetUnit to hour. For daily charts, I use minute.

No I didn’t solve the issue. I tried several configurations without success.

I can solve it for the actual data, but not for data of the previous week:
changes for actual usage:
offsetAmount: 1
offsetUnit: hour
aggregationFunction: diff_last

Because the offsetAmount is offcourse already in use for the graph of last week, this can’t be done twice here.

And this is working in the demo graph because they don’t use the aggregation function difference.
There are other topics about this subject, and this is not an OH issue, but a standard behavior.

Maybe just a checkbox use last data before time range would solve this issue.

At the moment the only way to resolve this issue is not to use the energy readings with diff_first but calculate consumptions over rules from the energy readings and sum them up in the graphs.

Would it actually help if there would be an additional value at Monday, 00:01am?

Hello @crnjan . Could you take a look at this topic? For energy visualisation we really need a proper solution here. Thanks!

Please check Aggregate using diff_first or diff_last will leave a gap at first entry · Issue #912 · openhab/openhab-webui · GitHub and let me know the results, thank you!

If you use diff_last then you need 2 entries for calculation. Assuming you draw a day chart you need to query wider data range - that day + some time before that day (depending on data density), otherwise your first entry have no reference to calculate diff.

yes, that is now being solved with boundary=true when requesting datapoints in case of diff_last, more details should be avail in git issue above …

@crnjan Thank you very much for the fix!
@cweitkamp Can you please check the fix and compare it with your Volkszaehler values.

I will try to check it next week as I do not have enough data yet, as I have set up everything from scratch last week.

I tested the changes. See my results here.

1 Like