Energy dashboard skipping hours

Hi!

I’ve just set up an electricity meter reader and integrated it into HA through Zigbee2mqtt and Mosquitto mqtt broker. The reader is made by Datek, model HSE2905E. It gets data from a meter over HAN-port/m-bus

The readings from the sensor are working great, but I’m having an issue with getting the data to display correctly on the energy dashboard. The reported energy usage seems to skip every other hour. This causes the hour after to display both the missing hour and the actual hour.

Looking at the data from the reader, all looks good.

Looking a little closer at the data, I can see that the sensor updates at about either 00:41 or 59:41 every hour. The times at which the data is “late” coincides with when the data is “missing” in the energy dashboard.

I’ve read on other posts that the energy dashboard updates 12 minutes past the hour, every hour. That statement seem not to be true in my case.

Is there a way to change the update time of the energy dashboard, or am I missing something?

I would expect the issue to not be when the energy dashboard updates its data, but rather that it aggregates data into hours (at least if you show a period of one day). So if there was no change in one full hour, it may show this as zero? At least that would be my guess, you can check the exact values to see if this makes sense.

If I’m right, a simple solution would be to increase the polling rate of the sensor, if possible on your setup. The more often it updates, the more reliable will be the hourly data.

1 Like

Thanks for you reply!

I think you are right concerning the cause, but I’m more unsure about the solution.

I’m pretty sure the sensor polls the meter quite often, as it also reports voltage, current and wattage. Though I think it is the meter itself that only changes its energy output once an hour. This would also be inline with how the cost is calculated for the energy (price at that hour interval, times the kWh used in that hour).

Here is a more detailed picture of the kWh for the past couple of hours:

I think the cause is rightly identified, but there’s no easy solution if the meter won’t update more often.

You could try to use a Riemann Sum Integral sensor (left method) over wattage if that does update quickly, but it might not be as accurate.

You could also create a template sensor that picks all values at the half hour. That would give you an increase every hour, but shown one hour late in the dashboard.

1 Like

Looks like there is no simple solution then. Since the metter works like this due to the changing hourly price, maybe together with the reading it sends the info on which hour it is for. If that’s true, in theory it could be used to insert the data with the corrected timestamp. But that’s advanced magic, I have no clue how to do it.

1 Like

Thank you both for the replies.

I feared as much. Guess I’ll implement it in another environment, like Grafana.