Custom Water meter HACS integration not playing well with Energy dashboard?

Hi all, I’ve written a custom HACS integration to pull water data from Sensus Analytics. One of the sensors is hourly usage. When looking at the data by clicking on the entity through the GUI, the graph looks correct:


Meanwhile in the Energy Dashboard:

Is there some other setting I need to apply to this sensor so that the Dashboard interperates the data properly?

That sensor is not behaving the way a total state class sensor is expected to behave, so energy has no hope to get valid data from it.

I think what might work is to feed sensor to a utility meter with delta_values: true.

Right, this is what I’m asking – I’m trying to change the integration so that it does behave correctly. I see there’s a “last_reset” attribute that might be what I need to utilize – I’ll give that a shot and see how tomorrow goes.

The sensor’s state is reset with every state update, for example a sensor updating every minute with the energy consumption during the past minute: state class SensorStateClass.TOTAL, last_reset updated every state change.

I guess if you updated last_reset on every state change that also sounds like it might work.