Energy consum charts in OH3?

Hi,

I’m starting to setup charts for my OH3. I already run them after reading this topic: OH3: Charts/Graphs/Plots - #2 by rlkoshak

Everything seems to be working well, but I am wonder how to make energy usage charts to be more user friendly. Energy will always increasing. I would like to achieve a bar chart with kWh (or Wh) of usage on Y axis and hours, days, months on X axis. Can you tell me what is the best way to achieve this?

Currently I do have only a power linear display. There is no problem to convert it to energy in kWh, but I don’t know what should I do to get a display as above.

I would use persistence and calculate the last 1 hour and last 24 hours delta.

That’s nice to visualize and to compare over time

Can you expand a little bit? If it helps I can send to Openhab an “impulse” from my enegry meter. It would be every 0,001 kWh, but still don’t know how to prepare data for openhab to count it for every time interval I want (5 minutes, 1 hour, 1 day, 1 month).

And I’ve got another question regarding the chart. At the moment I can display a chart and see how value has changed but what to do to display specific value by clicking on it. For example, I would like to check what was the exact value of power at 12:36 pm. At the moment I can only see it looking on the chart line, but the scale of chart is too big to see exact value.

First you need an item representing the total consumption (thought you have it already).
This item can increase by a rule based on your impulse.

2nd you can add additional items for last hours / last days energy

Hope I understood the problem right - I have a similar use case - my HP is reporting a total number of hours being in use. I store those values in influxdb and based on those, I can chart i.e. usage per month, as below:

using

config:
  chartType: month
  label: HP Operating Time
slots:
  grid:
    - component: oh-chart-grid
      config: {}
  xAxis:
    - component: oh-category-axis
      config:
        gridIndex: 0
        categoryType: month
  yAxis:
    - component: oh-value-axis
      config:
        gridIndex: 0
        axisLabel:
          formatter: "{value} h"
    - component: oh-value-axis
      config:
        gridIndex: 0
        offset: 32
        axisLabel:
          formatter: "{value} °C"
  series:
    - component: oh-aggregate-series
      config:
        name: DHW
        gridIndex: 0
        xAxisIndex: 0
        yAxisIndex: 0
        type: bar
        item: gBasement_BoilerRoom_HP_DHW_InOperation_HP
        dimension1: date
        aggregationFunction: diff_last
        service: influxdb
        markLine:
          data:
            - type: average
    - component: oh-aggregate-series
      config:
        name: Heating Water
        gridIndex: 0
        xAxisIndex: 0
        yAxisIndex: 0
        type: bar
        item: gBasement_BoilerRoom_HP_RAD_InOperation_HP
        dimension1: date
        aggregationFunction: diff_last
        service: influxdb
        markLine:
          data:
            - type: average
  tooltip:
    - component: oh-chart-tooltip
      config:
        show: true
  legend:
    - component: oh-chart-legend
      config:
        bottom: 16

where gBasement_BoilerRoom_HP_DHW_InOperation_HP and gBasement_BoilerRoom_HP_RAD_InOperation_HP are number of hours (in use) for domestic hot water and floor heating, both always increasing … since HP only has resolution per hour the chart is not that detailed, but still good enough to see per month consumption :wink:

Hi Crnjan, do you found a solution for this problem?
Thank you.
BR
Marvin