Mini-graph-card - Show kWh per day

I want to show how many kWh per day my radiator has consumed. But it appears I am just getting it accumulated. Can anyone point me in the right direction?

Expected outcome:

Monday: 1 kWh
Tuesday: 3 kWh
Wednesday: 1 kWh
Thursday: 5 kWh
Friday: 1 kWh

Total for period: 11 kWh

Using this code:

type: custom:mini-graph-card
name: Radiator kWh
icon: mdi:transmission-tower-export
decimals: 3
font_size: 80
font_size_header: 12
height: 60
hours_to_show: 168
group_by: date
aggregate_func: max
show:
  graph: bar
entities:
  - entity: sensor.pump_room_radiator_outlet_smartenergysummation
    name: Radiator kWh

I get this outcome:

image

As you can see it just accumulates. The total consumption is 7.894 kWh, but I want to see how it has been divided over the last 7 days.

That should do the trick, you can setup a new sensor which resets daily and feed it with you total KWh sensor.

1 Like

Thanks! I am testing it out now :slight_smile:

You can also do it easily in apex-charts card taking advantage of long-term statistics - so you can even display longer periods. This is my example code that does it

type: custom:apexcharts-card
header:
  show: true
  title: Lodówka energia
graph_span: 14d
yaxis:
  - min: 0
series:
  - entity: sensor.lodowka_energy
    group_by:
      func: diff
      duration: 1d
    statistics:
      period: hour
      type: sum
      align: start
    type: column
    color: '#7b99b5'
span:
  start: day
  offset: '-13d'
1 Like

Thanks! That worked out like a charm!

image

Another question on this apex, how would I show the total accumulated value during the period in the header? Now it shows the last day’s value there (1.5 kWh and 1.7 degrees). Is there a way?

For the mini-graph card:
Show additional Info

1 Like

Could you paste your config for this card? I’dd like to add the temperature and the header values in mine, but I can’t find how…

I have the same problem… i dont know if i understand this right. I have 2 option in my mind.

OPTION 1: So your saying create a sensor that resets daily and use it as a source for the Utility Meter?

OR

OPTION 2: Create a Utility Meter that resets daily and feed it with a source sensor that never resets or cycle?

What i want to achieve:

Create a mini graph that will display daily energy usage in kWh bar graph for 7 days. But also show the total kWh usage for a month in the top header of the mini graph…