Aggregated Charts Bug

Hi all,

I’m experiencing issues with aggregated chart data, particularly the SUM function.

I’m currently measuring my power consumption in kWh once a minute. If I aggregate 60 values, I get the power consumption in kWh for one hour. If I aggregate 60 values for 24 hours, I get the power consumption for a single day. I’ve manually checked the values and they are correct.

Now, I want to create a chart with aggregated data using the sum function. Looking at weekly data, the energy data is correct:

Changing to monthly data, which is showing the same days, it is not:

For example, the weekly chart says I consumed 4.15kWh yesterday which is correct. When I switch to monthly and look at the same day, it says I consumed 0.27kW, which is not the sum of all values on that day (verified manually that it is 4.15kWh).

Am I missing something or is this a bug?

Thanks,
Florian

would you mind sharing your yaml and oh version you are using?

I’m on OH 3.4.3.

config:
  label: Power Consumption (Daily)
  order: ""
  sidebar: false
  chartType: month
slots:
  grid:
    - component: oh-chart-grid
      config:
        bottom: 80
        top: "120"
  legend:
    - component: oh-chart-legend
      config:
        bottom: "3"
        show: true
  series:
    - component: oh-aggregate-series
      config:
        dimension1: date
        gridIndex: 0
        item: Shelly_Pro_3EM_EnergyCounter
        itemStyle:
          opacity: 0.3
        name: Power Consumption (Month Before)
        offsetAmount: 1
        offsetUnit: month
        smooth: true
        type: bar
        xAxisIndex: 0
        yAxisIndex: 0
        aggregationFunction: sum
    - component: oh-aggregate-series
      config:
        areaStyle:
          opacity: 0.2
        dimension1: date
        gridIndex: 0
        item: Shelly_Pro_3EM_EnergyCounter
        lineStyle:
          width: 3
        markLine:
          data:
            - type: average
        markPoint:
          data:
            - name: min
              type: min
            - name: max
              type: max
        name: Power Consumption (Current)
        smooth: true
        type: bar
        xAxisIndex: 0
        yAxisIndex: 0
        aggregationFunction: sum
  title:
    - component: oh-chart-title
      config:
        show: true
        subtext: Sampled every minute
        text: Monthly Power Consumption
  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: month
        gridIndex: 0
        monthFormat: default
        weekdayFormat: default
  yAxis:
    - component: oh-value-axis
      config:
        gridIndex: 0
        name: kWh


This chart also uses the sum aggregation:

Interestingly, I updated OH on April 22 from 3.4.2 to 3.4.3. My gas consumption has not changed since 22nd, neither did the calculation. That’s why I suspect a bug that was introduced with the latest OH update. I just do not know how to verify whats going on.