Calculate Gas Flowrate from meter readings

I’ve only been using HomeAssistant for a few weeks, so I’m certainly no expert. But what I understood during my InfluxDB integration is that HomeAssistant might only sends data when the value change. So I assumed it also only writes values to it’s internal sqlite database when the data is changed and therefor the template sensor only sees a change when the value from the source is actually different that the previous reading.

But I’ve not looked at the code yet. But when I attached the derivative sensor to the gas_consumption (DSMR integration) the graph looked strange and continuously went back to 0 since the gas sensor was updated once every 5min instead of the DSMR 10sec read interval I suppose.