Graph card for "last 12 months" energy/gas usage MONTHLY bar chart?

Hey everyone,
is there a custom graph card that would allow me to basically recreate the “year” view of the energy dashboard bar charts (one bar per month), but not by calendar year but by rolling last 12 months? I started tracking power and gas usage in August, and it’s kind of a bummer that currently I have to switch between 2022 and 2023 for an overall development view, instead of being able to just see everything of the last 12 months in one graph. The usual suspects (mini-graph-card, apexcharts) don’t support grouping by calendar month from what I found. Any lead would be highly appreciated :slight_smile:
Cheers!

Check Apecharts…can do a lot more than you possibly imagined, there is a huge post on forum too

I understood the documentation that grouping by month is not supported:

" It builds buckets of states over duration period of time. Doesn’t work for months. Eg of valid values: 2h , 1d , 10s , 25min , 1h30 , …"

All workarounds I found used stuff like “31days” or “4 weeks”, but that’s not in line with calendar months.

1 Like

Hmm…then it does less then I expected.
Try this then…
dbuezas/lovelace-plotly-graph-card: Highly customisable Lovelace card to plot interactive graphs. Brings scrolling, zooming, and much more! (github.com)

1 Like

That one works perfectly, thanks a lot!

edit, in case someone has the same issue and stumbles over this thread in the future:

type: custom:plotly-graph
title: Gas usage
entities:
  - entity: sensor.gas_usage
    unit_of_measurement: m³
    texttemplate: '%{y}'
    type: bar
    statistic: sum
    period: month
    offset: 15
    filters:
      - delta
  - entity: sensor.outside_temperature
    statistic: mean
    type: line
    name: Outside temp
    period: day
    filters:
      - exponential_moving_average: null
    line:
      width: 3
hours_to_show: 8M
refresh_interval: 10

7 Likes