Help understanding Energy dashboards and data representation


I’ve been trying for a few days to figure out how to properly setup my energy dashboard and sensors. I am using DCC Hildebrand sensor (which had some issues on it’s own, but I think I may have fixed this) and here is what I observe, but I don’t necessarily understand.

Let’s take for example the sensor which is gathering hourly statistics about consumption:

In the history, I can see this:

At 18:18:54 I have recorded consumption of 0.8kWh for the hour. Previous reading (17:18:52) is 0.75. and more interestingly, the reading at 19:18:53 shows 0.75kWh:

However, when I check it on the energy dashboard, it looks like this:

and the 19:18:53 shows as negative on the graph, with a value of 0.05 kWh

My sensor’ SCAN_INTERVAL is set to 60 minutes and it seems to accurately collect the kWh for the hour, but the dashboard is totally failing…

When I “zoom in” in the energy statistics (adjust the sum), I see this recorded for 19:15

Another thing to mention is that if I go to Developer Tools > Statistics and press on recorder for the sensor in question, I see data for times that I know for fact I have not had collected any data

Those ^^ appear every 5 minute, which I have absolutely no idea where are they coming from, but I cannot adjust or see these anywhere else.

I am totally new to home assistant and my apologies of all the above makes sense, it is just so I cannot figure it out… Thanks in advance for your time!

You can’t use that sensor in the energy dashboard. It expects an always increasing energy total. Or a total that resets to zero daily.

If you don’t have a sensor like this, feed your hourly energy sensor to a utility meter helper set to use delta values and no reset cycle. Feed the sensor created by the utility meter to the energy dashboard.

1 Like

Oh my… Is that what it is … So the value for the sensor must be always increasing with every reading and I can start with a 0 at 00:00 and eventually finish with 80 kWh at the end of the day & then re-set? That makes sense… Can you help me understand the samplings. If I am doing this once every 30min or once every hour, how does this affect the dashboard and the overall readings? :thinking: What’s the best place to go & read about these things? BTW, I have set the sensor to total right now (and not total_increasing).

    """Sensor object for daily usage."""

    _attr_device_class = SensorDeviceClass.ENERGY
    _attr_has_entity_name = True
    _attr_name = "Usage (last)"
    _attr_native_unit_of_measurement = UnitOfEnergy.KILO_WATT_HOUR
    _attr_state_class = SensorStateClass.TOTAL