Energy dashboard is shifted one hour

Every electric meter in Norway, Sweden and Denmark, and probably other countries as well, report used energy at intervals. In Norway it is each hour. I believe that is true in Sweden as well. And in Denmark, I understand it is each 15 minutes. Anyway, the problem is the reported energy used is sent from the electric meter after the interval is finished. And that means that every state change on the energy sensor is in the wrong hour or day for the norwegian electric meters. The sensor for the cost / price of electricity is usually changing a few seconds before the energy sensor changes, so we get the wrong price, too.

As you see, there is timing issues regarding state changes of price and energy when it happens at the hour. In the energy dashboard, it should be possible to configure some offsets to the entities so that energy is mapped to the correct price and the correct hour.

The price is updated on each hour

The energy is updated 10-15 seconds after each hour

The energy dashboard doesn’t get anything right with this. The energy is stored in the wrong hour and mapped to the wrong price. This is a situation that is quite common and as the electricity meter is owned by the grid company, it is nothing we can do with it.

So just take your snapshot on the half hour, and then you know the number represents the prior hour’s stats and you can do the proper calculations. If you try to sync to the exact time, you will always have issues.

This is the best offset because it will always be right. You are not relying on the exact sync to the second. You are chasing a moving target.

OK, but I have not made the Energy Dashboard and cannot change it. Thats why I made a feature request.

And what you suggest, does not solve the problem that the value from the meter is registered for the current hour and not the previous one.

I would love this to be implemented as the data is delayed for 4 hours here. It is not possible to change out the meter because I am living in an apartment.

It should be possible for a sensor to contain a timestamp of last update, and have the energy dashboard parse from that instead.

Offsetting the dashboard seems like a reasonable request. But strictly speaking the usage is reported in the wrong timeframe. There’s no way the dashboard would be able to fix pricing in a reasonable way. I guess for that you’d need to create a energy price sensor that reports the right price at the time the meter sends the data. I would try to create such a sensor a.s.a.p. because if Home Assistant would ever implement an offset, it would not be able to " fix" price history.

I am surprised though you only get usage once an hour. In the Netherlands I use a P1 port on the meter to get near instant usage data. I set the Energy meter to report way less frequently to the Energy company, because they don’t need to info any more detailed then required for pricing. I do not rely on them to get my own data back, nor would I want them to have this much information on me.

That timestamp is the timestamp HA receives it, and that is what is used now. So unless the energy company sends “old” timestamps with their usage it would not be possible. Currently Home Assistant has no way to backdate sensor data at all. There’s no sensor history import method. Also it would make no sense to automations responding on sensor changes. So backdating sensor data would mke it impossible to have automtions react on it.

I want to say +1 here (and for a few more HA installations I’m supporting for friends)

In the energy dashboard I think we need to differ between sensor data (users devices tracking individual devices energy usage in real-time) and grid usage that is “always” information recieved from the grid.

And regarding official energy meters the last hours consumption could not be sent before the hour is ended. Period.

And since more or less all grid data is generated by devices not available to configure by the end user and for newer buildings even located outside there is no need to argue about HA don’t support historic data.

Grid consumption IS historic data, and it should really be possible to enable a setting for “shifting grid usage back” and then a field for filling in either minutes or hour (one hour is probably the main goal for most users)

This kind of grid meters that is used in the Nordic countries, and probably being rolled out in most of Europe in the future means that there is such a large amount of users affected that telling everyone that they should buy another meter or use utility meter to workaround such a common problem is not good practice.

It’s not about recalculating the whole database, for most users (that only track one grid meter) it’s one reading every hour.

It’s not needed to change the data stored, as long as the energy dashboard is able to shift the grid usage by “x” time when displaying the graphs then everything is OK. I can’t tell it’s a big deal, I’m not a skilled programmer so I’m probably not the right person to fix it, but since it’s open source I might have a look at it if I get angry enough…

1 Like