Display of an average in a chart

I measure an electrical power value using a Shelly 3EM device every 30 seconds and I can display this value in a chart.
Additionally, I calculate the avergae value over hour with a rule.This average value is available past the 1 hour period of the measurement values.
When both, the measured value and the average value are displayed in one diagramm, the average value is obviously delayed by 1 hour.
Is it somehow possible, the shift the chart of the average value to the past by 1 hour?

Thanks for your support!

Maybe this How to overlap an offset time series in OH3? (Corelate yesterdays values vs. today) - #6 by ysc

1 Like

Thank you for your answer!
I tried a few differnt settings and I think that also the code is very similar to the reference topic, but the charts are only trunkated but not shifted.
Did I oversee something?

Code and screen shot.

config:
  label: Verbrauch M18 4OG
  sidebar: false
slots:
  dataZoom:
    - component: oh-chart-datazoom
      config:
        show: true
        type: inside
  grid:
    - component: oh-chart-grid
      config: {}
  series:
    - component: oh-time-series
      config:
        color: lightgreen
        name: Series 1
        gridIndex: 0
        item: M18_4OG_Shelly_3EM
        offsetAmount: 0
        offsetUnit: hour
        type: bar
        xAxisIndex: 0
        yAxisIndex: 0
    - component: oh-time-series
      config:
        color: green
        name: Series 2
        gridIndex: 0
        item: M18_4OG_Average_1h
        offsetAmount: 1
        offsetUnit: hour
        type: line
        xAxisIndex: 1
        yAxisIndex: 0
  tooltip:
    - component: oh-chart-tooltip
      config:
        show: true
  xAxis:
    - component: oh-time-axis
      config:
        gridIndex: 0
    - component: oh-time-axis
      config:
        gridIndex: 0
  yAxis:
    - component: oh-value-axis
      config:
        gridIndex: 0
        max: "15000"
        min: "0"

For my example, comparing values of different days works, if chartType is “chartType: day” and “offsetAmount: 1” with “offsetUnit: day”.
Then the values of today and yesterday are shown.

If I have a dynamic chart type, it does not work.

But how should I configure my chart if I want to have two graphs, one delayed by one hour?

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.