How to convert total-increasing (Gas Consumption) sensor back to "amount-per-hour" sensor?

I use the hildebrand glow integration, this gives me a “sensor.gas_consumption_today” which is a total-increasing value of my gas use, in kwh, updated every 30 mins, that resets to zero every night. I have this as my gas consumption sensor in the energy dashboard and it all works as expected. energy dashboard shows me nice graph of gas use per hour and keeps track of the long term use over the days weeks and months. all good, thanks to those who coded it!
What I now want to do is plot in a new graph (not in the energy dashboard) of gas use within a specific hour , plotted for a day, against outside temperature. The energy dashboard must already be doing this with the data contained in this gas sensor, because its displaying per-hour values in exactly the way that I want to see them. however if I graph this gas consumption sensor directly in a history graph, I get a constantly increasing value which is not what I want. Is there a way to convert this to a sensor that has 1 datapoint per hour, containing “the energy (kwh) used in the last hour”?

Hi @sandyman44

As far as I know there isn’t a way to use the results shown in the energy dashboard.

What you can do is use the Utility Meter Helper. If you Google Home Assistant Utility Meter then you’ll find details on how to use it.

You could also look at the Apex charts HACS card which can also provide ways to do this.

thanks. as far as I can tell, utility meter integration is for doing the exact opposite of what I want. i.e. it tracks consumption of a sensor in a format that functions like a utility meter. In this case I HAVE the utility meter, what I want is the per-hour consumption numbers.
apex-charts, I RTFM’d, I can’t see anyway to make it do maths on multiple values from the series .
all I actually want to plot is the values of (gasmeter(hourN) minus gasmeter(hour N-1)), for hours 0-23.

or if the energy dashboard people would add an option to “graph against this sensor” (in my case outside temperature) to the consumption per-hour / day dashboards.

From the description of the utility meter:

This sensor will track a source sensor values, automatically resetting the meter based on the configured cycle


Meter reset cycle
How often to reset the c byounter. If the offered reset cycles do not match your use case, consider using the YAML configuration below, which allows for creating CRON-style patterns.

The reset cycle can be set to one hour. This means that if the meter is at 1 kWh after one hour and at 2 kWh after two hours then the utility meter will reset at the end of the first hour and record 1 kWh for each hour.

Here’s a picture of my ApexCharts based on the hildebrand integration:

just wanted to say thanks for this suggestion - took me a while as had to tweak a few things, but its now working. resetting the meter every hour simply hadn’t occured to me, but that gives the exact behaviour we need. many thanks again.