ApexCharts: cumulative to per-hour consumtion

Hello,

The Mitsubishi heat pump provides the cumulative consumption (since the pump installation? since the MELCloud account activation? whatever). You can see the graph starts with 837 kWh, and goes to 838 kWh.

Here is the configuration snippet:

type: custom:apexcharts-card
hours_12: false
header:
  show: true
  title: A/C Power Consumption
  show_states: true
  colorize_states: true
span:
  start: day
series:
  - entity: sensor.main_energy

Is there a way to transform this into per-hour consumption?

Basically, every hour I would like to display the bar with

the height = (this hour cumulative consumption) - (previous hour cumulative consumption)

I have the exact same question. Did you ever find a solution?

Did you ever get any solution?

I came searching for the same, and could only find a solution which works without long term statistics (see below).

Any idea how to achieve this including all data? Tried enabling statistics in ApexCharts but doesn’t work together with grouping.

Without querying statistics I could do it by grouping the series entity. In the case above would be:

series:
  - entity: sensor.main_energy
    group_by:
      func: diff
1 Like