Statistic card equivalent template sensor?

Hello,

I have the following statistic card, showing the sum of the total consumption for the actual Quarter.

I would like to have the same result but in a template sensor to be able to make calculations. What would be the correct way to achieve this ?

Bonus question : Can I have Q1, Q2, Q3 and Q4 without having to modify the template every quarter ?

type: statistic
entity: sensor.hs110_total_consumption
period:
  fixed_period:
    start: '2024-01-01T00:00:00.000Z'
    end: '2024-03-30T00:00:00.000Z'
stat_type: change

Thank you very much in advance for any tips !

1 Like